diff gen/passes/GarbageCollect2Stack.cpp @ 1291:875afb7a93b6

Factor out some constants into the header so producers and consumers of metadata stay in sync (and are more readable).
author Frits van Bommel <fvbommel wxs.nl>
date Sat, 02 May 2009 20:42:58 +0200
parents 91d9386d4a5a
children 0e79fb40c4d0
line wrap: on
line diff
--- a/gen/passes/GarbageCollect2Stack.cpp	Sat May 02 14:00:57 2009 +0200
+++ b/gen/passes/GarbageCollect2Stack.cpp	Sat May 02 20:42:58 2009 +0200
@@ -197,7 +197,7 @@
           DOUT << ">> Value: " << *ti_global << "\n";
           DOUT << ">> Name: " << ti_global->getNameStr() << "\n");
     
-    std::string metaname = "llvm.ldc.typeinfo.";
+    std::string metaname = TD_PREFIX;
     metaname.append(ti_global->getNameStart(), ti_global->getNameEnd());
     
     DEBUG(DOUT << ">> Looking for global named " << metaname << "\n");
@@ -215,13 +215,13 @@
     
     DEBUG(DOUT << ">> Found metadata node\n");
     
-    if (node->getNumOperands() != 2 ||
-            node->getOperand(0)->stripPointerCasts() != ti_global)
+    if (node->getNumOperands() != TD_NumFields ||
+            node->getOperand(TD_Confirm)->stripPointerCasts() != ti_global)
         return NULL;
     
     DEBUG(DOUT << ">> Validated metadata node\n");
     
-    return node->getOperand(1)->getType();
+    return node->getOperand(TD_Type)->getType();
 }