From 2a791d7d21c6fe3f3369eff3ebf394675b1a525d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 14 Sep 2015 18:38:22 +0000 Subject: [opaque pointer type] Fix a few uses of PointerType::getElementType in favor of uses of types already available elsewhere These are a few cleanups I happened to have from trying to go in a different direction recently, so just flushing them out while I have them. llvm-svn: 247593 --- clang/lib/CodeGen/CGCXX.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGCXX.cpp') diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 0314b7c619a..592b74f1909 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -151,8 +151,8 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, return false; // Derive the type for the alias. - llvm::PointerType *AliasType - = getTypes().GetFunctionType(AliasDecl)->getPointerTo(); + llvm::Type *AliasValueType = getTypes().GetFunctionType(AliasDecl); + llvm::PointerType *AliasType = AliasValueType->getPointerTo(); // Find the referent. Some aliases might require a bitcast, in // which case the caller is responsible for ensuring the soundness @@ -185,8 +185,8 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, return true; // Create the alias with no name. - auto *Alias = llvm::GlobalAlias::create(AliasType->getElementType(), 0, - Linkage, "", Aliasee, &getModule()); + auto *Alias = llvm::GlobalAlias::create(AliasValueType, 0, Linkage, "", + Aliasee, &getModule()); // Switch any previous uses to the alias. if (Entry) { -- cgit v1.2.3