mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
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
This commit is contained in:
@@ -131,10 +131,7 @@ namespace llvm {
|
|||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setVariableValue(const MCExpr *Value) {
|
void setVariableValue(const MCExpr *Value);
|
||||||
assert(Value && "Invalid variable value!");
|
|
||||||
this->Value = Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/MC/MCSymbol.h"
|
#include "llvm/MC/MCSymbol.h"
|
||||||
|
#include "llvm/MC/MCExpr.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@@ -38,6 +39,13 @@ static bool NameNeedsQuoting(StringRef Str) {
|
|||||||
return false;
|
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 {
|
void MCSymbol::print(raw_ostream &OS) const {
|
||||||
// The name for this MCSymbol is required to be a valid target name. However,
|
// 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
|
// some targets support quoting names with funny characters. If the name
|
||||||
|
Reference in New Issue
Block a user