Use references and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122405 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index e487416..58f2e94 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -409,12 +409,9 @@
}
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,