r247586 - Revert "[opaque pointer type] update for LLVM API change"
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 11:02:05 PDT 2015
Author: dblaikie
Date: Mon Sep 14 13:02:04 2015
New Revision: 247586
URL: http://llvm.org/viewvc/llvm-project?rev=247586&view=rev
Log:
Revert "[opaque pointer type] update for LLVM API change"
This was the wrong direction to take anyway (because ultimately the
GlobalValue needed the pointee type again and /it/ used
PointerType::getElementType eventually anyway)... let's go a different way.
This reverts commit r236161.
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=247586&r1=247585&r2=247586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Mon Sep 14 13:02:04 2015
@@ -185,8 +185,8 @@ bool CodeGenModule::TryEmitDefinitionAsA
return true;
// Create the alias with no name.
- auto *Alias =
- llvm::GlobalAlias::create(AliasType, Linkage, "", Aliasee, &getModule());
+ auto *Alias = llvm::GlobalAlias::create(AliasType->getElementType(), 0,
+ Linkage, "", Aliasee, &getModule());
// Switch any previous uses to the alias.
if (Entry) {
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=247586&r1=247585&r2=247586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Mon Sep 14 13:02:04 2015
@@ -1065,7 +1065,7 @@ llvm::Value *CGObjCGNU::GetSelector(Code
}
if (!SelValue) {
SelValue = llvm::GlobalAlias::create(
- SelectorTy, llvm::GlobalValue::PrivateLinkage,
+ SelectorTy->getElementType(), 0, llvm::GlobalValue::PrivateLinkage,
".objc_selector_" + Sel.getAsString(), &TheModule);
Types.emplace_back(TypeEncoding, SelValue);
}
@@ -1278,14 +1278,14 @@ CGObjCGNU::GenerateMessageSendSuper(Code
if (IsClassMessage) {
if (!MetaClassPtrAlias) {
MetaClassPtrAlias = llvm::GlobalAlias::create(
- IdTy, llvm::GlobalValue::InternalLinkage,
+ IdTy->getElementType(), 0, llvm::GlobalValue::InternalLinkage,
".objc_metaclass_ref" + Class->getNameAsString(), &TheModule);
}
ReceiverClass = MetaClassPtrAlias;
} else {
if (!ClassPtrAlias) {
ClassPtrAlias = llvm::GlobalAlias::create(
- IdTy, llvm::GlobalValue::InternalLinkage,
+ IdTy->getElementType(), 0, llvm::GlobalValue::InternalLinkage,
".objc_class_ref" + Class->getNameAsString(), &TheModule);
}
ReceiverClass = ClassPtrAlias;
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=247586&r1=247585&r2=247586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Sep 14 13:02:04 2015
@@ -2772,7 +2772,7 @@ void CodeGenModule::EmitAliasDefinition(
// Create the new alias itself, but don't set a name yet.
auto *GA = llvm::GlobalAlias::create(
- cast<llvm::PointerType>(Aliasee->getType()),
+ cast<llvm::PointerType>(Aliasee->getType())->getElementType(), 0,
llvm::Function::ExternalLinkage, "", Aliasee, &getModule());
if (Entry) {
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=247586&r1=247585&r2=247586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Mon Sep 14 13:02:04 2015
@@ -3354,8 +3354,8 @@ static void emitConstructorDestructorAli
llvm::PointerType *AliasType = Aliasee->getType();
// Create the alias with no name.
- auto *Alias = llvm::GlobalAlias::create(AliasType, Linkage, "", Aliasee,
- &CGM.getModule());
+ auto *Alias = llvm::GlobalAlias::create(
+ AliasType->getElementType(), 0, Linkage, "", Aliasee, &CGM.getModule());
// Switch any previous uses to the alias.
if (Entry) {
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=247586&r1=247585&r2=247586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Mon Sep 14 13:02:04 2015
@@ -1734,8 +1734,9 @@ llvm::GlobalVariable *MicrosoftCXXABI::g
C->setSelectionKind(llvm::Comdat::Largest);
}
VFTable = llvm::GlobalAlias::create(
- cast<llvm::PointerType>(VTableGEP->getType()), VFTableLinkage,
- VFTableName.str(), VTableGEP, &CGM.getModule());
+ cast<llvm::SequentialType>(VTableGEP->getType())->getElementType(),
+ /*AddressSpace=*/0, VFTableLinkage, VFTableName.str(), VTableGEP,
+ &CGM.getModule());
VFTable->setUnnamedAddr(true);
} else {
// We don't need a GlobalAlias to be a symbol for the VTable if we won't
More information about the cfe-commits
mailing list