diff options
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 5 | ||||
-rw-r--r-- | lib/MC/MCSymbol.cpp | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 2b254b9..2ee7dd4 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -131,10 +131,7 @@ namespace llvm { return Value; } - void setVariableValue(const MCExpr *Value) { - assert(Value && "Invalid variable value!"); - this->Value = Value; - } + void setVariableValue(const MCExpr *Value); /// @} diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 3fb1233..82d72a3 100644 --- a/lib/MC/MCSymbol.cpp +++ b/lib/MC/MCSymbol.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCSymbol.h" +#include "llvm/MC/MCExpr.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -38,6 +39,13 @@ static bool NameNeedsQuoting(StringRef Str) { return false; } +void MCSymbol::setVariableValue(const MCExpr *Value) { + assert(Value && "Invalid variable value!"); + assert((isUndefined() || (isAbsolute() && isa<MCConstantExpr>(Value))) && + "Invalid redefinition!"); + this->Value = Value; +} + void MCSymbol::print(raw_ostream &OS) const { // The name for this MCSymbol is required to be a valid target name. However, // some targets support quoting names with funny characters. If the name |