[llvm] r207266 - MCAssembler: Simplify implementation of const	variants of	getSymbolData by calling one implementation from the other.
    David Blaikie 
    dblaikie at gmail.com
       
    Fri Apr 25 13:19:11 PDT 2014
    
    
  
Author: dblaikie
Date: Fri Apr 25 15:19:11 2014
New Revision: 207266
URL: http://llvm.org/viewvc/llvm-project?rev=207266&view=rev
Log:
MCAssembler: Simplify implementation of const variants of getSymbolData by calling one implementation from the other.
Code review feedback by Rafael Espindola on r207124.
Modified:
    llvm/trunk/include/llvm/MC/MCAssembler.h
Modified: llvm/trunk/include/llvm/MC/MCAssembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=207266&r1=207265&r2=207266&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAssembler.h (original)
+++ llvm/trunk/include/llvm/MC/MCAssembler.h Fri Apr 25 15:19:11 2014
@@ -1208,9 +1208,8 @@ public:
   }
 
   MCSymbolData &getSymbolData(const MCSymbol &Symbol) {
-    MCSymbolData *Entry = SymbolMap.lookup(&Symbol);
-    assert(Entry && "Missing symbol data!");
-    return *Entry;
+    return const_cast<MCSymbolData &>(
+        static_cast<const MCAssembler &>(*this).getSymbolData(Symbol));
   }
 
   const MCSymbolData &getSymbolData(const MCSymbol &Symbol) const {
    
    
More information about the llvm-commits
mailing list