[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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user