From 5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8 Mon Sep 17 00:00:00 2001 From: Zain Jaffal Date: Tue, 9 May 2023 17:15:13 +0300 Subject: [IRGen] Change annotation metadata to support inserting tuple of strings into annotation metadata array. Annotation metadata supports adding singular annotation strings to annotation block. This patch adds the ability to insert a tuple of strings into the metadata array. The idea here is that each tuple of strings represents a piece of information that can be all related. It makes it easier to parse through related metadata information given it will be contained in one tuple. For example in remarks any pass that implements annotation remarks can have different type of remarks and pass additional information for each. The original behaviour of annotation remarks is preserved here and we can mix tuple annotations and single annotations for the same instruction. Reviewed By: paquette Differential Revision: https://reviews.llvm.org/D148328 --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 4a90849..b33bb45 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -119,7 +119,7 @@ void setUnsafeStackSize(const Function &F, MachineFrameInfo &FrameInfo) { auto *MetadataName = "unsafe-stack-size"; if (auto &N = Existing->getOperand(0)) { - if (cast(N.get())->getString() == MetadataName) { + if (N.equalsStr(MetadataName)) { if (auto &Op = Existing->getOperand(1)) { auto Val = mdconst::extract(Op)->getZExtValue(); FrameInfo.setUnsafeStackSize(Val); -- cgit v1.1