summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-24 16:59:40 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-24 16:59:40 +0000
commit45966fa1f19390b5fe11a556cae7bbafa6ce77e6 (patch)
tree169278b052610225bd302614d1700d55bb8fc856 /include
parent25fb0476094ad3d96fb4b0eaff3ed9a3182e3aed (diff)
downloadllvm-45966fa1f19390b5fe11a556cae7bbafa6ce77e6.tar.gz
llvm-45966fa1f19390b5fe11a556cae7bbafa6ce77e6.tar.bz2
llvm-45966fa1f19390b5fe11a556cae7bbafa6ce77e6.tar.xz
Spread some const around for non-mutating uses of MCSymbolData.
I discovered this const-hole while attempting to coalesnce the Symbol and SymbolMap data structures. There's some pending issues with that, but I figured this change was easy to flush early. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAssembler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 26c26c977d..9c7733c83b 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -1207,7 +1207,13 @@ public:
return SymbolMap.lookup(&Symbol) != nullptr;
}
- MCSymbolData &getSymbolData(const MCSymbol &Symbol) const {
+ MCSymbolData &getSymbolData(const MCSymbol &Symbol) {
+ MCSymbolData *Entry = SymbolMap.lookup(&Symbol);
+ assert(Entry && "Missing symbol data!");
+ return *Entry;
+ }
+
+ const MCSymbolData &getSymbolData(const MCSymbol &Symbol) const {
MCSymbolData *Entry = SymbolMap.lookup(&Symbol);
assert(Entry && "Missing symbol data!");
return *Entry;