aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorChih-Ping Chen <chih-ping.chen@intel.com>2022-04-06 08:22:49 -0400
committerChih-Ping Chen <chih-ping.chen@intel.com>2022-04-15 16:38:23 -0400
commiteab6e94f912d014e6f19e1737ef81e36e4601faf (patch)
treeac3aaa61d4613284e68fb869e3bc07e3f92a117b /llvm/lib/Bitcode
parent39a68cc016ec3ef51091c1469b80c6733a9b7c5f (diff)
downloadllvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.zip
llvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.tar.gz
llvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.tar.bz2
[DebugInfo] Add a TargetFuncName field in DISubprogram for
specifying DW_AT_trampoline as a string. Also update the signature of DIBuilder::createFunction to reflect this addition. Differential Revision: https://reviews.llvm.org/D123697
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp6
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 420df9b..f5166a7 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1698,6 +1698,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
bool HasThisAdj = true;
bool HasThrownTypes = true;
bool HasAnnotations = false;
+ bool HasTargetFuncName = false;
unsigned OffsetA = 0;
unsigned OffsetB = 0;
if (!HasSPFlags) {
@@ -1711,6 +1712,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
HasThrownTypes = Record.size() >= 21;
} else {
HasAnnotations = Record.size() >= 19;
+ HasTargetFuncName = Record.size() >= 20;
}
Metadata *CUorFn = getMDOrNull(Record[12 + OffsetB]);
DISubprogram *SP = GET_OR_DISTINCT(
@@ -1735,7 +1737,9 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
HasThrownTypes ? getMDOrNull(Record[17 + OffsetB])
: nullptr, // thrownTypes
HasAnnotations ? getMDOrNull(Record[18 + OffsetB])
- : nullptr // annotations
+ : nullptr, // annotations
+ HasTargetFuncName ? getMDString(Record[19 + OffsetB])
+ : nullptr // targetFuncName
));
MetadataList.assignValue(SP, NextMetadataNo);
NextMetadataNo++;
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 79c7685..84f60f4 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1822,6 +1822,7 @@ void ModuleBitcodeWriter::writeDISubprogram(const DISubprogram *N,
Record.push_back(N->getThisAdjustment());
Record.push_back(VE.getMetadataOrNullID(N->getThrownTypes().get()));
Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get()));
+ Record.push_back(VE.getMetadataOrNullID(N->getRawTargetFuncName()));
Stream.EmitRecord(bitc::METADATA_SUBPROGRAM, Record, Abbrev);
Record.clear();