summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.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/MCContext.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/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp9
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];
OpenPOWER on IntegriCloud