diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-06-29 22:03:56 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-06-29 22:03:56 +0000 |
commit | e75d9cfbf41a0ee9e456a665776f91fdd9773b36 (patch) | |
tree | 13125e0fea4a9ade1f56af7507b1dd2cd550a79c /lib/Driver/Driver.cpp | |
parent | 4ac5751efb9de1065c71b0db587185d552803e2f (diff) |
Use -frewrite-includes for crash reports.
In future changes we should:
* use __builtin_trap rather than derefing 'random' volatile pointers.
* avoid dumping temporary files into /tmp when running tests, instead
preferring a location that is properly cleaned up by lit.
Review by Chandler Carruth.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index a6af7af771..2f2d07c8b9 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -392,6 +392,7 @@ void Driver::generateCompilationDiagnostics(Compilation &C, // Suppress driver output and emit preprocessor output to temp file. CCCIsCPP = true; CCGenDiagnostics = true; + C.getArgs().AddFlagArg(0, Opts->getOption(options::OPT_frewrite_includes)); // Save the original job command(s). std::string Cmd; @@ -1181,7 +1182,10 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, if (Args.hasArg(options::OPT_M, options::OPT_MM)) { OutputTy = types::TY_Dependencies; } else { - OutputTy = types::getPreprocessedType(Input->getType()); + OutputTy = Input->getType(); + if (!Args.hasFlag(options::OPT_frewrite_includes, + options::OPT_fno_rewrite_includes, false)) + OutputTy = types::getPreprocessedType(OutputTy); assert(OutputTy != types::TY_INVALID && "Cannot preprocess this input type!"); } |