[llvm-commits] [vmkit] r51488 - in /vmkit/trunk/lib/N3/VMCore: CLIJit.cpp Opcodes.cpp VMClass.cpp

Dan Gohman gohman at apple.com
Fri May 23 10:45:48 PDT 2008


Author: djg
Date: Fri May 23 12:45:47 2008
New Revision: 51488

URL: http://llvm.org/viewvc/llvm-project?rev=51488&view=rev
Log:
Change uses of llvm::Type::isFirstClassType to use the new
llvm::Type::isSingleValueType. The isFirstClassType function has
recently changed to return true for struct and array types.

vmkit may some day want to use of isFirstClassType for some of
these some day as an optimization, but it'll require some
consideration.

Modified:
    vmkit/trunk/lib/N3/VMCore/CLIJit.cpp
    vmkit/trunk/lib/N3/VMCore/Opcodes.cpp
    vmkit/trunk/lib/N3/VMCore/VMClass.cpp

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

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Fri May 23 12:45:47 2008
@@ -1190,7 +1190,7 @@
       VMCommonClass* cl = *i;
       cl->resolveType(false, false);
       AllocaInst* alloc = new AllocaInst(cl->naturalType, "", currentBlock);
-      if (cl->naturalType->isFirstClassType()) {
+      if (cl->naturalType->isSingleValueType()) {
         new StoreInst(Constant::getNullValue(cl->naturalType), alloc, false,
                       currentBlock);
       } else {
@@ -1362,7 +1362,7 @@
       VMCommonClass* cl = *i;
       cl->resolveType(false, false);
       AllocaInst* alloc = new AllocaInst(cl->naturalType, "", currentBlock);
-      if (cl->naturalType->isFirstClassType()) {
+      if (cl->naturalType->isSingleValueType()) {
         new StoreInst(Constant::getNullValue(cl->naturalType), alloc, false,
                       currentBlock);
       } else {

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

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Fri May 23 12:45:47 2008
@@ -175,7 +175,7 @@
 static void store(Value* val, Value* local, bool vol, 
                   BasicBlock* currentBlock) {
   const Type* contained = local->getType()->getContainedType(0);
-  if (contained->isFirstClassType()) {
+  if (contained->isSingleValueType()) {
     if (val->getType() != contained) {
       convertValue(val, contained, currentBlock);
     }
@@ -194,7 +194,7 @@
 
 static Value* load(Value* val, const char* name, BasicBlock* currentBlock) {
   const Type* contained = val->getType()->getContainedType(0);
-  if (contained->isFirstClassType()) {
+  if (contained->isSingleValueType()) {
     return new LoadInst(val, name, currentBlock);
   } else {
     uint64 size = mvm::jit::getTypeSize(contained);

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

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Fri May 23 12:45:47 2008
@@ -634,7 +634,7 @@
   const llvm::StructType* STy = llvm::dyn_cast<llvm::StructType>(arg);
   for (llvm::StructType::element_iterator I = STy->element_begin(),
        E = STy->element_end(); I != E; ++I) {
-    if ((*I)->isFirstClassType()) {
+    if ((*I)->isSingleValueType()) {
       args.push_back(*I);
     } else {
       disassembleStruct(args, *I);
@@ -673,14 +673,14 @@
       if (cur->naturalType->isAbstract()) {
         cur->resolveType(false, false);
       }
-      if (cur->naturalType->isFirstClassType()) {
+      if (cur->naturalType->isSingleValueType()) {
         args.push_back(cur->naturalType);
       } else {
         args.push_back(llvm::PointerType::getUnqual(cur->naturalType));
       }
     }
 
-    if (!(ret->isFirstClassType()) && ret != llvm::Type::VoidTy) {
+    if (!(ret->isSingleValueType()) && ret != llvm::Type::VoidTy) {
       args.push_back(llvm::PointerType::getUnqual(ret));
       ret = llvm::Type::VoidTy;
       structRet = true;





More information about the llvm-commits mailing list