This is an archive of the discontinued LLVM Phabricator instance.

Fix rewrite of reserved library name in case of -nodefaultlibs
ClosedPublic

Authored by niravd on Nov 23 2015, 2:09 PM.

Details

Summary

The Driver only checked if nostdlib was set when deciding to add
reserved_lib_stdcxx, but as nostdlib is always exactly nodefaultlibs and
nostartfiles we should be checking one (clearly nodefaultlibs in the
case) as well. This appears to be the only such instance of this in the
codebase.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd updated this revision to Diff 40976.Nov 23 2015, 2:09 PM
niravd retitled this revision from to Fix nodefaultlibs/nostdlib check.
niravd updated this object.
niravd added reviewers: dougk, jyknight.
niravd added subscribers: cfe-commits, rsmith.
jyknight edited edge metadata.Nov 23 2015, 2:29 PM

The commit message could use some work: please summarize what you're actually changing, and why. (Here you mention only vaguely why, and not what.)

test/Driver/nodefaultlib_stdc.c
1 ↗(On Diff #40976)

It's typically preferred to put a test in the same file as related tests -- so, merge nodefaultlib_stdc.c into the nodefaultlib.c file. You can do this without having the assertion lines conflict with each-other by using the "--check-prefix" argument to FileCheck.

This test doesn't specify a target, and thus will run for whatever the default compiled-in target is for each user's clang. Might want to specify a target explicitly to avoid that. Maybe this test actually works for all targets, anyways, but it's probably safer to just specify one. :)

niravd updated this revision to Diff 41040.Nov 24 2015, 6:54 AM
niravd edited edge metadata.

Fix review issues

niravd retitled this revision from Fix nodefaultlibs/nostdlib check to Fix rewrite of reserved library name in case of -nodefaultlibs.Nov 24 2015, 6:56 AM
niravd updated this object.
jyknight accepted this revision.Nov 24 2015, 8:02 AM
jyknight edited edge metadata.
This revision is now accepted and ready to land.Nov 24 2015, 8:02 AM
This revision was automatically updated to reflect the committed changes.