diff options
author | Jonas Hahnfeld <jonas.hahnfeld@cern.ch> | 2022-12-01 14:14:43 +0100 |
---|---|---|
committer | Jonas Hahnfeld <jonas.hahnfeld@cern.ch> | 2022-12-08 09:58:33 +0100 |
commit | c9cb4fc761cd78d3a04feb211d363e91933a8e08 (patch) | |
tree | b4b8eb077835ed56b452928875d5713281cc34c9 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 61318fa5c764d6af60baeb1c00d793f1bd95f5ea (diff) | |
download | llvm-c9cb4fc761cd78d3a04feb211d363e91933a8e08.zip llvm-c9cb4fc761cd78d3a04feb211d363e91933a8e08.tar.gz llvm-c9cb4fc761cd78d3a04feb211d363e91933a8e08.tar.bz2 |
[DebugInfo] Store optional DIFile::Source as pointer
getCanonicalMDString() also returns a nullptr for empty strings, which
tripped over the getSource() method. Solve the ambiguity of no source
versus an optional containing a nullptr by simply storing a pointer.
Differential Revision: https://reviews.llvm.org/D138658
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 9c45ea0..28b1bac 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1808,7 +1808,7 @@ void ModuleBitcodeWriter::writeDIFile(const DIFile *N, } auto Source = N->getRawSource(); if (Source) - Record.push_back(VE.getMetadataOrNullID(*Source)); + Record.push_back(VE.getMetadataOrNullID(Source)); Stream.EmitRecord(bitc::METADATA_FILE, Record, Abbrev); Record.clear(); |