summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorVivek Pandya <vivekvpandya@gmail.com>2017-09-15 19:53:54 +0000
committerVivek Pandya <vivekvpandya@gmail.com>2017-09-15 19:53:54 +0000
commitdf8598dcc46bde61fd70e2a39b6b8a067cc8be4a (patch)
tree2e1611061b39e36c315db9964457895cf2770aaa /llvm/lib/IR/LLVMContext.cpp
parent8b0bbc6fe03b50a87312902ed9ae2a09c5735889 (diff)
downloadbcm5719-llvm-df8598dcc46bde61fd70e2a39b6b8a067cc8be4a.tar.gz
bcm5719-llvm-df8598dcc46bde61fd70e2a39b6b8a067cc8be4a.zip
This reverts r313381
llvm-svn: 313387
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp38
1 files changed, 12 insertions, 26 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 6569695c996..c58459d6d5f 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -129,17 +129,11 @@ void *LLVMContext::getInlineAsmDiagnosticContext() const {
return pImpl->InlineAsmDiagContext;
}
-void LLVMContext::setDiagnosticHandlerCallBack(
- DiagnosticHandler::DiagnosticHandlerTy DiagnosticHandler,
- void *DiagnosticContext, bool RespectFilters) {
- pImpl->DiagHandler->DiagHandlerCallback = DiagnosticHandler;
- pImpl->DiagHandler->DiagnosticContext = DiagnosticContext;
- pImpl->RespectDiagnosticFilters = RespectFilters;
-}
-
-void LLVMContext::setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
- bool RespectFilters) {
- pImpl->DiagHandler = std::move(DH);
+void LLVMContext::setDiagnosticHandler(DiagnosticHandlerTy DiagnosticHandler,
+ void *DiagnosticContext,
+ bool RespectFilters) {
+ pImpl->DiagnosticHandler = DiagnosticHandler;
+ pImpl->DiagnosticContext = DiagnosticContext;
pImpl->RespectDiagnosticFilters = RespectFilters;
}
@@ -165,13 +159,12 @@ void LLVMContext::setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F) {
pImpl->DiagnosticsOutputFile = std::move(F);
}
-DiagnosticHandler::DiagnosticHandlerTy
-LLVMContext::getDiagnosticHandlerCallBack() const {
- return pImpl->DiagHandler->DiagHandlerCallback;
+LLVMContext::DiagnosticHandlerTy LLVMContext::getDiagnosticHandler() const {
+ return pImpl->DiagnosticHandler;
}
void *LLVMContext::getDiagnosticContext() const {
- return pImpl->DiagHandler->DiagnosticContext;
+ return pImpl->DiagnosticContext;
}
void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
@@ -222,10 +215,11 @@ LLVMContext::getDiagnosticMessagePrefix(DiagnosticSeverity Severity) {
void LLVMContext::diagnose(const DiagnosticInfo &DI) {
// If there is a report handler, use it.
- if (pImpl->DiagHandler &&
- (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) &&
- pImpl->DiagHandler->handleDiagnostics(DI))
+ if (pImpl->DiagnosticHandler) {
+ if (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI))
+ pImpl->DiagnosticHandler(DI, pImpl->DiagnosticContext);
return;
+ }
if (!isDiagnosticEnabled(DI))
return;
@@ -321,11 +315,3 @@ void LLVMContext::setDiscardValueNames(bool Discard) {
OptBisect &LLVMContext::getOptBisect() {
return pImpl->getOptBisect();
}
-
-const DiagnosticHandler *LLVMContext::getDiagHandlerPtr() const {
- return pImpl->DiagHandler.get();
-}
-
-std::unique_ptr<DiagnosticHandler> LLVMContext::getDiagnosticHandler() {
- return std::move(pImpl->DiagHandler);
-}
OpenPOWER on IntegriCloud