[GC][NFC] Simplify code now that we only have one safepoint kind
This is the NFC follow up to exploit the semantic simplification from r346701
llvm-svn: 346712
diff --git a/llvm/lib/CodeGen/BuiltinGCs.cpp b/llvm/lib/CodeGen/BuiltinGCs.cpp
index 5ee2055..93939e5 100644
--- a/llvm/lib/CodeGen/BuiltinGCs.cpp
+++ b/llvm/lib/CodeGen/BuiltinGCs.cpp
@@ -28,7 +28,7 @@
class ErlangGC : public GCStrategy {
public:
ErlangGC() {
- NeededSafePoints = 1 << GC::PostCall;
+ NeededSafePoints = true;
UsesMetadata = true;
}
};
@@ -39,7 +39,7 @@
class OcamlGC : public GCStrategy {
public:
OcamlGC() {
- NeededSafePoints = 1 << GC::PostCall;
+ NeededSafePoints = true;
UsesMetadata = true;
}
};
@@ -69,7 +69,7 @@
UseStatepoints = true;
// These options are all gc.root specific, we specify them so that the
// gc.root lowering code doesn't run.
- NeededSafePoints = 0;
+ NeededSafePoints = false;
UsesMetadata = false;
}
@@ -101,7 +101,7 @@
UseStatepoints = true;
// These options are all gc.root specific, we specify them so that the
// gc.root lowering code doesn't run.
- NeededSafePoints = 0;
+ NeededSafePoints = false;
UsesMetadata = false;
}
diff --git a/llvm/lib/CodeGen/GCMetadata.cpp b/llvm/lib/CodeGen/GCMetadata.cpp
index 4bf5335..1c80556 100644
--- a/llvm/lib/CodeGen/GCMetadata.cpp
+++ b/llvm/lib/CodeGen/GCMetadata.cpp
@@ -103,14 +103,6 @@
AU.addRequired<GCModuleInfo>();
}
-static const char *DescKind(GC::PointKind Kind) {
- switch (Kind) {
- case GC::PostCall:
- return "post-call";
- }
- llvm_unreachable("Invalid point kind");
-}
-
bool Printer::runOnFunction(Function &F) {
if (F.hasGC())
return false;
@@ -127,7 +119,7 @@
for (GCFunctionInfo::iterator PI = FD->begin(), PE = FD->end(); PI != PE;
++PI) {
- OS << "\t" << PI->Label->getName() << ": " << DescKind(PI->Kind)
+ OS << "\t" << PI->Label->getName() << ": " << "post-call"
<< ", live = {";
for (GCFunctionInfo::live_iterator RI = FD->live_begin(PI),
diff --git a/llvm/lib/CodeGen/GCRootLowering.cpp b/llvm/lib/CodeGen/GCRootLowering.cpp
index fff76f5..e8ccd84 100644
--- a/llvm/lib/CodeGen/GCRootLowering.cpp
+++ b/llvm/lib/CodeGen/GCRootLowering.cpp
@@ -268,10 +268,8 @@
MachineBasicBlock::iterator RAI = CI;
++RAI;
- if (FI->getStrategy().needsSafePoint(GC::PostCall)) {
- MCSymbol *Label = InsertLabel(*CI->getParent(), RAI, CI->getDebugLoc());
- FI->addSafePoint(GC::PostCall, Label, CI->getDebugLoc());
- }
+ MCSymbol *Label = InsertLabel(*CI->getParent(), RAI, CI->getDebugLoc());
+ FI->addSafePoint(Label, CI->getDebugLoc());
}
void GCMachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {