[llvm] 791c78f - [NFC,StackSafety] Add test flag
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 15:38:23 PDT 2020
Author: Vitaly Buka
Date: 2020-05-28T15:38:12-07:00
New Revision: 791c78f5e0ce84bcd4cfcccbbbbcc1259f4d7e0c
URL: https://github.com/llvm/llvm-project/commit/791c78f5e0ce84bcd4cfcccbbbbcc1259f4d7e0c
DIFF: https://github.com/llvm/llvm-project/commit/791c78f5e0ce84bcd4cfcccbbbbcc1259f4d7e0c.diff
LOG: [NFC,StackSafety] Add test flag
Added:
Modified:
llvm/lib/Analysis/StackSafetyAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index 1c59d5f2af96..f415facfbff4 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -31,6 +31,9 @@ using namespace llvm;
static cl::opt<int> StackSafetyMaxIterations("stack-safety-max-iterations",
cl::init(20), cl::Hidden);
+static cl::opt<int> StackSafetyPrint("stack-safety-print", cl::init(0),
+ cl::Hidden);
+
namespace {
/// Rewrite an SCEV expression for a memory access address to an expression that
@@ -681,6 +684,8 @@ const StackSafetyGlobalInfo::InfoTy &StackSafetyGlobalInfo::getInfo() const {
}
}
Info.reset(new InfoTy{createGlobalStackSafetyInfo(std::move(Functions))});
+ if (StackSafetyPrint)
+ print(errs());
}
return *Info;
}
@@ -689,7 +694,10 @@ StackSafetyGlobalInfo::StackSafetyGlobalInfo() = default;
StackSafetyGlobalInfo::StackSafetyGlobalInfo(
Module *M, std::function<const StackSafetyInfo &(Function &F)> GetSSI)
- : M(M), GetSSI(GetSSI) {}
+ : M(M), GetSSI(GetSSI) {
+ if (StackSafetyPrint > 1)
+ getInfo();
+}
StackSafetyGlobalInfo::StackSafetyGlobalInfo(StackSafetyGlobalInfo &&) =
default;
More information about the llvm-commits
mailing list