[llvm-commits] [llvm] r122013 - in /llvm/trunk: include/llvm/MC/MCExpr.h lib/MC/MCExpr.cpp lib/MC/MCObjectStreamer.cpp
Daniel Dunbar
daniel at zuster.org
Thu Dec 16 17:07:35 PST 2010
Author: ddunbar
Date: Thu Dec 16 19:07:35 2010
New Revision: 122013
URL: http://llvm.org/viewvc/llvm-project?rev=122013&view=rev
Log:
MC: Remove another dead MCAssembler argument, and update clients.
Modified:
llvm/trunk/include/llvm/MC/MCExpr.h
llvm/trunk/lib/MC/MCExpr.cpp
llvm/trunk/lib/MC/MCObjectStreamer.cpp
Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=122013&r1=122012&r2=122013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Thu Dec 16 19:07:35 2010
@@ -44,8 +44,7 @@
MCExpr(const MCExpr&); // DO NOT IMPLEMENT
void operator=(const MCExpr&); // DO NOT IMPLEMENT
- bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
- const MCAsmLayout *Layout,
+ bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout *Layout,
const SectionAddrMap *Addrs) const;
protected:
explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {}
@@ -77,11 +76,16 @@
/// values. If not given, then only non-symbolic expressions will be
/// evaluated.
/// @result - True on success.
- bool EvaluateAsAbsolute(int64_t &Res) const;
- bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
- bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
+ bool EvaluateAsAbsolute(int64_t &Res) const {
+ return EvaluateAsAbsolute(Res, 0, 0);
+ }
+ bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const{
+ return EvaluateAsAbsolute(Res, &Layout, 0);
+ }
bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
- const SectionAddrMap &Addrs) const;
+ const SectionAddrMap &Addrs) const {
+ return EvaluateAsAbsolute(Res, &Layout, &Addrs);
+ }
/// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable
/// value, i.e. an expression of the fixed form (a - b + constant).
Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=122013&r1=122012&r2=122013&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Thu Dec 16 19:07:35 2010
@@ -237,27 +237,7 @@
/* *** */
-bool MCExpr::EvaluateAsAbsolute(int64_t &Res) const {
- return EvaluateAsAbsolute(Res, 0, 0, 0);
-}
-
-bool MCExpr::EvaluateAsAbsolute(int64_t &Res,
- const MCAsmLayout &Layout) const {
- return EvaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, 0);
-}
-
-bool MCExpr::EvaluateAsAbsolute(int64_t &Res,
- const MCAsmLayout &Layout,
- const SectionAddrMap &Addrs) const {
- return EvaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, &Addrs);
-}
-
-bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const {
- return EvaluateAsAbsolute(Res, &Asm, 0, 0);
-}
-
-bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
- const MCAsmLayout *Layout,
+bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout *Layout,
const SectionAddrMap *Addrs) const {
MCValue Value;
Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=122013&r1=122012&r2=122013&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Thu Dec 16 19:07:35 2010
@@ -83,7 +83,7 @@
// Avoid fixups when possible.
int64_t AbsValue;
- if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue, getAssembler())) {
+ if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue)) {
EmitIntValue(AbsValue, Size, AddrSpace);
return;
}
@@ -114,7 +114,7 @@
void MCObjectStreamer::EmitULEB128Value(const MCExpr *Value,
unsigned AddrSpace) {
int64_t IntValue;
- if (Value->EvaluateAsAbsolute(IntValue, getAssembler())) {
+ if (Value->EvaluateAsAbsolute(IntValue)) {
EmitULEB128IntValue(IntValue, AddrSpace);
return;
}
@@ -124,7 +124,7 @@
void MCObjectStreamer::EmitSLEB128Value(const MCExpr *Value,
unsigned AddrSpace) {
int64_t IntValue;
- if (Value->EvaluateAsAbsolute(IntValue, getAssembler())) {
+ if (Value->EvaluateAsAbsolute(IntValue)) {
EmitSLEB128IntValue(IntValue, AddrSpace);
return;
}
@@ -204,7 +204,7 @@
MCBinaryExpr::Create(MCBinaryExpr::Sub, LabelRef, LastLabelRef,
getContext());
int64_t Res;
- if (AddrDelta->EvaluateAsAbsolute(Res, getAssembler())) {
+ if (AddrDelta->EvaluateAsAbsolute(Res)) {
MCDwarfLineAddr::Emit(this, LineDelta, Res);
return;
}
More information about the llvm-commits
mailing list