diff options
author | Eric Christopher <echristo@gmail.com> | 2019-04-04 23:34:38 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2019-04-04 23:34:38 +0000 |
commit | 798e83b5d6853f0c2f68bb4b0785f6a075867a13 (patch) | |
tree | 0c99c3a0ed9d838eaea98716135299d9ac04ff7d /llvm/lib/MC/MCContext.cpp | |
parent | f498bdcebfa439218e315be74a62ad52db3e2846 (diff) | |
download | bcm5719-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/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 49fad131a2c..4d16715c0ae 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -572,12 +572,13 @@ void MCContext::RemapDebugPaths() { void MCContext::setGenDwarfRootFile(StringRef InputFileName, StringRef Buffer) { // MCDwarf needs the root file as well as the compilation directory. // If we find a '.file 0' directive that will supersede these values. - MD5::MD5Result *Cksum = nullptr; + Optional<MD5::MD5Result> Cksum; if (getDwarfVersion() >= 5) { MD5 Hash; - Cksum = (MD5::MD5Result *)allocate(sizeof(MD5::MD5Result), 1); + MD5::MD5Result Sum; Hash.update(Buffer); - Hash.final(*Cksum); + Hash.final(Sum); + Cksum = Sum; } // Canonicalize the root filename. It cannot be empty, and should not // repeat the compilation dir. @@ -600,7 +601,7 @@ void MCContext::setGenDwarfRootFile(StringRef InputFileName, StringRef Buffer) { Expected<unsigned> MCContext::getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, - MD5::MD5Result *Checksum, + Optional<MD5::MD5Result> Checksum, Optional<StringRef> Source, unsigned CUID) { MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID]; |