Use isSingleValueType instead of isFirstClassType to
authorDan Gohman <gohman@apple.com>
Fri, 23 May 2008 00:17:26 +0000 (00:17 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 23 May 2008 00:17:26 +0000 (00:17 +0000)
exclude struct and array types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachOWriter.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/GlobalOpt.cpp

index c2b42ec48a7ba40094f05254c09fb720e7e1e957..bed2c5ca4b2960ad68d10513d488d89b4000ae9d 100644 (file)
@@ -840,7 +840,7 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
         abort();
         break;
       }
-    } else if (PC->getType()->isFirstClassType()) {
+    } else if (PC->getType()->isSingleValueType()) {
       unsigned char *ptr = (unsigned char *)PA;
       switch (PC->getType()->getTypeID()) {
       case Type::IntegerTyID: {
index e874ec4ec622d5925615b8c33e86cf680fc59433..a6bef18e8235cded4efe9720f266c338ff46d0bd 100644 (file)
@@ -154,10 +154,10 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
                << PtrArg->getName() << "' because it would require adding more "
                << "than " << maxElements << " arguments to the function.\n";
         } else {
-          // If all the elements are first class types, we can promote it.
+          // If all the elements are single-value types, we can promote it.
           bool AllSimple = true;
           for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
-            if (!STy->getElementType(i)->isFirstClassType()) {
+            if (!STy->getElementType(i)->isSingleValueType()) {
               AllSimple = false;
               break;
             }
index 5d3dbcd40131817563541fcfd0d81baf1e411415..0da0c97bfb8cf762ae7884c3564534e377cc2ea5 100644 (file)
@@ -1493,11 +1493,11 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
     // this global a local variable) we replace the global with a local alloca
     // in this function.
     //
-    // NOTE: It doesn't make sense to promote non first class types since we
+    // NOTE: It doesn't make sense to promote non single-value types since we
     // are just replacing static memory to stack memory.
     if (!GS.HasMultipleAccessingFunctions &&
         GS.AccessingFunction && !GS.HasNonInstructionUser &&
-        GV->getType()->getElementType()->isFirstClassType() &&
+        GV->getType()->getElementType()->isSingleValueType() &&
         GS.AccessingFunction->getName() == "main" &&
         GS.AccessingFunction->hasExternalLinkage()) {
       DOUT << "LOCALIZING GLOBAL: " << *GV;
@@ -1548,7 +1548,7 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
 
       ++NumMarked;
       return true;
-    } else if (!GV->getInitializer()->getType()->isFirstClassType()) {
+    } else if (!GV->getInitializer()->getType()->isSingleValueType()) {
       if (GlobalVariable *FirstNewGV = SRAGlobal(GV, 
                                                  getAnalysis<TargetData>())) {
         GVI = FirstNewGV;  // Don't skip the newly produced globals!