]> granicus.if.org Git - clang/commitdiff
Implement review feedback. Use getAsPointerType instead of cast<PointerType>.
authorLauro Ramos Venancio <lauro.venancio@gmail.com>
Thu, 31 Jan 2008 15:19:04 +0000 (15:19 +0000)
committerLauro Ramos Venancio <lauro.venancio@gmail.com>
Thu, 31 Jan 2008 15:19:04 +0000 (15:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46613 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CodeGenTypes.cpp

index 7c6abc1bec56811cc1b1fdd58666f94b0b703b95..9e8a2e0ea625d01c3ca85608e5e71b588f0137c7 100644 (file)
@@ -95,9 +95,9 @@ CodeGenTypes::~CodeGenTypes() {
 /// and T is tag definition. This helper routine does not check
 /// relationship between T and LT.
 static bool isOpaqueTypeDefinition(QualType T, const llvm::Type *LT) {
-  if (T->isPointerType()) {
+  if (const PointerType* PTy = T->getAsPointerType()) {
     return
-      isOpaqueTypeDefinition(cast<PointerType>(*T).getPointeeType(),
+      isOpaqueTypeDefinition(PTy->getPointeeType(),
                              cast<llvm::PointerType>(LT)->getElementType());
   }
   if (!isa<llvm::OpaqueType>(LT))