about summary refs log tree commit diff
path: root/src/rustllvm/RustGCStrategy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rustllvm/RustGCStrategy.cpp')
-rw-r--r--src/rustllvm/RustGCStrategy.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/rustllvm/RustGCStrategy.cpp b/src/rustllvm/RustGCStrategy.cpp
index 0c86856939c..49497600725 100644
--- a/src/rustllvm/RustGCStrategy.cpp
+++ b/src/rustllvm/RustGCStrategy.cpp
@@ -16,19 +16,16 @@
 
 using namespace llvm;
 
-namespace {
-  class RustGCStrategy : public GCStrategy {
-  public:
-    RustGCStrategy();
-  };
-}
+class RustGCStrategy : public GCStrategy {
+public:
+  RustGCStrategy() {
+    NeededSafePoints = 1 << GC::PostCall;
+    UsesMetadata = true;
+    InitRoots = false;  // LLVM crashes with this on due to bitcasts.
+  }
+};
 
 static GCRegistry::Add<RustGCStrategy>
-X("rust", "Rust GC");
-
-RustGCStrategy::RustGCStrategy() {
-  NeededSafePoints = 1 << GC::PostCall;
-  UsesMetadata = true;
-}
+RustGCStrategyRegistration("rust", "Rust GC");