зеркало из https://github.com/microsoft/clang.git
Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ffaab3e2bb
Коммит
2d6c906585
|
@ -198,6 +198,12 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) {
|
|||
llvm::SmallVector<Decl*, 2> Decls;
|
||||
for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end();
|
||||
D != DEnd; ++D) {
|
||||
|
||||
// Don't print ObjCIvarDecls, as they are printed when visiting the
|
||||
// containing ObjCInterfaceDecl.
|
||||
if (isa<ObjCIvarDecl>(*D))
|
||||
continue;
|
||||
|
||||
if (!Policy.Dump) {
|
||||
// Skip over implicit declarations in pretty-printing mode.
|
||||
if (D->isImplicit()) continue;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple i386-unknown-unknown -ast-print %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -ast-print %s
|
||||
// RUN: %clang_cc1 -triple i386-unknown-unknown -ast-print %s 2>&1 | FileCheck %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -ast-print %s 2>&1 | FileCheck %s
|
||||
|
||||
@interface current
|
||||
{
|
||||
|
@ -16,3 +16,15 @@ int foo()
|
|||
{
|
||||
return pc->ivar2 + (*pc).ivar + pc->ivar1;
|
||||
}
|
||||
|
||||
// CHECK: @interface current{
|
||||
// CHECK: int ivar;
|
||||
// CHECK: int ivar1;
|
||||
// CHECK: int ivar2;
|
||||
// CHECK: }
|
||||
// CHECK: @end
|
||||
// CHECK: current *pc;
|
||||
// CHECK: int foo() {
|
||||
// CHECK: return pc->ivar2 + (*pc).ivar + pc->ivar1;
|
||||
// CHECK: }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче