|
48 | 48 | #include <unistd.h> // For getuid().
|
49 | 49 | #endif
|
50 | 50 |
|
| 51 | +// FIXME temporary debug flag |
| 52 | +#define IF_DEBUG_OMP if (false) |
| 53 | + |
51 | 54 | using namespace clang::driver;
|
52 | 55 | using namespace clang::driver::tools;
|
53 | 56 | using namespace clang;
|
@@ -1320,14 +1323,29 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
|
1320 | 1323 | // Add C++ include arguments, if needed.
|
1321 | 1324 | if (types::isCXX(Inputs[0].getType())) {
|
1322 | 1325 | bool HasStdlibxxIsystem = Args.hasArg(options::OPT_stdlibxx_isystem);
|
1323 |
| - forAllAssociatedToolChains( |
1324 |
| - C, JA, getToolChain(), |
1325 |
| - [&Args, &CmdArgs, HasStdlibxxIsystem](const ToolChain &TC) { |
| 1326 | + |
| 1327 | + auto AddSysIncludes = [&Args, &CmdArgs, HasStdlibxxIsystem](const ToolChain &TC) { |
1326 | 1328 | HasStdlibxxIsystem ? TC.AddClangCXXStdlibIsystemArgs(Args, CmdArgs)
|
1327 | 1329 | : TC.AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
|
1328 |
| - }); |
| 1330 | + IF_DEBUG_OMP { |
| 1331 | + llvm::errs() << "With includes (" << HasStdlibxxIsystem << " for TC: " << TC.getArchName() << ") :\n "; |
| 1332 | + for (const auto *CA : CmdArgs) { |
| 1333 | + llvm::errs() << CA << ", "; |
| 1334 | + } |
| 1335 | + llvm::errs() << "\n"; |
| 1336 | + } |
| 1337 | + }; |
| 1338 | +#if 1 |
| 1339 | + // only consider the host toolchain |
| 1340 | + AddSysIncludes(getToolChain()); |
| 1341 | +#else |
| 1342 | + forAllAssociatedToolChains( |
| 1343 | + C, JA, getToolChain(), AddSysIncludes); |
| 1344 | +#endif |
1329 | 1345 | }
|
1330 | 1346 |
|
| 1347 | + |
| 1348 | + |
1331 | 1349 | // Add system include arguments for all targets but IAMCU.
|
1332 | 1350 | if (!IsIAMCU)
|
1333 | 1351 | forAllAssociatedToolChains(C, JA, getToolChain(),
|
@@ -3910,6 +3928,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
3910 | 3928 | const llvm::Triple &Triple = TC.getEffectiveTriple();
|
3911 | 3929 | const std::string &TripleStr = Triple.getTriple();
|
3912 | 3930 |
|
| 3931 | + IF_DEBUG_OMP { llvm::errs() << "JAK: " << Action::getClassName(JA.getKind()) << " (" << TripleStr << ")\n"; } |
| 3932 | + |
3913 | 3933 | bool KernelOrKext =
|
3914 | 3934 | Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext);
|
3915 | 3935 | const Driver &D = TC.getDriver();
|
|
0 commit comments