File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -1745,15 +1745,13 @@ ExpectedType ASTNodeImporter::VisitTagType(const TagType *T) {
1745
1745
if (!ToDeclOrErr)
1746
1746
return ToDeclOrErr.takeError ();
1747
1747
1748
- if (DeclForType->isUsed ()) {
1749
- // If there is a definition of the 'OriginalDecl', it should be imported to
1750
- // have all information for the type in the "To" AST. (In some cases no
1751
- // other reference may exist to the definition decl and it would not be
1752
- // imported otherwise.)
1753
- Expected<TagDecl *> ToDefDeclOrErr = import (DeclForType->getDefinition ());
1754
- if (!ToDefDeclOrErr)
1755
- return ToDefDeclOrErr.takeError ();
1756
- }
1748
+ // If there is a definition of the 'OriginalDecl', it should be imported to
1749
+ // have all information for the type in the "To" AST. (In some cases no
1750
+ // other reference may exist to the definition decl and it would not be
1751
+ // imported otherwise.)
1752
+ Expected<TagDecl *> ToDefDeclOrErr = import (DeclForType->getDefinition ());
1753
+ if (!ToDefDeclOrErr)
1754
+ return ToDefDeclOrErr.takeError ();
1757
1755
1758
1756
if (T->isCanonicalUnqualified ())
1759
1757
return Importer.getToContext ().getCanonicalTagType (*ToDeclOrErr);
Original file line number Diff line number Diff line change 2
2
// RUN: mkdir -p %t
3
3
// RUN: split-file %s %t
4
4
5
- // RUN: %clang_cc1 -emit-pch -o %t/import.c.ast %t/import.c
5
+ // RUN: %clang_cc1 -x c - emit-pch -o %t/import.c.ast %t/import.c
6
6
7
- // RUN: %clang_extdef_map -- -x c %t/import.c > > %t/externalDefMap.tmp.txt
8
- // RUN: sed 's/$/.ast/' %t/externalDefMap.tmp.txt >> %t/externalDefMap.txt
7
+ // RUN: %clang_extdef_map %t/import.c -- -c - x c > %t/externalDefMap.tmp.txt
8
+ // RUN: sed 's/$/.ast/' %t/externalDefMap.tmp.txt > %t/externalDefMap.txt
9
9
10
10
// RUN: %clang_cc1 -analyze \
11
11
// RUN: -analyzer-checker=core \
12
12
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
13
13
// RUN: -analyzer-config display-ctu-progress=true \
14
14
// RUN: -analyzer-config ctu-dir=%t \
15
- // RUN: -verify %t/main.c
15
+ // RUN: -verify %t/main.c 2>&1 | FileCheck %s
16
16
17
17
//--- main.c
18
18
19
19
// expected-no-diagnostics
20
+ // CHECK: CTU loaded AST file:
20
21
21
22
typedef struct X_s X_t ;
22
- unsigned long f_import (struct X_s * xPtr );
23
23
24
- static void freeWriteFileResources (struct X_s * xPtr ) {
24
+ long f_import (struct X_s * xPtr );
25
+
26
+ static void f_main (struct X_s * xPtr ) {
25
27
f_import (xPtr );
26
28
}
27
29
@@ -36,7 +38,7 @@ struct X_s {
36
38
Y_t y ;
37
39
};
38
40
39
- unsigned long f_import (struct X_s * xPtr ) {
41
+ long f_import (struct X_s * xPtr ) {
40
42
if (xPtr != 0 ) {
41
43
}
42
44
return 0 ;
Original file line number Diff line number Diff line change @@ -10025,7 +10025,8 @@ struct ImportTemplateParmDeclDefaultValue
10025
10025
EXPECT_EQ (ToD->getPreviousDecl (), ToDInherited);
10026
10026
} else {
10027
10027
EXPECT_EQ (FromD, FromDInherited->getPreviousDecl ());
10028
- EXPECT_EQ (ToD, ToDInherited->getPreviousDecl ());
10028
+ // The order is reversed by the import process.
10029
+ EXPECT_EQ (ToD->getPreviousDecl (), ToDInherited);
10029
10030
}
10030
10031
}
10031
10032
You can’t perform that action at this time.
0 commit comments