r246523 - [MS ABI] Cleanup get*ForUnnamedTagDecl
David Majnemer via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 31 18:53:07 PDT 2015
Author: majnemer
Date: Mon Aug 31 20:53:07 2015
New Revision: 246523
URL: http://llvm.org/viewvc/llvm-project?rev=246523&view=rev
Log:
[MS ABI] Cleanup get*ForUnnamedTagDecl
Use "lookup" instead of operator[], it will not perform unnecessary
insertions. No functionality change is intended.
Modified:
cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
Modified: cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftCXXABI.cpp?rev=246523&r1=246522&r2=246523&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftCXXABI.cpp Mon Aug 31 20:53:07 2015
@@ -135,8 +135,8 @@ public:
}
TypedefNameDecl *getTypedefNameForUnnamedTagDecl(const TagDecl *TD) override {
- return UnnamedTagDeclToTypedefNameDecl[const_cast<TagDecl *>(
- TD->getCanonicalDecl())];
+ return UnnamedTagDeclToTypedefNameDecl.lookup(
+ const_cast<TagDecl *>(TD->getCanonicalDecl()));
}
void addDeclaratorForUnnamedTagDecl(TagDecl *TD,
@@ -149,8 +149,8 @@ public:
}
DeclaratorDecl *getDeclaratorForUnnamedTagDecl(const TagDecl *TD) override {
- return UnnamedTagDeclToDeclaratorDecl[const_cast<TagDecl *>(
- TD->getCanonicalDecl())];
+ return UnnamedTagDeclToDeclaratorDecl.lookup(
+ const_cast<TagDecl *>(TD->getCanonicalDecl()));
}
MangleNumberingContext *createMangleNumberingContext() const override {
More information about the cfe-commits
mailing list