r173855 - [Frontend] Make the include dir group independent from the "use sysroot" bit.
Daniel Dunbar
daniel at zuster.org
Tue Jan 29 15:59:45 PST 2013
Author: ddunbar
Date: Tue Jan 29 17:59:45 2013
New Revision: 173855
URL: http://llvm.org/viewvc/llvm-project?rev=173855&view=rev
Log:
[Frontend] Make the include dir group independent from the "use sysroot" bit.
- This slightly decouples the path handling, since before the group sometimes
dominated the "use sysroot" bit, but it was still passed in via the API.
- No functionality change.
Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=173855&r1=173854&r2=173855&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Jan 29 17:59:45 2013
@@ -833,7 +833,7 @@ static void ParseHeaderSearchArgs(Header
= IsIndexHeaderMap? frontend::IndexHeaderMap : frontend::Angled;
Opts.AddPath((*it)->getValue(), Group,
- /*IsFramework=*/ (*it)->getOption().matches(OPT_F), false);
+ /*IsFramework=*/ (*it)->getOption().matches(OPT_F), true);
IsIndexHeaderMap = false;
}
@@ -847,18 +847,18 @@ static void ParseHeaderSearchArgs(Header
Prefix = A->getValue();
else if (A->getOption().matches(OPT_iwithprefix))
Opts.AddPath(Prefix.str() + A->getValue(),
- frontend::After, false, false);
+ frontend::After, false, true);
else
Opts.AddPath(Prefix.str() + A->getValue(),
- frontend::Angled, false, false);
+ frontend::Angled, false, true);
}
for (arg_iterator it = Args.filtered_begin(OPT_idirafter),
ie = Args.filtered_end(); it != ie; ++it)
- Opts.AddPath((*it)->getValue(), frontend::After, false, false);
+ Opts.AddPath((*it)->getValue(), frontend::After, false, true);
for (arg_iterator it = Args.filtered_begin(OPT_iquote),
ie = Args.filtered_end(); it != ie; ++it)
- Opts.AddPath((*it)->getValue(), frontend::Quoted, false, false);
+ Opts.AddPath((*it)->getValue(), frontend::Quoted, false, true);
for (arg_iterator it = Args.filtered_begin(OPT_isystem,
OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it)
Opts.AddPath((*it)->getValue(), frontend::System, false,
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=173855&r1=173854&r2=173855&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Tue Jan 29 17:59:45 2013
@@ -122,9 +122,7 @@ void InitHeaderSearch::AddPath(const Twi
StringRef MappedPathStr = Path.toStringRef(MappedPathStorage);
// Prepend the sysroot, if desired and this is a system header group.
- if (HasSysroot && !IgnoreSysRoot &&
- (Group == System || Group == CXXSystem) &&
- CanPrefixSysroot(MappedPathStr)) {
+ if (HasSysroot && !IgnoreSysRoot && CanPrefixSysroot(MappedPathStr)) {
MappedPathStorage.clear();
MappedPathStr = (IncludeSysroot + Path).toStringRef(MappedPathStorage);
}
More information about the cfe-commits
mailing list