summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2018-10-11 12:49:50 +0000
committerDylan McKay <me@dylanmckay.io>2018-10-11 12:49:50 +0000
commite48f27a0b1df01cb005dedbfe1b5de3146385f40 (patch)
treec25067a54c4f3443205a4d00bd6ffbad3a3d450a
parent8e5328b6f070e3ec2dfadfa99dc34f26f569e528 (diff)
downloadbcm5719-llvm-e48f27a0b1df01cb005dedbfe1b5de3146385f40.tar.gz
bcm5719-llvm-e48f27a0b1df01cb005dedbfe1b5de3146385f40.zip
Generalize an IR verifier check to work with non-zero program address spaces
This commit modifies an existing IR verifier check that assumes all functions will be located in the default address space 0. Rather than using the default paramater value getPointerTo(AddrSpace=0), explicitly specify the program memory address space from the data layout. This only affects targets that specify a nonzero address space in their data layouts. The only in-tree target that does this is AVR. llvm-svn: 344243
-rw-r--r--llvm/lib/IR/Verifier.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 4b954c710e3..8304ec6e8f4 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -632,7 +632,8 @@ void Verifier::visitGlobalVariable(const GlobalVariable &GV) {
if (ArrayType *ATy = dyn_cast<ArrayType>(GV.getValueType())) {
StructType *STy = dyn_cast<StructType>(ATy->getElementType());
PointerType *FuncPtrTy =
- FunctionType::get(Type::getVoidTy(Context), false)->getPointerTo();
+ FunctionType::get(Type::getVoidTy(Context), false)->
+ getPointerTo(DL.getProgramAddressSpace());
// FIXME: Reject the 2-field form in LLVM 4.0.
Assert(STy &&
(STy->getNumElements() == 2 || STy->getNumElements() == 3) &&
OpenPOWER on IntegriCloud