diff options
| author | joerg <joerg@NetBSD.org> | 2014-01-05 15:29:16 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2014-01-05 15:29:16 +0000 |
| commit | f953fddd9b20c29368d744f65ffa4a6ce56e4e97 (patch) | |
| tree | e5c465089addc21cc5a30265fd34ced922dc4fd4 /external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp | |
| parent | 2c71d0c595b46327aa0deef34df64f452fa3423f (diff) | |
Import clang 3.5svn r198450.
Diffstat (limited to 'external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp')
| -rw-r--r-- | external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp b/external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp index c962055de79..62144200189 100644 --- a/external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp +++ b/external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp @@ -204,8 +204,8 @@ private: /// \li true if successful. /// \li false if \c Args cannot be used for compilation jobs (e.g. /// contains an option like -E or -version). -bool stripPositionalArgs(std::vector<const char *> Args, - std::vector<std::string> &Result) { +static bool stripPositionalArgs(std::vector<const char *> Args, + std::vector<std::string> &Result) { IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); UnusedInputDiagConsumer DiagClient; DiagnosticsEngine Diagnostics( @@ -237,6 +237,11 @@ bool stripPositionalArgs(std::vector<const char *> Args, // up with no jobs but then this is the user's fault. Args.push_back("placeholder.cpp"); + // Remove -no-integrated-as; it's not used for syntax checking, + // and it confuses targets which don't support this option. + std::remove_if(Args.begin(), Args.end(), + MatchesAny(std::string("-no-integrated-as"))); + const OwningPtr<driver::Compilation> Compilation( NewDriver->BuildCompilation(Args)); @@ -271,6 +276,7 @@ bool stripPositionalArgs(std::vector<const char *> Args, End = std::remove_if(Args.begin(), End, MatchesAny(DiagClient.UnusedInputs)); // Remove the -c add above as well. It will be at the end right now. + assert(strcmp(*(End - 1), "-c") == 0); --End; Result = std::vector<std::string>(Args.begin() + 1, End); |
