summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-01-15 00:23:34 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-01-15 00:23:34 +0000
commit74f4ce6193d2e04bb4ee8ffb5d976e718a486801 (patch)
treea771d2bf19e4b8de889dbc252f3be4f490e87e96 /llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
parent4282d30516cd836ac72e053cff7555d0595f5ece (diff)
downloadbcm5719-llvm-74f4ce6193d2e04bb4ee8ffb5d976e718a486801.tar.gz
bcm5719-llvm-74f4ce6193d2e04bb4ee8ffb5d976e718a486801.zip
LLVMRunStaticConstructors can be called before object is finalized, #24028
Summary: Since you cannot call finalizeObject manually through the C-API and other functions from the C-API automatically call it, LLVMRunStaticConstructors should also call it or otherwise you cannot call it without first calling a workaround function (or call any other function from the C-API which implicitly finalizes the object). Reviewers: dnovillo, spatel, bkramer, deadalnix, joker.eph, echristo, lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16188 llvm-svn: 257849
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
index ff7c4dce0d5..3b2eb16c024 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -215,10 +215,12 @@ void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE) {
}
void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(false);
}
void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(true);
}
OpenPOWER on IntegriCloud