Simplify.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 22 Dec 2010 13:49:56 +0000 (13:49 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 22 Dec 2010 13:49:56 +0000 (13:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122401 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MachObjectWriter.cpp

index a4c612d0d696c02f9fb6b14c2b3bbec97e8b2ddc..a06176cad6d0339192b33e205fb04f062d78d3a1 100644 (file)
@@ -906,16 +906,15 @@ public:
       // find a case where they are actually emitted.
       Type = macho::RIT_Vanilla;
     } else if (SD->getSymbol().isVariable()) {
-      const MCExpr *Value = SD->getSymbol().getVariableValue();
       int64_t Res;
-      bool isAbs = Value->EvaluateAsAbsolute(Res, Layout, SectionAddress);
-      if (isAbs) {
+      if (SD->getSymbol().getVariableValue()->EvaluateAsAbsolute(
+            Res, Layout, SectionAddress)) {
         FixedValue = Res;
         return;
-      } else {
-        report_fatal_error("unsupported relocation of variable '" +
-                           SD->getSymbol().getName() + "'");
       }
+
+      report_fatal_error("unsupported relocation of variable '" +
+                         SD->getSymbol().getName() + "'");
     } else {
       // Check whether we need an external or internal relocation.
       if (doesSymbolRequireExternRelocation(SD)) {