aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-11-15[modules] Use a memory buffer directly as input for the module includes,Argyrios Kyrtzidis1-13/+5
instead of messing with virtual files. llvm-svn: 168062
2012-10-10[modules] Consistently construct a buffer as input to build the module.Argyrios Kyrtzidis1-82/+42
This means the main file for modules will always be a virtual one. llvm-svn: 165591
2012-10-05[Modules] Introduce Module::TopHeaders which is a set of top-level headersArgyrios Kyrtzidis1-3/+8
that are associated with a (sub)module. llvm-svn: 165279
2012-07-31Added -ast-list option to dump filterable AST decl node names.Alexander Kornienko1-0/+5
llvm-svn: 161040
2012-07-26Added -ast-dump-filter option to clang -cc1.Alexander Kornienko1-2/+2
llvm-svn: 160784
2012-06-15Documentation cleanup: escape # in a Doxygen comment.James Dennett1-1/+1
llvm-svn: 158554
2012-04-13Remove the -cc1-level option "-pubnames-dump". Such things should stayDouglas Gregor1-72/+0
out of the tree and use the tooling infrastructure. llvm-svn: 154668
2012-03-27Introduce a -cc1-level option -pubnames-dump, which simply dumps theDouglas Gregor1-0/+72
list of identifiers that that 'public' names at the end of the translation unit, e.g., defined macros or identifiers with top-level names, in sorted order. Meant to support <rdar://problem/10921596>. llvm-svn: 153522
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-1/+1
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-03Frontend: Don't automatically create missing directories when using ↵Daniel Dunbar1-1/+2
temporary files with createOutputFile() - This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories. llvm-svn: 151960
2012-02-05Basic: import SmallString<> into clang namespaceDylan Noblesmith1-6/+6
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
2012-02-02Back out my heinous hack that tricked the module generation mechanismDouglas Gregor1-39/+26
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-31Split compiler builtin module into "stdlib" builtins and "intrinsic"Douglas Gregor1-26/+39
builds, and bring mm_alloc.h into the fold. Start playing some tricks with these builtin modules to mirror the include_next tricks that the headers already perform. llvm-svn: 149434
2012-01-30Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor1-1/+1
target-specific module requirements. llvm-svn: 149224
2012-01-29Rework HeaderSearch's interface for getting a module from a name andDouglas Gregor1-1/+2
for getting the name of the module file, unifying the code for searching for a module with a given name (into lookupModule()) and separating out the mapping to a module file (into getModuleFileName()). No functionality change. llvm-svn: 149197
2012-01-27Introduce module attributes into the module map grammar, along with aDouglas Gregor1-2/+4
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-20Extract the (InputKind, std::string) pair used to describe inputs toDouglas Gregor1-4/+4
the front end into its own class, FrontendInputFile, to make it easier to introduce new per-input data. No functionality change. llvm-svn: 148546
2012-01-05When generating includes for all of the headers we found in anDouglas Gregor1-3/+13
umbrella directory, skip includes for any headers that are part of an unavailable module. llvm-svn: 147572
2012-01-04Store the submodules of a module in source order, as they are storedDouglas Gregor1-4/+3
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-1/+15
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-12When we have an umbrella directory in a module map, recursively walkDouglas Gregor1-1/+2
the subdirectories to find headers in submodules. llvm-svn: 146398
2011-12-08Implement umbrella directories for modules, which are similar toDouglas Gregor1-0/+23
umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
2011-12-08Within the module representation, generalize the notion of an umbrellaDouglas Gregor1-15/+20
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-06When building the main file to parse given a module map, don't skipDouglas Gregor1-19/+24
explicit submodules or umbrella headers from submodules. Instead, build the entire module at once, and let the name-hiding mechanisms hide the contents of explicit submodules at load time. llvm-svn: 145940
2011-11-30Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor1-2/+2
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
2011-11-30When writing a module file, pass the module through to the ASTDouglas Gregor1-5/+3
writer. No functionality change. llvm-svn: 145479
2011-11-29Eliminate the -emit-module option, which emitted a module by parsing aDouglas Gregor1-1/+1
source file (e.g., a header). Immediately steal this useful option name for building modules from a module map file. llvm-svn: 145444
2011-11-16When building a module from a module map that isn't simply an umbrellaDouglas Gregor1-9/+95
header, create our own in-memory buffer to parse all of the appropriate headers, and use that to build the module. This isn't end-to-end testable yet; that's coming next. llvm-svn: 144797
2011-11-16Switch some more of the modules tests over to "-emit-module-from-map",Douglas Gregor1-2/+0
and remove stray fprintf. llvm-svn: 144742
2011-11-16Add support for building a module from a module map to the -cc1Douglas Gregor1-0/+93
interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
2011-11-15Revert r144703. It was a dumb idea anyway; will add the new bits moreDouglas Gregor1-39/+1
incrementally with a new frontend action. llvm-svn: 144723
2011-11-15Split GenerateModuleAction into its own action, which will startDouglas Gregor1-1/+39
differing from GeneratePCHAction fairly soon. llvm-svn: 144703
2011-09-23Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!Douglas Gregor1-2/+43
llvm-svn: 140435
2011-09-01Modules hide macro definitions by default, so that silly things likeDouglas Gregor1-1/+2
include guards don't show up as macro definitions in every translation unit that imports a module. Macro definitions can, however, be exported with the intentionally-ugly #__export_macro__ directive. Implement this feature by not even bothering to serialize non-exported macros to a module, because clients of that module need not (should not) know that these macros even exist. llvm-svn: 138943
2011-08-25Remove the Chaining argument from the PCH/module generator. It's no longer usedDouglas Gregor1-9/+3
llvm-svn: 138596
2011-08-25Introduce a -cc1 option "-emit-module", that creates a binary moduleDouglas Gregor1-2/+3
from the given source. -emit-module behaves similarly to -emit-pch, except that Sema is somewhat more strict about the contents of -emit-module. In the future, there are likely to be more interesting differences. llvm-svn: 138595
2011-08-25Make Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may beArgyrios Kyrtzidis1-1/+1
out-of-sync how a file is compiled. Patch by Matthias Kleine! llvm-svn: 138580
2011-07-28Cut down the number of open/close system calls for output files.Argyrios Kyrtzidis1-1/+3
For PCH files, have only one open/close for temporary + rename to be safe from race conditions. For all other output files open/close the output file directly. Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374. llvm-svn: 136315
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-14/+14
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-22Switch all of the "isysroot" const char*'s throughout the AST readerDouglas Gregor1-3/+4
and writer to StringRef or std::string, as appropriate. llvm-svn: 135769
2011-03-07Remove the AST printer (-ast-print-xml), which is too incomplete andDouglas Gregor1-7/+0
too low-level to actually be useful but is just interesting enough for people to try to use it (which won't actually work beyond toy examples). To bring back the AST printer, it needs to be: - Complete, covering all of C/C++/Objective-C - Documented, with appropriate Schema against which we can validate the output - Designed for C/C++/Objective-C, not Clang's specific ASTs - Stable across Clang versions - Well-tested llvm-svn: 127141
2011-02-17Eliminate the internal command-line option for viewing inheritance in C++ ↵Douglas Gregor1-5/+0
classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful llvm-svn: 125762
2011-02-15Allow resolving headers from a PCH even after headers+PCH were moved to ↵Argyrios Kyrtzidis1-2/+5
another path. Store in PCH the directory that the PCH was originally created in. If a header file is not found at the path that we expect it to be and the PCH file was moved from its original location, try to resolve the file by assuming that header+PCH were moved together and the header is in the same place relative to the PCH. llvm-svn: 125576
2011-01-31libclang: Don't allow RemoveFileOnSignal to be called via libclang, badness canDaniel Dunbar1-1/+4
ensue. llvm-svn: 124613
2010-12-01Driver, Frontend: add CUDA language supportPeter Collingbourne1-0/+1
llvm-svn: 120544
2010-11-24Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internalsJohn McCall1-0/+11
of the ASTs. Only available in assertions builds. No stability guarantee. This is intended solely as a debugging tool. I'm not sure if the goals are sufficiently aligned with the XML printer to allow a common implementation. Currently just falls back on the StmtDumper to display statements, which means it doesn't produce valid XML in those cases. llvm-svn: 120088
2010-11-23now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner1-2/+1
FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
2010-11-03Implement -working-directory.Argyrios Kyrtzidis1-1/+4
When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
2010-08-18Rename PCHWriter.h to ASTWriter.hSebastian Redl1-1/+1
llvm-svn: 111466
2010-08-17Reintroduce the serialization library, with fixed dependencies.Sebastian Redl1-1/+1
llvm-svn: 111279