[llvm-commits] [llvm] r80079 - in /llvm/trunk: include/llvm/MC/MCContext.h lib/MC/MCContext.cpp
Daniel Dunbar
daniel at zuster.org
Wed Aug 26 02:16:57 PDT 2009
Author: ddunbar
Date: Wed Aug 26 04:16:57 2009
New Revision: 80079
URL: http://llvm.org/viewvc/llvm-project?rev=80079&view=rev
Log:
llvm-mc: Change MCContext value table to take const MCSymbol*s.
Modified:
llvm/trunk/include/llvm/MC/MCContext.h
llvm/trunk/lib/MC/MCContext.cpp
Modified: llvm/trunk/include/llvm/MC/MCContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=80079&r1=80078&r2=80079&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Wed Aug 26 04:16:57 2009
@@ -36,7 +36,7 @@
/// SymbolValues - Bindings of symbols to values.
//
// FIXME: Is there a good reason to not just put this in the MCSymbol?
- DenseMap<MCSymbol*, MCValue> SymbolValues;
+ DenseMap<const MCSymbol*, MCValue> SymbolValues;
/// Allocator - Allocator object used for creating machine code objects.
///
@@ -70,17 +70,15 @@
/// LookupSymbol - Get the symbol for @param Name, or null.
MCSymbol *LookupSymbol(const StringRef &Name) const;
- /// ClearSymbolValue - Erase a value binding for @param Symbol, if one
- /// exists.
- void ClearSymbolValue(MCSymbol *Symbol);
-
- /// SetSymbolValue - Set the value binding for @param Symbol to @param
- /// Value.
- void SetSymbolValue(MCSymbol *Symbol, const MCValue &Value);
+ /// ClearSymbolValue - Erase a value binding for @arg Symbol, if one exists.
+ void ClearSymbolValue(const MCSymbol *Symbol);
- /// GetSymbolValue - Return the current value for @param Symbol, or null if
+ /// SetSymbolValue - Set the value binding for @arg Symbol to @arg Value.
+ void SetSymbolValue(const MCSymbol *Symbol, const MCValue &Value);
+
+ /// GetSymbolValue - Return the current value for @arg Symbol, or null if
/// none exists.
- const MCValue *GetSymbolValue(MCSymbol *Symbol) const;
+ const MCValue *GetSymbolValue(const MCSymbol *Symbol) const;
void *Allocate(unsigned Size, unsigned Align = 8) {
return Allocator.Allocate(Size, Align);
Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=80079&r1=80078&r2=80079&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Wed Aug 26 04:16:57 2009
@@ -54,16 +54,16 @@
return Symbols.lookup(Name);
}
-void MCContext::ClearSymbolValue(MCSymbol *Sym) {
+void MCContext::ClearSymbolValue(const MCSymbol *Sym) {
SymbolValues.erase(Sym);
}
-void MCContext::SetSymbolValue(MCSymbol *Sym, const MCValue &Value) {
+void MCContext::SetSymbolValue(const MCSymbol *Sym, const MCValue &Value) {
SymbolValues[Sym] = Value;
}
-const MCValue *MCContext::GetSymbolValue(MCSymbol *Sym) const {
- DenseMap<MCSymbol*, MCValue>::iterator it = SymbolValues.find(Sym);
+const MCValue *MCContext::GetSymbolValue(const MCSymbol *Sym) const {
+ DenseMap<const MCSymbol*, MCValue>::iterator it = SymbolValues.find(Sym);
if (it == SymbolValues.end())
return 0;
More information about the llvm-commits
mailing list