This website requires JavaScript.
Explore
Help
Sign In
maxjhandsome
/
llvm-project
forked from
OSchip/llvm-project
Watch
1
Star
0
Fork
You've already forked llvm-project
0
Code
Issues
Pull Requests
Packages
Releases
Wiki
Activity
39a76387e0
llvm-project
/
clang
/
test
/
Modules
/
Inputs
/
diamond_top.h
5 lines
41 B
C
Raw
Normal View
History
Unescape
Escape
Teach ModuleManager::addModule() to check whether a particular module has already been loaded before allocating a new Module structure. If the module has already been loaded (uniquing based on file name), then just return the existing module rather than trying to load it again. This allows us to load a DAG of modules. Introduce a simple test case that forms a diamond-shaped module graph, and illustrates that a source file importing the bottom of the diamond can see declarations in all four of the modules that make up the diamond. Note that this version moves the file-opening logic into the module manager, rather than splitting it between the module manager and the AST reader. More importantly, it properly handles the weird-but-possibly-useful case of loading an AST file from "-". llvm-svn: 138030
2011-08-19 10:29:29 +08:00
int
top
(
int
*
)
;
Introduce a module visitation function that starts at the top-level modules (those that no other module depends on) and performs a search over all of the modules, visiting a new module only when all of the modules that depend on it have already been visited. The visitor can abort the search for all modules that a module depends on, which allows us to minimize the number of lookups necessary when performing a search. Switch identifier lookup from a linear walk over the set of modules to this module visitation operation. The behavior is the same for simple PCH and chained PCH, but provides the proper search order for modules. Verified with printf debugging, since we don't have enough in place to actually test this. llvm-svn: 138187
2011-08-20 12:39:52 +08:00
int
top_left
(
char
*
c
)
;