OSDN Git Service

[GC] Remove unused configuration variable
authorPhilip Reames <listmail@philipreames.com>
Mon, 12 Nov 2018 02:34:54 +0000 (02:34 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 12 Nov 2018 02:34:54 +0000 (02:34 +0000)
The custom root mechanism didn't actually do anything.  ShadowStackGC, the only one which used it, just removed the gcroots before they reached the normal lowering in SelectionDAG.  As a result, the state flag had no value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346632 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/GCStrategy.h
lib/CodeGen/BuiltinGCs.cpp

index df44b52..b24a9ba 100644 (file)
@@ -89,7 +89,6 @@ protected:
                                /// anything but their default values.
 
   unsigned NeededSafePoints = 0;    ///< Bitmask of required safe points.
-  bool CustomRoots = false;      ///< Default is to pass through to backend.
   bool UsesMetadata = false;     ///< If set, backend must emit metadata tables.
 
 public:
@@ -132,11 +131,6 @@ public:
     return (NeededSafePoints & 1 << Kind) != 0;
   }
 
-  /// By default, roots are left for the code generator so it can generate a
-  /// stack map. If true, you must provide a custom pass to lower
-  /// calls to \@llvm.gcroot.
-  bool customRoots() const { return CustomRoots; }
-
   /// If set, appropriate metadata tables must be emitted by the back-end
   /// (assembler, JIT, or otherwise). For statepoint, this method is
   /// currently unsupported.  The stackmap information can be found in the
index 1b1b683..5ee2055 100644 (file)
@@ -30,7 +30,6 @@ public:
   ErlangGC() {
     NeededSafePoints = 1 << GC::PostCall;
     UsesMetadata = true;
-    CustomRoots = false;
   }
 };
 
@@ -55,9 +54,7 @@ public:
 /// while introducing only minor runtime overhead.
 class ShadowStackGC : public GCStrategy {
 public:
-  ShadowStackGC() {
-    CustomRoots = true;
-  }
+  ShadowStackGC() {}
 };
 
 /// A GCStrategy which serves as an example for the usage of a statepoint based
@@ -74,7 +71,6 @@ public:
     // gc.root lowering code doesn't run.
     NeededSafePoints = 0;
     UsesMetadata = false;
-    CustomRoots = false;
   }
 
   Optional<bool> isGCManagedPointer(const Type *Ty) const override {
@@ -107,7 +103,6 @@ public:
     // gc.root lowering code doesn't run.
     NeededSafePoints = 0;
     UsesMetadata = false;
-    CustomRoots = false;
   }
 
   Optional<bool> isGCManagedPointer(const Type *Ty) const override {