forked from OSchip/llvm-project
Revert "[AST] Pick last tentative definition as the acting definition"
This reverts commit 9a5f388850
.
The written test breaks some builds on Mach-O.
This commit is contained in:
parent
de620f5b13
commit
1b19f90a23
|
@ -2216,18 +2216,14 @@ VarDecl *VarDecl::getActingDefinition() {
|
|||
return nullptr;
|
||||
|
||||
VarDecl *LastTentative = nullptr;
|
||||
|
||||
// Loop through the declaration chain, starting with the most recent.
|
||||
for (VarDecl *Decl = getMostRecentDecl(); Decl;
|
||||
Decl = Decl->getPreviousDecl()) {
|
||||
Kind = Decl->isThisDeclarationADefinition();
|
||||
VarDecl *First = getFirstDecl();
|
||||
for (auto I : First->redecls()) {
|
||||
Kind = I->isThisDeclarationADefinition();
|
||||
if (Kind == Definition)
|
||||
return nullptr;
|
||||
// Record the first (most recent) TentativeDefinition that is encountered.
|
||||
if (Kind == TentativeDefinition && !LastTentative)
|
||||
LastTentative = Decl;
|
||||
if (Kind == TentativeDefinition)
|
||||
LastTentative = I;
|
||||
}
|
||||
|
||||
return LastTentative;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
|
||||
|
||||
char arr[10];
|
||||
char arr[10] __attribute__((section("datadata")));
|
||||
char arr[10] __attribute__((aligned(16)));
|
||||
|
||||
// CHECK: @arr ={{.*}}section "datadata", align 16
|
Loading…
Reference in New Issue