diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
| commit | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch) | |
| tree | 60a1694bec5a44d15456acc880cb2f91619f66aa /tools/driver/driver.cpp | |
| parent | 8f57cb0305232cb53fff00ef151ca716766f3437 (diff) | |
Notes
Diffstat (limited to 'tools/driver/driver.cpp')
| -rw-r--r-- | tools/driver/driver.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index 9d204ce6c0c2..fb7c6cc7b032 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -197,6 +197,16 @@ int main(int argc, const char **argv) { llvm::sys::getHostTriple().c_str(), "a.out", IsProduction, Diags); + // Check for ".*++" or ".*++-[^-]*" to determine if we are a C++ + // compiler. This matches things like "c++", "clang++", and "clang++-1.1". + // + // Note that we intentionally want to use argv[0] here, to support "clang++" + // being a symlink. + std::string ProgName(llvm::sys::Path(argv[0]).getBasename()); + if (llvm::StringRef(ProgName).endswith("++") || + llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) + TheDriver.CCCIsCXX = true; + llvm::OwningPtr<Compilation> C; // Handle QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS, used for editing a |
