diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp b/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp index 5b2fe19837e..a637dd11f81 100644 --- a/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp +++ b/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp @@ -12,15 +12,26 @@ #include "llvm/Support/TargetRegistry.h" using namespace llvm; -Target llvm::ThePPC32Target, llvm::ThePPC64Target, llvm::ThePPC64LETarget; +Target &llvm::getThePPC32Target() { + static Target ThePPC32Target; + return ThePPC32Target; +} +Target &llvm::getThePPC64Target() { + static Target ThePPC64Target; + return ThePPC64Target; +} +Target &llvm::getThePPC64LETarget() { + static Target ThePPC64LETarget; + return ThePPC64LETarget; +} extern "C" void LLVMInitializePowerPCTargetInfo() { - RegisterTarget<Triple::ppc, /*HasJIT=*/true> - X(ThePPC32Target, "ppc32", "PowerPC 32"); + RegisterTarget<Triple::ppc, /*HasJIT=*/true> X(getThePPC32Target(), "ppc32", + "PowerPC 32"); - RegisterTarget<Triple::ppc64, /*HasJIT=*/true> - Y(ThePPC64Target, "ppc64", "PowerPC 64"); + RegisterTarget<Triple::ppc64, /*HasJIT=*/true> Y(getThePPC64Target(), "ppc64", + "PowerPC 64"); - RegisterTarget<Triple::ppc64le, /*HasJIT=*/true> - Z(ThePPC64LETarget, "ppc64le", "PowerPC 64 LE"); + RegisterTarget<Triple::ppc64le, /*HasJIT=*/true> Z( + getThePPC64LETarget(), "ppc64le", "PowerPC 64 LE"); } |