diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-17 00:00:18 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-17 00:00:18 +0000 |
commit | fe781458d81de407fe8ca9999b06d34231e70210 (patch) | |
tree | 518ab02df2a427f45745512318dff0b0f61de589 /clang/lib | |
parent | 2da1bbc113f654b5dd63e1cf47784a6c6c19024b (diff) | |
download | bcm5719-llvm-fe781458d81de407fe8ca9999b06d34231e70210.tar.gz bcm5719-llvm-fe781458d81de407fe8ca9999b06d34231e70210.zip |
MS static locals mangling: don't count enum scopes
We may not have the mangling for static locals vs. enums completely figured out,
but at least for my simple test cases, enums should not increment the mangling
number.
Differential Revision: http://reviews.llvm.org/D4164
llvm-svn: 211078
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/Scope.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 92a13659ea3..0b59fef2f8f 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3780,7 +3780,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, /// void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) { // Enter the scope of the enum body and start the definition. - ParseScope EnumScope(this, Scope::DeclScope); + ParseScope EnumScope(this, Scope::DeclScope | Scope::EnumScope); Actions.ActOnTagStartDefinition(getCurScope(), EnumDecl); BalancedDelimiterTracker T(*this, tok::l_brace); diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp index 860b7c66ec6..c49133d4727 100644 --- a/clang/lib/Sema/Scope.cpp +++ b/clang/lib/Sema/Scope.cpp @@ -67,6 +67,7 @@ void Scope::Init(Scope *parent, unsigned flags) { // If this is a prototype scope, record that. if (flags & FunctionPrototypeScope) PrototypeDepth++; + if (flags & DeclScope) { if (flags & FunctionPrototypeScope) ; // Prototype scopes are uninteresting. @@ -74,6 +75,8 @@ void Scope::Init(Scope *parent, unsigned flags) { ; // Nested class scopes aren't ambiguous. else if ((flags & ClassScope) && getParent()->getFlags() == DeclScope) ; // Classes inside of namespaces aren't ambiguous. + else if ((flags & EnumScope)) + ; // Don't increment for enum scopes. else incrementMSLocalManglingNumber(); } |