Index: src/IceTargetLowering.cpp |
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp |
index 4902a3d64a8637a75decad7d1012ee626cd608a9..0ee0afa2301929fa5e2596a709f0db2bd03e3886 100644 |
--- a/src/IceTargetLowering.cpp |
+++ b/src/IceTargetLowering.cpp |
@@ -105,6 +105,24 @@ TargetLowering *TargetLowering::createLowering(TargetArch Target, Cfg *Func) { |
return nullptr; |
} |
+void TargetLowering::staticInit(TargetArch Target) { |
+ // Call the specified target's static initializer. |
+ switch (Target) { |
+ default: |
+ llvm::report_fatal_error("Unsupported target"); |
+ break; |
+#define SUBZERO_TARGET(X) \ |
+ case Target_##X: { \ |
+ static bool InitGuard##X = false; \ |
+ if (InitGuard##X) \ |
+ return; \ |
+ InitGuard##X = true; \ |
+ Target##X::staticInit(); \ |
+ } break; |
+#include "llvm/Config/SZTargets.def" |
+ } |
+} |
+ |
TargetLowering::TargetLowering(Cfg *Func) |
: Func(Func), Ctx(Func->getContext()), Context() {} |