From f953fddd9b20c29368d744f65ffa4a6ce56e4e97 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 5 Jan 2014 15:29:16 +0000 Subject: Import clang 3.5svn r198450. --- .../bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'external/bsd/llvm/dist/clang/lib/Tooling/CompilationDatabase.cpp') 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 Args, - std::vector &Result) { +static bool stripPositionalArgs(std::vector Args, + std::vector &Result) { IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions(); UnusedInputDiagConsumer DiagClient; DiagnosticsEngine Diagnostics( @@ -237,6 +237,11 @@ bool stripPositionalArgs(std::vector 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 Compilation( NewDriver->BuildCompilation(Args)); @@ -271,6 +276,7 @@ bool stripPositionalArgs(std::vector 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(Args.begin() + 1, End); -- cgit