diff options
author | OCHyams <orlando.hyams@sony.com> | 2022-11-03 09:50:31 +0000 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2022-11-03 11:24:18 +0000 |
commit | e53c4c6d8617145c4dd8d428bf47544ba4110eb5 (patch) | |
tree | ed85013b0b05ed46d112b56c65807d3a5ec01d68 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 5144133f6fd50d6067c808b83af90437995e441d (diff) | |
download | llvm-e53c4c6d8617145c4dd8d428bf47544ba4110eb5.zip llvm-e53c4c6d8617145c4dd8d428bf47544ba4110eb5.tar.gz llvm-e53c4c6d8617145c4dd8d428bf47544ba4110eb5.tar.bz2 |
[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Add the DIAssignID metadata attachment boilerplate. Includes a textual-bitcode
roundtrip test and tests that the verifier and parser catch badly formed IR.
This piece of metadata links together stores (used as an attachment) and the
yet-to-be-added llvm.dbg.assign debug intrinsic (used as an operand).
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D132222
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 1ac4413..bed3eba 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -340,6 +340,8 @@ private: unsigned Abbrev); void writeDIModule(const DIModule *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev); + void writeDIAssignID(const DIAssignID *N, SmallVectorImpl<uint64_t> &Record, + unsigned Abbrev); void writeDITemplateTypeParameter(const DITemplateTypeParameter *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev); @@ -1955,6 +1957,15 @@ void ModuleBitcodeWriter::writeDIModule(const DIModule *N, Record.clear(); } +void ModuleBitcodeWriter::writeDIAssignID(const DIAssignID *N, + SmallVectorImpl<uint64_t> &Record, + unsigned Abbrev) { + // There are no arguments for this metadata type. + Record.push_back(N->isDistinct()); + Stream.EmitRecord(bitc::METADATA_ASSIGN_ID, Record, Abbrev); + Record.clear(); +} + void ModuleBitcodeWriter::writeDITemplateTypeParameter( const DITemplateTypeParameter *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) { |