From: David Majnemer Date: Tue, 1 Sep 2015 01:53:07 +0000 (+0000) Subject: [MS ABI] Cleanup get*ForUnnamedTagDecl X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=883b9addbbf6e898b0f34b78b9ca19ade04af6c9;p=clang [MS ABI] Cleanup get*ForUnnamedTagDecl Use "lookup" instead of operator[], it will not perform unnecessary insertions. No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246523 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftCXXABI.cpp b/lib/AST/MicrosoftCXXABI.cpp index 6847ee16f7..ff84fa5c22 100644 --- a/lib/AST/MicrosoftCXXABI.cpp +++ b/lib/AST/MicrosoftCXXABI.cpp @@ -135,8 +135,8 @@ public: } TypedefNameDecl *getTypedefNameForUnnamedTagDecl(const TagDecl *TD) override { - return UnnamedTagDeclToTypedefNameDecl[const_cast( - TD->getCanonicalDecl())]; + return UnnamedTagDeclToTypedefNameDecl.lookup( + const_cast(TD->getCanonicalDecl())); } void addDeclaratorForUnnamedTagDecl(TagDecl *TD, @@ -149,8 +149,8 @@ public: } DeclaratorDecl *getDeclaratorForUnnamedTagDecl(const TagDecl *TD) override { - return UnnamedTagDeclToDeclaratorDecl[const_cast( - TD->getCanonicalDecl())]; + return UnnamedTagDeclToDeclaratorDecl.lookup( + const_cast(TD->getCanonicalDecl())); } MangleNumberingContext *createMangleNumberingContext() const override {