summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-11-19 10:43:44 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-11-19 10:43:44 +0000
commitb13e63ce08b2de1772cdaa9366c91a9020954f1d (patch)
treee20ca28ff734289367a315bb424e4e871a43be2a
parentefd92b3d16589f65bd762279697ab2add95ebd91 (diff)
downloadbcm5719-llvm-b13e63ce08b2de1772cdaa9366c91a9020954f1d.tar.gz
bcm5719-llvm-b13e63ce08b2de1772cdaa9366c91a9020954f1d.zip
gold-plugin.cpp: Fix diagnosticHandler corresponding to r253540.
llvm-svn: 253553
-rw-r--r--llvm/tools/gold/gold-plugin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index ecf12f8b08f..116df7903ee 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -297,7 +297,7 @@ static bool shouldSkip(uint32_t Symflags) {
return false;
}
-static void diagnosticHandler(const DiagnosticInfo &DI, void *Context) {
+static void diagnosticHandler(const DiagnosticInfo &DI) {
if (const auto *BDI = dyn_cast<BitcodeDiagnosticInfo>(&DI)) {
std::error_code EC = BDI->getError();
if (EC == BitcodeError::InvalidBitcodeSignature)
@@ -327,6 +327,11 @@ static void diagnosticHandler(const DiagnosticInfo &DI, void *Context) {
message(Level, "LLVM gold plugin: %s", ErrStorage.c_str());
}
+static void diagnosticHandlerForContext(const DiagnosticInfo &DI,
+ void *Context) {
+ diagnosticHandler(DI);
+}
+
/// Called by gold to see whether this file is one that our plugin can handle.
/// We'll try to open it and register all the symbols with add_symbol if
/// possible.
@@ -361,7 +366,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
BufferRef = Buffer->getMemBufferRef();
}
- Context.setDiagnosticHandler(diagnosticHandler);
+ Context.setDiagnosticHandler(diagnosticHandlerForContext);
ErrorOr<std::unique_ptr<object::IRObjectFile>> ObjOrErr =
object::IRObjectFile::create(BufferRef, Context);
std::error_code EC = ObjOrErr.getError();
@@ -617,7 +622,7 @@ getFunctionIndexForFile(LLVMContext &Context, claimed_file &F,
MemoryBufferRef BufferRef(StringRef((const char *)View, Info.filesize),
Info.name);
ErrorOr<std::unique_ptr<object::FunctionIndexObjectFile>> ObjOrErr =
- object::FunctionIndexObjectFile::create(BufferRef, Context);
+ object::FunctionIndexObjectFile::create(BufferRef, diagnosticHandler);
if (std::error_code EC = ObjOrErr.getError())
message(LDPL_FATAL, "Could not read function index bitcode from file : %s",
@@ -892,7 +897,7 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
return LDPS_OK;
LLVMContext Context;
- Context.setDiagnosticHandler(diagnosticHandler, nullptr, true);
+ Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
// If we are doing ThinLTO compilation, simply build the combined
// function index/summary and emit it. We don't need to parse the modules
OpenPOWER on IntegriCloud