summaryrefslogtreecommitdiff
path: root/test/Modules/merge-using-decls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Test] NFC: Fixed typo in commentsCharles Li2017-03-011-3/+3
| | | | | | | Changed "declerations" to "declarations" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296648 91177308-0d34-0410-b5e6-96231b3b80d8
* [Test] Make Lit tests C++11 compatible #10Charles Li2017-02-241-0/+13
| | | | | | | Differential Revision: https://reviews.llvm.org/D21626 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296193 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r295421, new ODR checker for modules, to fix build bot.Richard Trieu2017-02-171-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295427 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A slightly weaker form of ODR checking than previous attempts, but hopefully won't break the modules build bot. Future work will be needed to catch all cases. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295421 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r295284: Add better ODR checking for modules.Richard Trieu2017-02-161-4/+0
| | | | | | | Fix modules build bot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295293 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-02-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit r293585 that was reverted in r293611 with new fixes. The previous issue was determined to be an overly aggressive AST visitor from forward declared objects. The visitor will now only deeply visit certain Decl's and only do a shallow information extraction from all other Decl's. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295284 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r293585 "Add better ODR checking for modules."Sam McCall2017-01-311-4/+0
| | | | | | | | | | | We're seeing what we believe are false positives. (It's hard to tell with the available diagnostics, and I'm not sure how to reduce them yet). I'll send Richard reproduction details offline. djasper/chandlerc suggested this should be a warning for now, to make rolling it out feasible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-01-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taked from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293585 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r246497 (and dependent changes r246524 and r246521), reverted inRichard Smith2015-09-011-0/+2
| | | | | | | | | | | | | | | | | | | | r246546, with a workaround for an MSVC 2013 miscompile and an MSVC 2015 rejects-valid. Original commit message: [modules] Rework serialized DeclContext lookup table management. Instead of walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246582 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r246497 (which requires also reverting r246524 and r246521 to ↵Aaron Ballman2015-09-011-2/+0
| | | | | | | | | | | avoid merge conflicts). It broke the build on MSVC 2015. It also broke an MSVC 2013 bot with testing issues. llvm\tools\clang\lib\serialization\MultiOnDiskHashTable.h(117): error C2065: 'Files': undeclared identifier http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/2917 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246546 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Preserve DeclID order when merging lookup tables to give a moreRichard Smith2015-09-011-1/+1
| | | | | | | | | predictable diagnostic experience. The hash-of-DeclID order we were using before gave different results on Win32 due to a different predefined declaration of __builtin_va_list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246521 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Rework serialized DeclContext lookup table management. Instead ofRichard Smith2015-08-311-1/+3
| | | | | | | | | | | | | | walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246497 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-2/+2
| | | | | | | | | | | | | | We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239789 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Merging for class-scope using-declarations.Richard Smith2014-10-141-0/+69
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219657 91177308-0d34-0410-b5e6-96231b3b80d8