Commit 3ff887b9 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

plugin: do not exit(0) if error occurred

parent 35978194
......@@ -51,7 +51,9 @@ public:
const std::string HashString = Visitor.getHash(&ProcessedBytes);
const bool StopCompiling =
StopIfSameHash && (HashString == PreviousHashString);
StopIfSameHash
&& (HashString == PreviousHashString)
&& (! Context.getSourceManager().getDiagnostics().hasErrorOccurred());
if (TopLevelHashStream) {
// if (!StopCompiling) //TODO: need to rewrite file everytime, gets cleared on open(): FIX THIS
......@@ -177,12 +179,14 @@ protected:
const std::string PreviousHashString = getHashFromFile(HashFile);
// Write hash database to .o.hash if the compiler produces a object file
if (CI.getFrontendOpts().ProgramAction != frontend::EmitObj
&& CI.getFrontendOpts().ProgramAction != frontend::EmitLLVM
&& CI.getFrontendOpts().ProgramAction != frontend::EmitBC
&& CI.getFrontendOpts().ProgramAction != frontend::ParseSyntaxOnly
) {
errs() << "No compile\n";
if ((CI.getFrontendOpts().ProgramAction == frontend::EmitObj
|| CI.getFrontendOpts().ProgramAction == frontend::EmitBC
|| CI.getFrontendOpts().ProgramAction == frontend::EmitLLVM)
&& OutputFile != "" && OutputFile != "/dev/null") {
/* OK.Let's run */
} else if (CI.getFrontendOpts().ProgramAction == frontend::ParseSyntaxOnly) {
/* OK Let's run */
} else {
return make_unique<ASTConsumer>();
}
......
#!/bin/sh
#!/bin/bash
exec ${CCACHE} ${LLVM_C_COMPILER} "$@" -Wno-extra-semi
#!/usr/bin/env bash
#!/bin/bash
# This wrapper script should be used, if you want to gather insight
# information about the hashing process. It calls the given clang
# compiler with our plugin and outputs the information on stderr.
printf -v ARGS "%q " "$@"
${LLVM_C_COMPILER} -fplugin=${PROJECT_BINARY_DIR}/src/libclang-hash.so \
exec ${LLVM_C_COMPILER} -fplugin=${PROJECT_BINARY_DIR}/src/libclang-hash.so \
-Xclang -plugin-arg-clang-hash -Xclang -hash-verbose \
$ARGS
"$@"
#!/bin/sh
#!/bin/bash
exec ${LLVM_C_COMPILER} "$@" -Wno-extra-semi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment