[PATCH] D146298: [NFC] Add DebugVariableAggregate class
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 07:19:42 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa17b71d17f85: [NFC] Add DebugVariableAggregate class (authored by Orlando).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146298/new/
https://reviews.llvm.org/D146298
Files:
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/IR/DebugInfoMetadata.cpp
Index: llvm/lib/IR/DebugInfoMetadata.cpp
===================================================================
--- llvm/lib/IR/DebugInfoMetadata.cpp
+++ llvm/lib/IR/DebugInfoMetadata.cpp
@@ -42,6 +42,10 @@
Fragment(DII->getExpression()->getFragmentInfo()),
InlinedAt(DII->getDebugLoc().getInlinedAt()) {}
+DebugVariableAggregate::DebugVariableAggregate(const DbgVariableIntrinsic *DVI)
+ : DebugVariable(DVI->getVariable(), std::nullopt,
+ DVI->getDebugLoc()->getInlinedAt()) {}
+
DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
unsigned Column, ArrayRef<Metadata *> MDs,
bool ImplicitCode)
Index: llvm/include/llvm/IR/DebugInfoMetadata.h
===================================================================
--- llvm/include/llvm/IR/DebugInfoMetadata.h
+++ llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -3817,6 +3817,18 @@
}
};
+/// Identifies a unique instance of a whole variable (discards/ignores fragment
+/// information).
+class DebugVariableAggregate : public DebugVariable {
+public:
+ DebugVariableAggregate(const DbgVariableIntrinsic *DVI);
+ DebugVariableAggregate(const DebugVariable &V)
+ : DebugVariable(V.getVariable(), std::nullopt, V.getInlinedAt()) {}
+};
+
+template <>
+struct DenseMapInfo<DebugVariableAggregate>
+ : public DenseMapInfo<DebugVariable> {};
} // end namespace llvm
#undef DEFINE_MDNODE_GET_UNPACK_IMPL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146298.507353.patch
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230322/79ecab7a/attachment-0001.bin>
More information about the llvm-commits
mailing list