diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-21 20:11:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-21 20:11:54 +0000 |
commit | d6277fb9e0353edffc0d6c8655a65542c08cf6f1 (patch) | |
tree | e9148a353f1ad11aaf9b1692b1e073d6e130907d /lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | b7824d9919c3588e898c22f47a5248f10a7a084d (diff) | |
download | clang-d6277fb9e0353edffc0d6c8655a65542c08cf6f1.tar.gz |
[driver] When creating the compiler invocation out of command-line
arguments, force use of clang frontend for the driver.
Fixes rdar://11356765.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index b477adebad..0aca86e2c9 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -43,13 +43,17 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, Args.push_back("<clang>"); // FIXME: Remove dummy argument. Args.insert(Args.end(), ArgList.begin(), ArgList.end()); - // FIXME: Find a cleaner way to force the driver into restricted modes. We - // also want to force it to use clang. + // FIXME: Find a cleaner way to force the driver into restricted modes. Args.push_back("-fsyntax-only"); // FIXME: We shouldn't have to pass in the path info. driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(), "a.out", false, *Diags); + // Force driver to use clang. + // FIXME: This seems like a hack. Maybe the "Clang" tool subclass should be + // available for using it to get the arguments, thus avoiding the overkill + // of using the driver. + TheDriver.setForcedClangUse(); // Don't check that inputs exist, they may have been remapped. TheDriver.setCheckInputsExist(false); |