Simplify AddValueSymbols. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-06-25 14:42:14 +00:00
parent 6ce4a9f175
commit b209f33bc7
2 changed files with 4 additions and 5 deletions

View File

@ -78,7 +78,7 @@ protected:
/// fragment is not a data fragment. /// fragment is not a data fragment.
MCDataFragment *getOrCreateDataFragment() const; MCDataFragment *getOrCreateDataFragment() const;
const MCExpr *AddValueSymbols(const MCExpr *Value); void AddValueSymbols(const MCExpr *Value);
public: public:
MCAssembler &getAssembler() { return *Assembler; } MCAssembler &getAssembler() { return *Assembler; }

View File

@ -83,7 +83,7 @@ MCDataFragment *MCObjectStreamer::getOrCreateDataFragment() const {
return F; return F;
} }
const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) { void MCObjectStreamer::AddValueSymbols(const MCExpr *Value) {
switch (Value->getKind()) { switch (Value->getKind()) {
case MCExpr::Target: case MCExpr::Target:
cast<MCTargetExpr>(Value)->AddValueSymbols(Assembler); cast<MCTargetExpr>(Value)->AddValueSymbols(Assembler);
@ -107,8 +107,6 @@ const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) {
AddValueSymbols(cast<MCUnaryExpr>(Value)->getSubExpr()); AddValueSymbols(cast<MCUnaryExpr>(Value)->getSubExpr());
break; break;
} }
return Value;
} }
void MCObjectStreamer::EmitCFISections(bool EH, bool Debug) { void MCObjectStreamer::EmitCFISections(bool EH, bool Debug) {
@ -125,7 +123,8 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
// Avoid fixups when possible. // Avoid fixups when possible.
int64_t AbsValue; int64_t AbsValue;
if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue, getAssembler())) { AddValueSymbols(Value);
if (Value->EvaluateAsAbsolute(AbsValue, getAssembler())) {
EmitIntValue(AbsValue, Size); EmitIntValue(AbsValue, Size);
return; return;
} }