[vmkit-commits] [vmkit] r55313 - in /vmkit/trunk/lib/N3/VMCore: CLISignature.cpp VMClass.cpp VMClass.h

Tilmann Scheller tilmann.scheller at googlemail.com
Mon Aug 25 09:13:53 PDT 2008


Author: tilmann
Date: Mon Aug 25 11:13:52 2008
New Revision: 55313

URL: http://llvm.org/viewvc/llvm-project?rev=55313&view=rev
Log:
add flag for dummy classes

Modified:
    vmkit/trunk/lib/N3/VMCore/CLISignature.cpp
    vmkit/trunk/lib/N3/VMCore/VMClass.cpp
    vmkit/trunk/lib/N3/VMCore/VMClass.h

Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=55313&r1=55312&r2=55313&view=diff

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Mon Aug 25 11:13:52 2008
@@ -300,9 +300,10 @@
   if (currGenericMethod == NULL) {
     // when reading in signatures which contain references to generic arguments
     // of generic methods we need create a placeholder for each of them,
-    // this is done by creating a dummy VMClass which has the assembly field
-    // set to NULL, the token field is used to store the generic argument number
+    // this is done by creating a dummy VMClass,
+    // the token field is used to store the generic argument number
     VMClass* cl = gc_new(VMClass)();
+    cl->isDummy = true;
     cl->token = number;
     cl->assembly = ass;
     cl->nameSpace = ass->name;

Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=55313&r1=55312&r2=55313&view=diff

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Mon Aug 25 11:13:52 2008
@@ -168,6 +168,7 @@
   this->isArray = isArray;
   this->isPointer = false;
   this->isPrimitive = false;
+  this->isDummy = false;
   this->naturalType = llvm::OpaqueType::get();
 }
 
@@ -831,16 +832,14 @@
 		std::vector<VMCommonClass*>::iterator i = parameters.begin(), a =
 				args.begin(), e = args.end();
 
-		// dummy classes for generic arguments have a NULL assembly field
 		// check whether both i and a point to a dummy class
-		if (((*i)->assembly == NULL && (*a)->assembly != NULL) ||
-		    ((*i)->assembly != NULL && (*a)->assembly == NULL))
+		if (((*i)->isDummy && !(*a)->isDummy) || (!(*i)->isDummy && (*a)->isDummy))
 		  return false;
 		
 		// dummy classes for generic arguments contain the 
 		// argument number in the token field
 		// signature is only equal if the argument number matches
-		if ((*i)->assembly == NULL && (*a)->assembly == NULL) {
+		if ((*i)->isDummy && (*a)->isDummy) {
 		  if ((*i)->token != (*a)->token) {
 		    return false;
 		  }
@@ -857,16 +856,14 @@
 		}
 
 		for (; a != e; ++i, ++a) {
-	    // dummy classes for generic arguments have a NULL assembly field
 	    // check whether both i and a point to a dummy class
-	    if (((*i)->assembly == NULL && (*a)->assembly != NULL) ||
-	        ((*i)->assembly != NULL && (*a)->assembly == NULL))
+	    if (((*i)->isDummy && !(*a)->isDummy) || (!(*i)->isDummy && (*a)->isDummy))
 	      return false;
 	    
 	    // dummy classes for generic arguments contain the 
 	    // argument number in the token field
 	    // signature is only equal if the argument number matches
-	    if ((*i)->assembly == NULL && (*a)->assembly == NULL) {
+	    if ((*i)->isDummy && (*a)->isDummy) {
 	      if ((*i)->token != (*a)->token) {
 	        return false;
 	      } else {

Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=55313&r1=55312&r2=55313&view=diff

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMClass.h (original)
+++ vmkit/trunk/lib/N3/VMCore/VMClass.h Mon Aug 25 11:13:52 2008
@@ -74,6 +74,7 @@
   bool isArray;
   bool isPointer;
   bool isPrimitive;
+  bool isDummy;
   uint32 depth;
   VMClassState status;
   uint32 flags;





More information about the vmkit-commits mailing list