summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-06-29 22:03:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-06-29 22:03:56 +0000
commit5d577a225e1186a7a800bdc11818027237ffbc96 (patch)
tree5526430edd34196f6b7051019ca1a3d14419a2a0 /clang/lib/Driver/Driver.cpp
parent5ef31a9c46db8431a76239857d1f76773cbc9730 (diff)
downloadbcm5719-llvm-5d577a225e1186a7a800bdc11818027237ffbc96.tar.gz
bcm5719-llvm-5d577a225e1186a7a800bdc11818027237ffbc96.zip
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. llvm-svn: 159469
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index a6af7af7718..2f2d07c8b97 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/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!");
}
OpenPOWER on IntegriCloud