summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-25 00:44:02 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-25 00:44:02 +0000
commitfcf2d428e4a4e4930dbef8eb55f89528eaa84af8 (patch)
treee208de0c7de5e9ba970f7d16ea82d87828c66604 /clang/lib/Driver/Driver.cpp
parent7baaee93e7af6f23e0838419c791dcfc61f18a81 (diff)
downloadbcm5719-llvm-fcf2d428e4a4e4930dbef8eb55f89528eaa84af8.tar.gz
bcm5719-llvm-fcf2d428e4a4e4930dbef8eb55f89528eaa84af8.zip
ASTUnit: Don't check that input files exist when parsing ASTs from the command
line -- they may be remapped (fake) files. This is useful for testing parsing entirely from memory. llvm-svn: 94395
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 852a018e10f..62c2d12cd3b 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -50,8 +50,8 @@ Driver::Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
Name(_Name), Dir(_Dir), DefaultHostTriple(_DefaultHostTriple),
DefaultImageName(_DefaultImageName),
Host(0),
- CCCIsCXX(false), CCCEcho(false), CCCPrintBindings(false),
- CCCGenericGCCName("gcc"), CCCUseClang(true),
+ CCCGenericGCCName("gcc"), CCCIsCXX(false), CCCEcho(false),
+ CCCPrintBindings(false), CheckInputsExist(true), CCCUseClang(true),
CCCUseClangCXX(true), CCCUseClangCPP(true), CCCUsePCH(true),
SuppressMissingInputWarning(false) {
if (IsProduction) {
@@ -579,10 +579,9 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const {
Ty = InputType;
}
- // Check that the file exists. It isn't clear this is worth doing, since
- // the tool presumably does this anyway, and this just adds an extra stat
- // to the equation, but this is gcc compatible.
- if (memcmp(Value, "-", 2) != 0 && !llvm::sys::Path(Value).exists())
+ // Check that the file exists, if enabled.
+ if (CheckInputsExist && memcmp(Value, "-", 2) != 0 &&
+ !llvm::sys::Path(Value).exists())
Diag(clang::diag::err_drv_no_such_file) << A->getValue(Args);
else
Inputs.push_back(std::make_pair(Ty, A));
OpenPOWER on IntegriCloud