summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/TargetInfo
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-11 18:22:41 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-11 18:22:41 +0000
commitcaec5559cb55b3aeda764b3ca3c888ee639b5325 (patch)
tree743f5ac6a772822c0e5f3dc767af8645215458d7 /llvm/lib/Target/XCore/TargetInfo
parent76952a76e5ff7958f6108b8d2c5d1a78c3169180 (diff)
downloadbcm5719-llvm-caec5559cb55b3aeda764b3ca3c888ee639b5325.tar.gz
bcm5719-llvm-caec5559cb55b3aeda764b3ca3c888ee639b5325.zip
Fix "static initialization order fiasco" for the XCore Target.
I fixed all the other Targets in r283702, and interestingly the sanitizers are only now "sometimes" catching this bug on the only one I missed. llvm-svn: 283914
Diffstat (limited to 'llvm/lib/Target/XCore/TargetInfo')
-rw-r--r--llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp b/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp
index c78cde9ac8a..df5774c7e8e 100644
--- a/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp
+++ b/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp
@@ -12,8 +12,11 @@
#include "llvm/Support/TargetRegistry.h"
using namespace llvm;
-Target llvm::TheXCoreTarget;
+Target &llvm::getTheXCoreTarget() {
+ static Target TheXCoreTarget;
+ return TheXCoreTarget;
+}
extern "C" void LLVMInitializeXCoreTargetInfo() {
- RegisterTarget<Triple::xcore> X(TheXCoreTarget, "xcore", "XCore");
+ RegisterTarget<Triple::xcore> X(getTheXCoreTarget(), "xcore", "XCore");
}
OpenPOWER on IntegriCloud