aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2011-03-06 23:31:01 +0000
committerJoerg Sonnenberger <joerg@bec.de>2011-03-06 23:31:01 +0000
commit9ade4ae4fb7ed1fcbd63835d9f8f53052f0657a2 (patch)
tree40f863a2a3a64bfc81647d6ebc32185e5b381c5e /tools/driver/driver.cpp
parent4707b9acf75c68c90278757ffd6a05b2544bc1eb (diff)
If called as *cpp or *cpp-[^-]*, run only the preprocessor. If no
input is specified, use stdin implicitly. Based on a patch from Roman Divacky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r--tools/driver/driver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 0b5d2c97a4..71baf8d788 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -342,6 +342,11 @@ int main(int argc_, const char **argv_) {
TheDriver.CCCIsCXX = true;
}
+ if (llvm::StringRef(ProgName).endswith("cpp") ||
+ llvm::StringRef(ProgName).rsplit('-').first.endswith("cpp")) {
+ TheDriver.CCCIsCPP = true;
+ }
+
// Handle CC_PRINT_OPTIONS and CC_PRINT_OPTIONS_FILE.
TheDriver.CCPrintOptions = !!::getenv("CC_PRINT_OPTIONS");
if (TheDriver.CCPrintOptions)