1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

MC: Make setVariableValue check the redefinition condition a bit more strongly.

llvm-svn: 103110
This commit is contained in:
Daniel Dunbar 2010-05-05 19:00:56 +00:00
parent d7bc27a079
commit 258ede3795
2 changed files with 9 additions and 4 deletions

View File

@ -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);
/// @}

View File

@ -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