summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2019-04-04 23:34:38 +0000
committerEric Christopher <echristo@gmail.com>2019-04-04 23:34:38 +0000
commit798e83b5d6853f0c2f68bb4b0785f6a075867a13 (patch)
tree0c99c3a0ed9d838eaea98716135299d9ac04ff7d /llvm/lib/MC/MCDwarf.cpp
parentf498bdcebfa439218e315be74a62ad52db3e2846 (diff)
downloadbcm5719-llvm-798e83b5d6853f0c2f68bb4b0785f6a075867a13.tar.gz
bcm5719-llvm-798e83b5d6853f0c2f68bb4b0785f6a075867a13.zip
NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.
Differential Revision: https://reviews.llvm.org/D60290 llvm-svn: 357736
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 83b6b4f1aa3..ea2cb577661 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -361,10 +361,10 @@ static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile,
}
MCOS->EmitULEB128IntValue(DwarfFile.DirIndex); // Directory number.
if (EmitMD5) {
- MD5::MD5Result *Cksum = DwarfFile.Checksum;
+ const MD5::MD5Result &Cksum = *DwarfFile.Checksum;
MCOS->EmitBinaryData(
- StringRef(reinterpret_cast<const char *>(Cksum->Bytes.data()),
- Cksum->Bytes.size()));
+ StringRef(reinterpret_cast<const char *>(Cksum.Bytes.data()),
+ Cksum.Bytes.size()));
}
if (HasSource) {
if (LineStr)
@@ -536,7 +536,7 @@ void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS,
Expected<unsigned> MCDwarfLineTable::tryGetFile(StringRef &Directory,
StringRef &FileName,
- MD5::MD5Result *Checksum,
+ Optional<MD5::MD5Result> Checksum,
Optional<StringRef> Source,
unsigned FileNumber) {
return Header.tryGetFile(Directory, FileName, Checksum, Source, FileNumber);
@@ -545,7 +545,7 @@ Expected<unsigned> MCDwarfLineTable::tryGetFile(StringRef &Directory,
Expected<unsigned>
MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
StringRef &FileName,
- MD5::MD5Result *Checksum,
+ Optional<MD5::MD5Result> Checksum,
Optional<StringRef> &Source,
unsigned FileNumber) {
if (Directory == CompilationDir)
@@ -558,7 +558,7 @@ MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
// Keep track of whether any or all files have an MD5 checksum.
// If any files have embedded source, they all must.
if (MCDwarfFiles.empty()) {
- trackMD5Usage(Checksum);
+ trackMD5Usage(Checksum.hasValue());
HasSource = (Source != None);
}
if (FileNumber == 0) {
@@ -623,7 +623,7 @@ MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
File.Name = FileName;
File.DirIndex = DirIndex;
File.Checksum = Checksum;
- trackMD5Usage(Checksum);
+ trackMD5Usage(Checksum.hasValue());
File.Source = Source;
if (Source)
HasSource = true;
OpenPOWER on IntegriCloud