aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorShubham Sandeep Rastogi <srastogi22@apple.com>2023-11-30 09:53:15 -0800
committerGitHub <noreply@github.com>2023-11-30 09:53:15 -0800
commit2eff36b7d33fb9ea5c15ea8561fe6b30105d48f5 (patch)
tree47ffcf8a5d28b419490b841e09f603600cef59be /llvm/lib/CodeGen/SafeStack.cpp
parentd1bf1947e4e4f3ef75f2ba3ac9aa77dc38214de1 (diff)
downloadllvm-2eff36b7d33fb9ea5c15ea8561fe6b30105d48f5.zip
llvm-2eff36b7d33fb9ea5c15ea8561fe6b30105d48f5.tar.gz
llvm-2eff36b7d33fb9ea5c15ea8561fe6b30105d48f5.tar.bz2
Revert "[CodeGen] Port SafeStack to new pass manager (#73747)" (#73965)
This reverts commit a4d5fd4d2ee9470e55345a9540f6b6fb6faf66e1. The above commit breaks greendragon lldb bots: Link to failing builds: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/63300/ https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/10345/ I found this PR to be the offending one after using git bisect with the cmake invocation: cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64' -DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE -DLLVM_ENABLE_MODULES=On -DLLVM_ENABLE_PROJECTS='clang;lld;lldb;cross-project-tests' -DLLVM_VERSION_PATCH=99 '-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;compiler-rt' and running ninja lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPassBuilder.cpp.o
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,