summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge
diff options
context:
space:
mode:
authorGabor Marton <martongabesz@gmail.com>2018-06-25 14:41:58 +0000
committerGabor Marton <martongabesz@gmail.com>2018-06-25 14:41:58 +0000
commitd0ec7bd1c7ac80c3a76cf5fb1a71132fad244001 (patch)
tree77f519294c96aae9811babed4f559e23494b9893 /clang/test/ASTMerge
parent871b0591294ba68f694ec7105e0479499354f99e (diff)
downloadbcm5719-llvm-d0ec7bd1c7ac80c3a76cf5fb1a71132fad244001.tar.gz
bcm5719-llvm-d0ec7bd1c7ac80c3a76cf5fb1a71132fad244001.zip
[ASTImporter] Import the whole redecl chain of functions
Summary: With this patch when any `FunctionDecl` of a redeclaration chain is imported then we bring in the whole declaration chain. This involves functions and function template specializations. Also friend functions are affected. The chain is imported as it is in the "from" tu, the order of the redeclarations are kept. I also changed the lookup logic in order to find friends, but first making them visible in their declaration context. We may have long redeclaration chains if all TU contains the same prototype, but our measurements shows no degradation in time of CTU analysis (Tmux, Xerces, Bitcoin, Protobuf). Also, as further work we could squash redundant prototypes, but first ensure that functionality is working properly; then should we optimize. This may seem like a huge patch, sorry about that. But, most of the changes are new tests, changes in the production code is not that much. I also tried to create a smaller patch which does not affect specializations, but that patch failed to pass some of the `clang-import-test`s because there we import function specializations. Also very importantly, we can't just change the import of `FunctionDecl`s without changing the import of function template specializations because they are handled as `FunctionDecl`s. Reviewers: a.sidorin, r.stahl, xazax.hun, balazske Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47532 llvm-svn: 335480
Diffstat (limited to 'clang/test/ASTMerge')
-rw-r--r--clang/test/ASTMerge/class/test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/ASTMerge/class/test.cpp b/clang/test/ASTMerge/class/test.cpp
index 99926b649bc..ba553af4072 100644
--- a/clang/test/ASTMerge/class/test.cpp
+++ b/clang/test/ASTMerge/class/test.cpp
@@ -13,12 +13,12 @@
// CHECK: class1.cpp:19:3: note: enumerator 'b' with value 1 here
// CHECK: class2.cpp:12:3: note: enumerator 'a' with value 0 here
-// CHECK: class1.cpp:36:8: warning: type 'F2' has incompatible definitions in different translation units
-// CHECK: class1.cpp:39:3: note: friend declared here
-// CHECK: class2.cpp:30:8: note: no corresponding friend here
-
// CHECK: class1.cpp:43:8: warning: type 'F3' has incompatible definitions in different translation units
// CHECK: class1.cpp:46:3: note: friend declared here
// CHECK: class2.cpp:36:8: note: no corresponding friend here
+// CHECK: class1.cpp:36:8: warning: type 'F2' has incompatible definitions in different translation units
+// CHECK: class1.cpp:39:3: note: friend declared here
+// CHECK: class2.cpp:30:8: note: no corresponding friend here
+
// CHECK: 4 warnings generated.
OpenPOWER on IntegriCloud