diff options
author | Zain Jaffal <z_jaffal@apple.com> | 2023-05-09 17:15:13 +0300 |
---|---|---|
committer | Zain Jaffal <z_jaffal@apple.com> | 2023-05-09 17:51:28 +0300 |
commit | 5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8 (patch) | |
tree | 86a948aedc68a129bb28d9b3810689f47b7d37d9 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 0574a4be879e07b48ba9be8d63eebba49a04dfe8 (diff) | |
download | llvm-5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8.zip llvm-5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8.tar.gz llvm-5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<MDString>(N.get())->getString() == MetadataName) { + if (N.equalsStr(MetadataName)) { if (auto &Op = Existing->getOperand(1)) { auto Val = mdconst::extract<ConstantInt>(Op)->getZExtValue(); FrameInfo.setUnsafeStackSize(Val); |