diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-10-21 19:43:56 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-10-21 19:43:56 +0000 |
commit | 244d24597497c09ab68969c8bbbdf2576130262c (patch) | |
tree | afd198678dafe53f36543e1053230ce25e383e8d /lib/Transforms/IPO | |
parent | 599c0afb244e61fed389ea0d4b5479fbc380dfbf (diff) | |
download | external_llvm-244d24597497c09ab68969c8bbbdf2576130262c.zip external_llvm-244d24597497c09ab68969c8bbbdf2576130262c.tar.gz external_llvm-244d24597497c09ab68969c8bbbdf2576130262c.tar.bz2 |
Use more type helper functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 74ed4e2..82a59ed 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -1175,8 +1175,7 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo, } else if (PHINode *PN = dyn_cast<PHINode>(V)) { // PN's type is pointer to struct. Make a new PHI of pointer to struct // field. - StructType *ST = - cast<StructType>(cast<PointerType>(PN->getType())->getElementType()); + StructType *ST = cast<StructType>(PN->getType()->getPointerElementType()); PHINode *NewPN = PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)), @@ -2013,8 +2012,7 @@ static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL, CSVals[1] = 0; StructType *StructTy = - cast <StructType>( - cast<ArrayType>(GCL->getType()->getElementType())->getElementType()); + cast<StructType>(GCL->getType()->getElementType()->getArrayElementType()); // Create the new init list. std::vector<Constant*> CAList; |