summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-22 16:11:57 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-22 16:11:57 +0000
commit50ce2f06de7f5b5d36fbe94d76e7a434ebe0e41a (patch)
tree4d6ecbab6bc28950155d833e4b785b966a0a527b
parent73c0ae77caeeb6c644b082216ecc3b9e792c405a (diff)
downloadbcm5719-llvm-50ce2f06de7f5b5d36fbe94d76e7a434ebe0e41a.tar.gz
bcm5719-llvm-50ce2f06de7f5b5d36fbe94d76e7a434ebe0e41a.zip
Use references and simplify.
llvm-svn: 122405
-rw-r--r--llvm/include/llvm/MC/MCExpr.h2
-rw-r--r--llvm/lib/MC/MCAssembler.cpp2
-rw-r--r--llvm/lib/MC/MCExpr.cpp9
3 files changed, 5 insertions, 8 deletions
diff --git a/llvm/include/llvm/MC/MCExpr.h b/llvm/include/llvm/MC/MCExpr.h
index da3cebe414e..49bdfd96cc7 100644
--- a/llvm/include/llvm/MC/MCExpr.h
+++ b/llvm/include/llvm/MC/MCExpr.h
@@ -90,7 +90,7 @@ public:
/// @param Res - The relocatable value, if evaluation succeeds.
/// @param Layout - The assembler layout object to use for evaluating values.
/// @result - True on success.
- bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout = 0) const;
+ bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout &Layout) const;
/// @}
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 4ecedcb9bcc..bff883672d3 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -215,7 +215,7 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
MCValue &Target, uint64_t &Value) const {
++stats::EvaluateFixup;
- if (!Fixup.getValue()->EvaluateAsRelocatable(Target, &Layout))
+ if (!Fixup.getValue()->EvaluateAsRelocatable(Target, Layout))
report_fatal_error("expected relocatable expression");
// FIXME: How do non-scattered symbols work in ELF? I presume the linker
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index e487416fe0b..58f2e94dd62 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -409,12 +409,9 @@ static bool EvaluateSymbolicAdd(const MCAssembler *Asm,
}
bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
- const MCAsmLayout *Layout) const {
- if (Layout)
- return EvaluateAsRelocatableImpl(Res, &Layout->getAssembler(), Layout,
- 0, false);
- else
- return EvaluateAsRelocatableImpl(Res, 0, 0, 0, false);
+ const MCAsmLayout &Layout) const {
+ return EvaluateAsRelocatableImpl(Res, &Layout.getAssembler(), &Layout,
+ 0, false);
}
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
OpenPOWER on IntegriCloud