From 5f6eaac6115a44f4ef3d819123f8694d3d5825ea Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Sat, 16 Jan 2016 20:30:46 +0000 Subject: GlobalValue: use getValueType() instead of getType()->getPointerElementType(). Reviewers: mjacob Subscribers: jholewinski, arsenm, dsanders, dblaikie Patch by Eduard Burtescu. Differential Revision: http://reviews.llvm.org/D16260 llvm-svn: 257999 --- llvm/lib/Analysis/GlobalsModRef.cpp | 2 +- llvm/lib/Analysis/Lint.cpp | 2 +- llvm/lib/Analysis/ValueTracking.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp index 425d9de876b..db3d5f781d8 100644 --- a/llvm/lib/Analysis/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/GlobalsModRef.cpp @@ -310,7 +310,7 @@ void GlobalsAAResult::AnalyzeGlobals(Module &M) { ++NumNonAddrTakenGlobalVars; // If this global holds a pointer type, see if it is an indirect global. - if (GV.getType()->getElementType()->isPointerTy() && + if (GV.getValueType()->isPointerTy() && AnalyzeIndirectGlobalMemory(&GV)) ++NumIndirectGlobalVars; } diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp index 2dfb09c95ad..b6d74c9c799 100644 --- a/llvm/lib/Analysis/Lint.cpp +++ b/llvm/lib/Analysis/Lint.cpp @@ -435,7 +435,7 @@ void Lint::visitMemoryReference(Instruction &I, // If the global may be defined differently in another compilation unit // then don't warn about funky memory accesses. if (GV->hasDefinitiveInitializer()) { - Type *GTy = GV->getType()->getElementType(); + Type *GTy = GV->getValueType(); if (GTy->isSized()) BaseSize = DL->getTypeAllocSize(GTy); BaseAlign = GV->getAlignment(); diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 9a17f5660b2..ae7d9216373 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1560,7 +1560,7 @@ static unsigned getAlignment(const Value *V, const DataLayout &DL) { Align = GO->getAlignment(); if (Align == 0) { if (auto *GVar = dyn_cast(GO)) { - Type *ObjectType = GVar->getType()->getElementType(); + Type *ObjectType = GVar->getValueType(); if (ObjectType->isSized()) { // If the object is defined in the current Module, we'll be giving // it the preferred alignment. Otherwise, we have to assume that it -- cgit v1.2.3