aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-05 23:24:17 +0000
committerChris Lattner <sabre@nondot.org>2007-12-05 23:24:17 +0000
commit4f03783e04baea18f0372cfc626d0ece87b88fa7 (patch)
tree5a317e35b9350f191b081e5bb17308372a284e67 /Driver/clang.cpp
parent887407e71fd58de452361b77d72970e32b20ebe0 (diff)
Avoid passing Diags into InitializeIncludePaths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r--Driver/clang.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 484a03cc3f..7de87594ce 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -660,20 +660,14 @@ static void RemoveDuplicates(std::vector<DirectoryLookup> &SearchList) {
/// InitializeIncludePaths - Process the -I options and set them in the
/// HeaderSearch object.
static void InitializeIncludePaths(HeaderSearch &Headers, FileManager &FM,
- Diagnostic &Diags, const LangOptions &Lang) {
+ const LangOptions &Lang) {
// Handle -F... options.
for (unsigned i = 0, e = F_dirs.size(); i != e; ++i)
AddPath(F_dirs[i], Angled, false, true, true, FM);
// Handle -I... options.
- for (unsigned i = 0, e = I_dirs.size(); i != e; ++i) {
- if (I_dirs[i] == "-") {
- // -I- is a deprecated GCC feature.
- Diags.Report(SourceLocation(), diag::err_pp_I_dash_not_supported);
- } else {
- AddPath(I_dirs[i], Angled, false, true, false, FM);
- }
- }
+ for (unsigned i = 0, e = I_dirs.size(); i != e; ++i)
+ AddPath(I_dirs[i], Angled, false, true, false, FM);
// Handle -idirafter... options.
for (unsigned i = 0, e = idirafter_dirs.size(); i != e; ++i)
@@ -1014,10 +1008,19 @@ int main(int argc, char **argv) {
}
}
+ // -I- is a deprecated GCC feature, scan for it and reject it.
+ for (unsigned i = 0, e = I_dirs.size(); i != e; ++i) {
+ if (I_dirs[i] == "-") {
+ Diags.Report(SourceLocation(), diag::err_pp_I_dash_not_supported);
+ I_dirs.erase(I_dirs.begin()+i);
+ --i;
+ }
+ }
+
// Process the -I options and set them in the HeaderInfo.
HeaderSearch HeaderInfo(FileMgr);
DiagClient->setHeaderSearch(HeaderInfo);
- InitializeIncludePaths(HeaderInfo, FileMgr, Diags, LangInfo);
+ InitializeIncludePaths(HeaderInfo, FileMgr, LangInfo);
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
// Set up the preprocessor with these options.