From 798e83b5d6853f0c2f68bb4b0785f6a075867a13 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 4 Apr 2019 23:34:38 +0000 Subject: NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer. Differential Revision: https://reviews.llvm.org/D60290 llvm-svn: 357736 --- llvm/lib/MC/MCContext.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/MC/MCContext.cpp') 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 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 MCContext::getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, - MD5::MD5Result *Checksum, + Optional Checksum, Optional Source, unsigned CUID) { MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID]; -- cgit v1.2.3