aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-14Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor1-0/+10
metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko1-6/+6
brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
2013-01-02s/CPlusPlus0x/CPlusPlus11/gRichard Smith1-1/+1
llvm-svn: 171367
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-3/+3
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-10-15Introduce the notion of excluded headers into the module mapDouglas Gregor1-0/+7
description. Previously, one could emulate this behavior by placing the header in an always-unavailable submodule, but Argyrios guilted me into expressing this idea properly. llvm-svn: 165921
2012-09-29In the Module class, add a reference to the corresponding AST file.Argyrios Kyrtzidis1-2/+2
llvm-svn: 164873
2012-02-02Back out my heinous hack that tricked the module generation mechanismDouglas Gregor1-0/+2
into using non-absolute system includes (<foo>)... ... and introduce another hack that is simultaneously more heineous and more effective. We whitelist Clang-supplied headers that augment or override system headers (such as float.h, stdarg.h, and tgmath.h). For these headers, Clang does not provide a module mapping. Instead, a system-supplied module map can refer to these headers in a system module, and Clang will look both in its own include directory and wherever the system-supplied module map suggests, then adds either or both headers. The end result is that Clang-supplied headers get merged into the system-supplied module for the C standard library. As a drive-by, fix up a few dependencies in the _Builtin_instrinsics module. llvm-svn: 149611
2012-01-30Introduce TargetInfo::hasFeature() to query various feature names inDouglas Gregor1-1/+5
each of the targets. Use this for module requirements, so that we can pin the availability of certain modules to certain target features, e.g., provide a module for xmmintrin.h only when SSE support is available. Use these feature names to provide a nearly-complete module map for Clang's built-in headers. Only mm_alloc.h and unwind.h are missing, and those two are fairly specialized at the moment. Finishes <rdar://problem/10710060>. llvm-svn: 149227
2012-01-30Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor1-5/+8
target-specific module requirements. llvm-svn: 149224
2012-01-27Introduce module attributes into the module map grammar, along with aDouglas Gregor1-4/+11
single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143
2012-01-17Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie1-1/+0
appropriate or when GCC requires it) llvm-svn: 148292
2012-01-04Store the submodules of a module in source order, as they are storedDouglas Gregor1-10/+33
in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
2011-12-31Implement support for module requirements, which indicate the languageDouglas Gregor1-0/+74
features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). llvm-svn: 147387
2011-12-08Tweak the syntax of umbrella headers, so that "umbrella" is treated asDouglas Gregor1-1/+6
a modifier for a header declarartion, e.g., umbrella header "headername" Collapse the umbrella-handling code in the parser into the header-handling code, so we don't duplicate the header-search logic. llvm-svn: 146159
2011-12-08Within the module representation, generalize the notion of an umbrellaDouglas Gregor1-1/+8
header to also support umbrella directories. The umbrella directory for an umbrella header is the directory in which the umbrella header resides. No functionality change yet, but it's coming. llvm-svn: 146158
2011-12-05Parse inferred submodules in module maps, track their contents inDouglas Gregor1-9/+22
Module, and (de-)serialize this information. Semantics of inferred submodules to follow. llvm-svn: 145864
2011-12-05Fix printing of wildcard exports.Douglas Gregor1-5/+14
llvm-svn: 145812
2011-12-05Implement support for wildcard exports in modules, allowing a moduleDouglas Gregor1-0/+12
to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. llvm-svn: 145811
2011-12-02Implement (de-)serialization of the set of exported modules in aDouglas Gregor1-0/+25
module map. llvm-svn: 145695
2011-11-30Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor1-0/+91
library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538