diff options
author | OCHyams <orlando.hyams@sony.com> | 2022-11-03 09:50:31 +0000 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2022-11-07 09:05:56 +0000 |
commit | a2620e00ffa232a406de3a1d8634beeda86956fd (patch) | |
tree | 270f697e7e305ef4f9f2a4dd242a1861b962a25f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | d9176563dc223589da43cccd47fe2584590c4b3b (diff) | |
download | llvm-a2620e00ffa232a406de3a1d8634beeda86956fd.zip llvm-a2620e00ffa232a406de3a1d8634beeda86956fd.tar.gz llvm-a2620e00ffa232a406de3a1d8634beeda86956fd.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 85ada2c..4bf881a 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); @@ -1949,6 +1951,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) { |