Files
revng-revng/include/revng/LocalVariables/LocalVariableHelpers.h
Pietro Fezzardi da3ee051b9 Turn revng.stack_type into revng.stack_frame
The new named metadata doesn't embed the type of the stack anymore.
It's just a marker of the alloca that represents the stack frame.
2026-05-08 17:30:04 +02:00

25 lines
593 B
C

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
/// \name Functions for manipulating stack model type metadata
///
///@{
inline constexpr const char *StackFrameMDName = "revng.stack_frame";
inline bool hasStackFrameMetadata(const llvm::AllocaInst *I) {
return I->hasMetadata(I->getContext().getMDKindID(StackFrameMDName));
};
inline void setStackFrameMetadata(llvm::AllocaInst *A) {
A->setMetadata(StackFrameMDName, llvm::MDNode::get(A->getContext(), {}));
}
///@}