diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-23 00:17:26 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-23 00:17:26 +0000 |
commit | 399101a5990621b0357009ab1852cc00f410a6c6 (patch) | |
tree | bb126219987a7e2ed5385d1c3f4d0e111f746740 | |
parent | bbcb34cafb1da98ff4bdb097020d252216c7627c (diff) | |
download | external_llvm-399101a5990621b0357009ab1852cc00f410a6c6.zip external_llvm-399101a5990621b0357009ab1852cc00f410a6c6.tar.gz external_llvm-399101a5990621b0357009ab1852cc00f410a6c6.tar.bz2 |
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachOWriter.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/IPO/ArgumentPromotion.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index c2b42ec..bed2c5c 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -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: { diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index e874ec4..a6bef18 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -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; } diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 5d3dbcd..0da0c97 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -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! |