diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-02-27 01:31:55 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-02-27 01:31:55 +0000 |
commit | 68a5750d5d046c49e446c129731782380ac093f3 (patch) | |
tree | 93b8f2582312447fe636b13861d6a175710b3f8d /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 2063679ec43c222e39e6e7849fa0a3d7a956195f (diff) | |
download | bcm5719-llvm-68a5750d5d046c49e446c129731782380ac093f3.tar.gz bcm5719-llvm-68a5750d5d046c49e446c129731782380ac093f3.zip |
Temporarily revert r176116 for compile-time performance regression.
This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c.
llvm-svn: 176151
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 2d0d2b83778..970ba50b71a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1343,7 +1343,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) { LexicalBlockStack.push_back(FwdDeclNode); RegionMap[Ty->getDecl()] = llvm::WeakVH(FwdDecl); - // Add this to the completed-type cache while we're completing it recursively. + // Add this to the completed types cache since we're completing it. CompletedTypeCache[QualType(Ty, 0).getAsOpaquePtr()] = FwdDecl; // Convert all the elements. @@ -1436,8 +1436,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, // Otherwise, insert it into the CompletedTypeCache so that recursive uses // will find it and we're emitting the complete type. - QualType QualTy = QualType(Ty, 0); - CompletedTypeCache[QualTy.getAsOpaquePtr()] = RealDecl; + CompletedTypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl; // Push the struct on region stack. llvm::TrackingVH<llvm::MDNode> FwdDeclNode(RealDecl); @@ -1562,12 +1561,6 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, llvm::DIArray Elements = DBuilder.getOrCreateArray(EltTys); FwdDeclNode->replaceOperandWith(10, Elements); - - // If the implementation is not yet set, we do not want to mark it - // as complete. An implementation may declare additional - // private ivars that we would miss otherwise. - if (ID->getImplementation() == 0) - CompletedTypeCache.erase(QualTy.getAsOpaquePtr()); LexicalBlockStack.pop_back(); return llvm::DIType(FwdDeclNode); @@ -1831,10 +1824,6 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit) { ReplaceMap.push_back(std::make_pair(Ty.getAsOpaquePtr(), static_cast<llvm::Value*>(TC))); - // Do not cache the type if it may be incomplete. - if (maybeIncompleteInterface(Ty)) - return Res; - // And update the type cache. TypeCache[Ty.getAsOpaquePtr()] = Res; @@ -1844,21 +1833,6 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit) { return Res; } -/// clang::ParseAST handles each TopLevelDecl immediately after it was parsed. -/// A subsequent implementation may add more ivars to an interface, which is -/// why we cannot cache it yet. -bool CGDebugInfo::maybeIncompleteInterface(QualType Ty) { - switch (Ty->getTypeClass()) { - case Type::ObjCObjectPointer: - return maybeIncompleteInterface(cast<ObjCObjectPointerType>(Ty)->getPointeeType()); - case Type::ObjCInterface: - if (ObjCInterfaceDecl *Decl = cast<ObjCInterfaceType>(Ty)->getDecl()) - return (Decl->getImplementation() == 0); - default: - return false; - } -} - /// CreateTypeNode - Create a new debug type node. llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile Unit) { // Handle qualifiers, which recursively handles what they refer to. |