summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit8557426958e01bf2c808fde5703c1e9a0ceef2df (patch)
treeba97f71384e3e15913a7e54187477ba27783d1b6 /llvm/lib/MC/MCSymbol.cpp
parent4b6abd8c2b5a29d09f7ee1c43caff23aa8e9e2ff (diff)
downloadbcm5719-llvm-8557426958e01bf2c808fde5703c1e9a0ceef2df.tar.gz
bcm5719-llvm-8557426958e01bf2c808fde5703c1e9a0ceef2df.zip
MC: Make setVariableValue check the redefinition condition a bit more strongly.
llvm-svn: 103110
Diffstat (limited to 'llvm/lib/MC/MCSymbol.cpp')
-rw-r--r--llvm/lib/MC/MCSymbol.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp
index 3fb12336c4f..82d72a3e95b 100644
--- a/llvm/lib/MC/MCSymbol.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud