@@ -1432,14 +1432,11 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
1432
1432
A->render (Args, CmdArgs);
1433
1433
}
1434
1434
1435
- Args.AddAllArgs (CmdArgs,
1436
- {options::OPT_D, options::OPT_U, options::OPT_I_Group,
1437
- options::OPT_F, options::OPT_index_header_map});
1438
-
1439
1435
// The file being compiled that contains the integration footer is not being
1440
1436
// compiled in the directory of the original source. Add that directory
1441
- // as an -internal-isystem option so we can properly find potential headers
1442
- // there.
1437
+ // as an -I option so we can properly find potential headers there. The
1438
+ // original source search directory should also be placed before any user
1439
+ // search directories.
1443
1440
if (ContainsAppendFooterAction (&JA)) {
1444
1441
SmallString<128 > SourcePath (Inputs[0 ].getBaseInput ());
1445
1442
llvm::sys::path::remove_filename (SourcePath);
@@ -1453,6 +1450,10 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
1453
1450
}
1454
1451
}
1455
1452
1453
+ Args.AddAllArgs (CmdArgs,
1454
+ {options::OPT_D, options::OPT_U, options::OPT_I_Group,
1455
+ options::OPT_F, options::OPT_index_header_map});
1456
+
1456
1457
// Add -Wp, and -Xpreprocessor if using the preprocessor.
1457
1458
1458
1459
// FIXME: There is a very unfortunate problem here, some troubled
0 commit comments