aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCSymbol.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-05 19:00:56 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-05 19:00:56 +0000
commit8d627d31531ad45fecca82d52cd34092c7c4cc1d (patch)
treed184ce54da093da005376dcb3a220509231b55df /lib/MC/MCSymbol.cpp
parent3d720fbc6ad40bc9287a420f824d244965d24631 (diff)
downloadexternal_llvm-8d627d31531ad45fecca82d52cd34092c7c4cc1d.zip
external_llvm-8d627d31531ad45fecca82d52cd34092c7c4cc1d.tar.gz
external_llvm-8d627d31531ad45fecca82d52cd34092c7c4cc1d.tar.bz2
MC: Make setVariableValue check the redefinition condition a bit more strongly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCSymbol.cpp')
-rw-r--r--lib/MC/MCSymbol.cpp8
1 files changed, 8 insertions, 0 deletions
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