[cfe-dev] [PATCH] Fix clang test failures on MIPS

Simon Atanasyan satanasyan at mips.com
Fri May 4 08:21:05 PDT 2012


On Fri, May 4, 2012 at 12:30 AM, Manuel Klimek <klimek at google.com> wrote:
> On Thu, May 3, 2012 at 10:16 PM, Chandler Carruth <chandlerc at google.com> wrote:
>>
>> My understanding is that the tooling library wishes to only run a single
>> compilation job, and is failing to properly set up the driver/invocation for
>> that, leaving the external assembler job also in the pipeline. I'm not of
>> the exact location of this code, but I think Manuel has seen related
>> problems recently anyways.
>
> Yep, we need to add a hook to adjust the compile command lines for
> running a single syntax only job.
> My idea was to add a hook that by default does that syntax only
> modification and allow users to specify different hooks in case they
> know what they're doing ...

Just want to be sure that I understand you properly before start
coding. Does the solution below conform your original idea?

1. Add virtual function processCommandLine(StringRef FilePath,
std::vector<std::string> &CommandLine) to the ClangTool class. This
function adds/removes/replaces command line arguments if necessary.
2. Call this function from ClangTool::run() method before
ToolInvocation instance creation to adjust command line.
3. Create class ClangSyntaxCheckTool. It inherits class ClangTool and
overrides processCommandLine() method. The new method adds
"-fsyntax-only" argument to the command line.
3. Use ClangSyntaxCheckTool instead of ClangTool in the clang-check.

--
Simon



More information about the cfe-dev mailing list