Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: Remove filespec.d #17009

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/build.d
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ auto sourceFiles()
"),
backend: fileArray(env["C"], "
bcomplex.d evalu8.d divcoeff.d dvec.d go.d gsroa.d glocal.d gdag.d gother.d gflow.d
dout.d inliner.d eh.d filespec.d aarray.d
dout.d inliner.d eh.d aarray.d
gloop.d cgelem.d cgcs.d ee.d blockopt.d mem.d cg.d
dtype.d debugprint.d fp.d symbol.d symtab.d elem.d dcode.d cgsched.d
pdata.d util2.d var.d backconfig.d drtlsym.d ptrntab.d
Expand Down
34 changes: 33 additions & 1 deletion compiler/src/dmd/backend/dwarfdbginf.d
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import dmd.backend.dlist;
import dmd.backend.el;
import dmd.backend.elfobj : addSegmentToComdat;
import dmd.backend.filespec;
import dmd.backend.machobj : getsegment2;
import dmd.backend.global;
import dmd.backend.obj;
Expand Down Expand Up @@ -3234,3 +3233,36 @@
void dwarf_CFA_offset(int reg, int offset) { }
void dwarf_except_gentables(Funcsym *sfunc, uint startoffset, uint retoffset) { }
}

version (Windows)
{
private enum DIRCHAR = '\\';

private bool ispathdelim(char c) nothrow { return c == DIRCHAR || c == ':' || c == '/'; }

Check warning on line 3241 in compiler/src/dmd/backend/dwarfdbginf.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/backend/dwarfdbginf.d#L3241

Added line #L3241 was not covered by tests
}
else
{
private enum DIRCHAR = '/';

private bool ispathdelim(char c) nothrow { return c == DIRCHAR; }
}

/**********************
* Returns: string that is the filename plus dot and extension.
* The string returned is NOT mem_malloc'ed.
*/
@trusted
private char* filespecname(const(char)* filespec) nothrow
{
const(char)* p;

Check warning on line 3257 in compiler/src/dmd/backend/dwarfdbginf.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/backend/dwarfdbginf.d#L3257

Added line #L3257 was not covered by tests

/* Start at end of string and back up till we find the beginning
* of the filename or a path
*/
for (p = filespec + strlen(filespec);
p != filespec && !ispathdelim(*(p - 1));
p--

Check warning on line 3264 in compiler/src/dmd/backend/dwarfdbginf.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/backend/dwarfdbginf.d#L3262-L3264

Added lines #L3262 - L3264 were not covered by tests
)
{ }
return cast(char *)p;

Check warning on line 3267 in compiler/src/dmd/backend/dwarfdbginf.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/backend/dwarfdbginf.d#L3267

Added line #L3267 was not covered by tests
}
94 changes: 0 additions & 94 deletions compiler/src/dmd/backend/filespec.d

This file was deleted.

Loading