aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
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
commitf58d7e8e4920c42ebb5583960ad6b79a22fd8769 (patch)
treed184ce54da093da005376dcb3a220509231b55df /lib/MC
parent7317f5c2b561c43fe805433835a6bda575cfed0f (diff)
downloadexternal_llvm-f58d7e8e4920c42ebb5583960ad6b79a22fd8769.zip
external_llvm-f58d7e8e4920c42ebb5583960ad6b79a22fd8769.tar.gz
external_llvm-f58d7e8e4920c42ebb5583960ad6b79a22fd8769.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')
-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