r281078 - Modules: revert r280728.
Manman Ren via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 9 12:03:07 PDT 2016
Author: mren
Date: Fri Sep 9 14:03:07 2016
New Revision: 281078
URL: http://llvm.org/viewvc/llvm-project?rev=281078&view=rev
Log:
Modules: revert r280728.
In post-commit review, Richard suggested a better way to fix this.
rdar://27926200
Removed:
cfe/trunk/test/Modules/Inputs/lookup-assert/
cfe/trunk/test/Modules/lookup-assert.m
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=281078&r1=281077&r2=281078&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Fri Sep 9 14:03:07 2016
@@ -1413,6 +1413,10 @@ DeclContext::lookup(DeclarationName Name
assert(DeclKind != Decl::LinkageSpec && DeclKind != Decl::Export &&
"should not perform lookups into transparent contexts");
+ const DeclContext *PrimaryContext = getPrimaryContext();
+ if (PrimaryContext != this)
+ return PrimaryContext->lookup(Name);
+
// If we have an external source, ensure that any later redeclarations of this
// context have been loaded, since they may add names to the result of this
// lookup (or add external visible storage).
@@ -1420,12 +1424,6 @@ DeclContext::lookup(DeclarationName Name
if (Source)
(void)cast<Decl>(this)->getMostRecentDecl();
- // getMostRecentDecl can change the result of getPrimaryContext. Call
- // getPrimaryContext afterwards.
- const DeclContext *PrimaryContext = getPrimaryContext();
- if (PrimaryContext != this)
- return PrimaryContext->lookup(Name);
-
if (hasExternalVisibleStorage()) {
assert(Source && "external visible storage but no external source?");
Removed: cfe/trunk/test/Modules/lookup-assert.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/lookup-assert.m?rev=281077&view=auto
==============================================================================
--- cfe/trunk/test/Modules/lookup-assert.m (original)
+++ cfe/trunk/test/Modules/lookup-assert.m (removed)
@@ -1,10 +0,0 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert %s -verify
-// expected-no-diagnostics
-
-#include "Derive.h"
-#import <H3.h>
- at implementation DerivedInterface
-- (void)test {
-}
- at end
More information about the cfe-commits
mailing list