aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index 88db57a..ef293fa 100644
--- a/llvm/lib/CodeGen/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -14,7 +14,6 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/CodeGen/SafeStack.h"
#include "SafeStackLayout.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
@@ -928,42 +927,6 @@ public:
} // end anonymous namespace
-PreservedAnalyses SafeStackPass::run(Function &F,
- FunctionAnalysisManager &FAM) {
- LLVM_DEBUG(dbgs() << "[SafeStack] Function: " << F.getName() << "\n");
-
- if (!F.hasFnAttribute(Attribute::SafeStack)) {
- LLVM_DEBUG(dbgs() << "[SafeStack] safestack is not requested"
- " for this function\n");
- return PreservedAnalyses::all();
- }
-
- if (F.isDeclaration()) {
- LLVM_DEBUG(dbgs() << "[SafeStack] function definition"
- " is not available\n");
- return PreservedAnalyses::all();
- }
-
- auto *TL = TM->getSubtargetImpl(F)->getTargetLowering();
- if (!TL)
- report_fatal_error("TargetLowering instance is required");
-
- auto &DL = F.getParent()->getDataLayout();
-
- // preserve DominatorTree
- auto &DT = FAM.getResult<DominatorTreeAnalysis>(F);
- auto &SE = FAM.getResult<ScalarEvolutionAnalysis>(F);
- DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
-
- bool Changed = SafeStack(F, *TL, DL, &DTU, SE).run();
-
- if (!Changed)
- return PreservedAnalyses::all();
- PreservedAnalyses PA;
- PA.preserve<DominatorTreeAnalysis>();
- return PA;
-}
-
char SafeStackLegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(SafeStackLegacyPass, DEBUG_TYPE,