From d1678240e5a59709de89d864e38b1abb68b6078d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 1 Jun 2015 01:39:15 +0000 Subject: [PATCH] Remove trivial forwarding function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238707 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCAssembler.h | 7 +++---- lib/MC/MCObjectStreamer.cpp | 2 +- lib/MC/WinCOFFObjectWriter.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 61d9c865e18..6b6e0dc19c9 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -910,12 +910,11 @@ public: return true; } - bool hasSymbolData(const MCSymbol &Symbol) const { return Symbol.hasData(); } - void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr) { + bool New = !Symbol.hasData(); if (Created) - *Created = !hasSymbolData(Symbol); - if (!hasSymbolData(Symbol)) { + *Created = New; + if (New) { Symbol.initializeData(); Symbols.push_back(&Symbol); } diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 00d613a6eb4..a17e9ea01d5 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -58,7 +58,7 @@ bool MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) { // Must have symbol data. - if (!Assembler->hasSymbolData(*Hi) || !Assembler->hasSymbolData(*Lo)) + if (!Hi->hasData() || !Lo->hasData()) return false; // Must both be assigned to the same (valid) fragment. diff --git a/lib/MC/WinCOFFObjectWriter.cpp b/lib/MC/WinCOFFObjectWriter.cpp index 0290880bde7..a202fcd0f48 100644 --- a/lib/MC/WinCOFFObjectWriter.cpp +++ b/lib/MC/WinCOFFObjectWriter.cpp @@ -706,7 +706,7 @@ void WinCOFFObjectWriter::RecordRelocation( const MCSymbol &Symbol = Target.getSymA()->getSymbol(); const MCSymbol &A = Symbol; - if (!Asm.hasSymbolData(A)) + if (!A.hasData()) Asm.getContext().reportFatalError(Fixup.getLoc(), Twine("symbol '") + A.getName() + "' can not be undefined"); -- 2.34.1