summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorManuel Jacob <me@manueljacob.de>2016-01-16 20:30:46 +0000
committerManuel Jacob <me@manueljacob.de>2016-01-16 20:30:46 +0000
commit5f6eaac6115a44f4ef3d819123f8694d3d5825ea (patch)
tree4f2535126e469abb4e8af765dcd1692ec466424a /llvm/lib/Linker/LinkModules.cpp
parent7cdedc1e029ea5860f9077abb39013ae7cc6e9cf (diff)
downloadbcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.tar.gz
bcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.zip
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
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 6ffa71e1477..a418f640c02 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -471,10 +471,8 @@ bool ModuleLinker::computeResultingSelectionKind(StringRef ComdatName,
const DataLayout &DstDL = DstM.getDataLayout();
const DataLayout &SrcDL = SrcM.getDataLayout();
- uint64_t DstSize =
- DstDL.getTypeAllocSize(DstGV->getType()->getPointerElementType());
- uint64_t SrcSize =
- SrcDL.getTypeAllocSize(SrcGV->getType()->getPointerElementType());
+ uint64_t DstSize = DstDL.getTypeAllocSize(DstGV->getValueType());
+ uint64_t SrcSize = SrcDL.getTypeAllocSize(SrcGV->getValueType());
if (Result == Comdat::SelectionKind::ExactMatch) {
if (SrcGV->getInitializer() != DstGV->getInitializer())
return emitError("Linking COMDATs named '" + ComdatName +
@@ -598,8 +596,8 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc,
}
const DataLayout &DL = Dest.getParent()->getDataLayout();
- uint64_t DestSize = DL.getTypeAllocSize(Dest.getType()->getElementType());
- uint64_t SrcSize = DL.getTypeAllocSize(Src.getType()->getElementType());
+ uint64_t DestSize = DL.getTypeAllocSize(Dest.getValueType());
+ uint64_t SrcSize = DL.getTypeAllocSize(Src.getValueType());
LinkFromSrc = SrcSize > DestSize;
return false;
}
OpenPOWER on IntegriCloud