diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 15:37:55 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 15:37:55 +0000 |
commit | fc6eb7d3833e0233cda51e18a1f9e21f42c077e3 (patch) | |
tree | 501015c2f8ead945d4acc8262ccefe0a4bcdf2f7 /clang/lib/CodeGen/CGRTTI.cpp | |
parent | 0c6c405e23d9933fc6c681473245e88dbfde4c97 (diff) | |
download | bcm5719-llvm-fc6eb7d3833e0233cda51e18a1f9e21f42c077e3.tar.gz bcm5719-llvm-fc6eb7d3833e0233cda51e18a1f9e21f42c077e3.zip |
Reduce duplicated hash map lookups.
llvm-svn: 162361
Diffstat (limited to 'clang/lib/CodeGen/CGRTTI.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGRTTI.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp index d1b370a1f72..b5cdd7fea31 100644 --- a/clang/lib/CodeGen/CGRTTI.cpp +++ b/clang/lib/CodeGen/CGRTTI.cpp @@ -779,28 +779,24 @@ static unsigned ComputeVMIClassTypeInfoFlags(const CXXBaseSpecifier *Base, cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl()); if (Base->isVirtual()) { - if (Bases.VirtualBases.count(BaseDecl)) { + // Mark the virtual base as seen. + if (!Bases.VirtualBases.insert(BaseDecl)) { // If this virtual base has been seen before, then the class is diamond // shaped. Flags |= RTTIBuilder::VMI_DiamondShaped; } else { if (Bases.NonVirtualBases.count(BaseDecl)) Flags |= RTTIBuilder::VMI_NonDiamondRepeat; - - // Mark the virtual base as seen. - Bases.VirtualBases.insert(BaseDecl); } } else { - if (Bases.NonVirtualBases.count(BaseDecl)) { + // Mark the non-virtual base as seen. + if (!Bases.NonVirtualBases.insert(BaseDecl)) { // If this non-virtual base has been seen before, then the class has non- // diamond shaped repeated inheritance. Flags |= RTTIBuilder::VMI_NonDiamondRepeat; } else { if (Bases.VirtualBases.count(BaseDecl)) Flags |= RTTIBuilder::VMI_NonDiamondRepeat; - - // Mark the non-virtual base as seen. - Bases.NonVirtualBases.insert(BaseDecl); } } |