aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-25 17:35:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-19 21:23:58 +0000
commita2055961001193c277cffdfffba259ca8fad3835 (patch)
treeaceda26284a7ba56ded691457493d4ef7364f4e8 /contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
parentb168c9a3e534d5d65fd7070687b85e27217e2bcd (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp b/contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
index 38f658084294..d4840d117110 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
@@ -115,7 +115,7 @@ Constant *ShadowStackGCLowering::GetFrameMap(Function &F) {
Constant *C = cast<Constant>(Roots[I].first->getArgOperand(1));
if (!C->isNullValue())
NumMeta = I + 1;
- Metadata.push_back(ConstantExpr::getBitCast(C, VoidPtr));
+ Metadata.push_back(C);
}
Metadata.resize(NumMeta);
@@ -173,7 +173,7 @@ Type *ShadowStackGCLowering::GetConcreteStackEntryType(Function &F) {
bool ShadowStackGCLowering::doInitialization(Module &M) {
bool Active = false;
for (Function &F : M) {
- if (F.hasGC() && F.getGC() == std::string("shadow-stack")) {
+ if (F.hasGC() && F.getGC() == "shadow-stack") {
Active = true;
break;
}
@@ -292,8 +292,7 @@ void ShadowStackGCLowering::getAnalysisUsage(AnalysisUsage &AU) const {
/// runOnFunction - Insert code to maintain the shadow stack.
bool ShadowStackGCLowering::runOnFunction(Function &F) {
// Quick exit for functions that do not use the shadow stack GC.
- if (!F.hasGC() ||
- F.getGC() != std::string("shadow-stack"))
+ if (!F.hasGC() || F.getGC() != "shadow-stack")
return false;
LLVMContext &Context = F.getContext();