summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* When writing a module file, pass the module through to the ASTDouglas Gregor2011-11-302-7/+5
| | | | | | writer. No functionality change. llvm-svn: 145479
* Teach the preprocessor how to handle module import declarations thatDouglas Gregor2011-11-301-0/+8
| | | | | | | involve submodules (e.g., importing std.vector), rather than always importing the top-level module. llvm-svn: 145478
* When loading a module that involves submodules (e.g., std.vector),Douglas Gregor2011-11-301-82/+150
| | | | | | | | | check whether the named submodules themselves are actually valid, and drill down to the named submodule (although we don't do anything with it yet). Perform typo correction on the submodule names when possible. llvm-svn: 145477
* Switch the module-loading interfaces and parser from a simpleDouglas Gregor2011-11-301-10/+14
| | | | | | | top-level module name to a module path (e.g., std.vector). We're still missing a number of pieces for this actually to do something. llvm-svn: 145462
* Eliminate the -emit-module option, which emitted a module by parsing aDouglas Gregor2011-11-292-4/+1
| | | | | | | source file (e.g., a header). Immediately steal this useful option name for building modules from a module map file. llvm-svn: 145444
* Switch on-demand module building over to use module maps, always. WhenDouglas Gregor2011-11-291-72/+46
| | | | | | | we infer the module map, we'll just print the module map to a temporary file and generate the module using that. llvm-svn: 145436
* Teach the module import mechanism how to rebuild modules expressed viaDouglas Gregor2011-11-291-8/+64
| | | | | | | module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. llvm-svn: 145415
* Start refactoring to use module maps when rebuilding a moduleDouglas Gregor2011-11-291-12/+15
| | | | | | on-the-fly. No functionality change. llvm-svn: 145414
* Initialize NumWarningsInPreamble in ASTUnit's constructor, for safety.Argyrios Kyrtzidis2011-11-291-0/+1
| | | | llvm-svn: 145412
* Silence GCC warnings, RefCountedBase is meant to be default-initialized here.Benjamin Kramer2011-11-291-1/+2
| | | | llvm-svn: 145396
* Add a couple more GCC versions to C++ search paths for MinGW. Patch by ↵Eli Friedman2011-11-281-0/+2
| | | | | | | | Ruben Van Boxem. (We should probably start doing some sort of autodetection like we do on Linux at some point.) llvm-svn: 145326
* When attempting to load a module that is not in the module cache,Douglas Gregor2011-11-281-7/+7
| | | | | | | | return the module itself (in the module map) rather than returning the umbrella header used to build the module. While doing this, make sure that we're inferring modules for frameworks to build that module. llvm-svn: 145310
* Add missing equals.Benjamin Kramer2011-11-281-2/+3
| | | | llvm-svn: 145290
* [libclang] Indexing API: If the client requested to get a CXTranslationUnit ↵Argyrios Kyrtzidis2011-11-282-8/+37
| | | | | | | | after indexing, honor all the TU options. llvm-svn: 145229
* [libclang] Indexing API: Capture diagnostics during indexing.Argyrios Kyrtzidis2011-11-281-2/+3
| | | | llvm-svn: 145228
* Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS XRafael Espindola2011-11-261-1/+1
| | | | | | and linux. llvm-svn: 145142
* [libclang] Fix operations (token annotation, getting cursor, etc.) with a ↵Argyrios Kyrtzidis2011-11-231-0/+7
| | | | | | | | | | | | | | | file region inside an objc container that "contains" other file-level declarations. When getting the array of file-level declarations that overlap with a file region, we failed to report that the region overlaps with an objc container, if the container had other file-level declarations declared lexically inside it. Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST and handling them appropriately. llvm-svn: 145109
* implement __has_feature(address_sanitizer); also use ↵Kostya Serebryany2011-11-221-3/+3
| | | | | | LangOpts.AddressSanitizer instead of CodeGenOpts.AddressSanitizer llvm-svn: 145054
* Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the sameRichard Smith2011-11-211-1/+7
| | | | | | | | | | | | | semantics and defaults as the corresponding g++ arguments. The historical g++ argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions no longer document that option. Add -cc1 argument -fconstexpr-depth N to implement the corresponding functionality. The -ftemplate-depth=N part of this fixes PR9890. llvm-svn: 145045
* Delete the depfile if we could not open a header file. We cannotPeter Collingbourne2011-11-211-28/+36
| | | | | | generate any reasonable depfile if a header is missing. llvm-svn: 145019
* Refine placement of LangOptions object in CompilerInvocation by adding a new ↵Ted Kremenek2011-11-181-4/+3
| | | | | | baseclass CompilerInvocationBase with a custom copy constructor. This ensures that whenever the CompilerInvocation object's copy constructor is used we always clone the LangOptions object. llvm-svn: 144973
* Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis2011-11-183-4/+8
| | | | | | parsing or false to abort parsing. llvm-svn: 144943
* Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek2011-11-173-10/+26
| | | | | | | | | | | | | | | | | object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. llvm-svn: 144930
* Simplify crash cleanup logic in ASTUnit::LoadFromCommandLine() by zeroing ↵Ted Kremenek2011-11-171-7/+2
| | | | | | out two IntrusiveRefCnt pointers after we have assigned their respective values into fields of ASTUnit. llvm-svn: 144929
* Add -f[no-]address-sanitizer flagKostya Serebryany2011-11-161-0/+3
| | | | llvm-svn: 144800
* When building a module from a module map that isn't simply an umbrellaDouglas Gregor2011-11-161-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
* [libclang] Fix crash on invalid code. Fixes rdar://10451854Argyrios Kyrtzidis2011-11-161-0/+3
| | | | llvm-svn: 144766
* Switch some more of the modules tests over to "-emit-module-from-map",Douglas Gregor2011-11-161-2/+0
| | | | | | and remove stray fprintf. llvm-svn: 144742
* Add support for building a module from a module map to the -cc1Douglas Gregor2011-11-162-0/+96
| | | | | | | interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
* Revert r144703. It was a dumb idea anyway; will add the new bits moreDouglas Gregor2011-11-152-45/+6
| | | | | | incrementally with a new frontend action. llvm-svn: 144723
* Split GenerateModuleAction into its own action, which will startDouglas Gregor2011-11-152-6/+45
| | | | | | differing from GeneratePCHAction fairly soon. llvm-svn: 144703
* Add a -cc1-level option -fmodule-name=<name>, which will be used whenDouglas Gregor2011-11-152-3/+7
| | | | | | building modules. llvm-svn: 144680
* Typo.Chad Rosier2011-11-151-5/+5
| | | | llvm-svn: 144672
* Fix a regression from 143657. The second pass of the warning options should ↵Chad Rosier2011-11-151-2/+3
| | | | | | | | | | | only be emitting warnings/errors for unknown warning options. getDiagnosticsInGroup returns false if the diagnostics is found and true otherwise. Thus, if we're reporting and we have a valid diagnostic, we were actually setting the flag and causing mayhem. rdar://10444207 llvm-svn: 144670
* Warning option typo correction: When two options have the same edit_distance ↵Benjamin Kramer2011-11-151-14/+18
| | | | | | | | don't display either. Also add a maximum edit distance threshold, so we don't correct "-Wx" to "-W#pragma-messages". llvm-svn: 144644
* Remove extra ';'.Devang Patel2011-11-151-1/+1
| | | | llvm-svn: 144604
* Print a typo correction hint for unknown warning flags.Benjamin Kramer2011-11-141-3/+8
| | | | | | | $ clang -Wololo t.c warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option] llvm-svn: 144591
* I predict that HeaderSearch will need the ability to generateDouglas Gregor2011-11-112-2/+4
| | | | | | diagnostics in the future. Make it so. llvm-svn: 144347
* serialized diagnostics: simplify code.Benjamin Kramer2011-11-101-5/+1
| | | | llvm-svn: 144277
* serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek2011-11-101-9/+26
| | | | | | | | via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. llvm-svn: 144269
* serialized diagnostics: serialize the version info in a separate meta block.Ted Kremenek2011-11-081-20/+31
| | | | llvm-svn: 144115
* ASTConsumer::handleTopLevelDecl will end up getting called forDouglas Gregor2011-11-071-1/+4
| | | | | | function template instantiations. Fixes <rdar://problem/10398005> / PR11312. llvm-svn: 143984
* Rip out one of the features I added for the driver-include-management.Chandler Carruth2011-11-071-8/+3
| | | | | | | | | | | | | | | | We don't actually need a separate flag for non-sysrooted paths as the driver has to manage the sysroot anyways. The driver is not infrequently adding paths to the header search based on their existence on the filesystem. For that, it has to add the sysroot anyways, we should pass it on down to CC1 already joined. More importantly, the driver cannot in all cases distinguish between sysrooted paths and paths that are relative to the Clang binary's installation directory. Essentially, we always need to ignore the system root for these internal header search options. It turns out in most of the places we were already providing the system root in the driver, and then another one in CC1 so this fixes several bugs. llvm-svn: 143917
* Move the Linux header searching from the Frontend to the Driver. This isChandler Carruth2011-11-051-274/+7
| | | | | | | | | | | | | | | | the first (and diff-noisiest) step to making Linux header searching tremendously more principled and less brittle. Note that this step should have essentially no functional impact. We still search the exact same set of paths in the exact same order. The only change here is where the code implementing such a search lives. This has one obvious negative impact -- we now pass a ludicrous number of flags to the CC1 layer. That should go away as I re-base this logic on the logic to detect a GCC installation. I want to do this in two phases so the bots can tell me if this step alone breaks something, and so that the diffs of the refactoring make more sense. llvm-svn: 143822
* Fix a significant oversight in my move of MSVC includes to the driver:Chandler Carruth2011-11-051-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | actually manage the builtin header file includes as well as the system ones. This one is actually debatable whether it belongs in the driver or not, as the builtin includes are really an internal bit of implementation goop for Clang. However, they must be included at *exactly* the right point in the sequence of header files, which makes it essentially impossible to have this be managed by the Frontend and the rest by the Driver. I have terrible ideas that would "work", but I think they're worse than putting this in the driver and making the Frontend library even more ignorant of the environment and system on which it is being run. Also fix the fact that we weren't properly respecting the flags which suppress standard system include directories. Note that this still leaves all of the Clang tests which run CC1 directly and include builtin header files broken on Windows. I'm working on a followup patch to address that. llvm-svn: 143801
* Add two flags to the CC1 layer that I was hoping to avoid. We need toChandler Carruth2011-11-052-6/+21
| | | | | | | | | | | | | | | | | | | | encode the *exact* semantics which the header search paths internally built by the Frontend layer have had, which is both non-user-provided, and at times adding the implicit extern "C" bit to the directory entry. There are lots of CC1 options that are very close, but none do quite this, and they are all already overloaded for other purposes. In some senses this makes the command lines more clean as it clearly indicates which flags are exclusively used to implement internal detection of "standard" header search paths. Lots of the implementation of this is really crufty, due to the surrounding cruft. It doesn't seem worth investing lots of time cleaning this up as it isn't new, and hopefully *lots* of this code will melt away as header search inside of the frontend becomes increasingly trivial. llvm-svn: 143798
* serialized diagnostics: include FixIt information in serialized diagnostics.Ted Kremenek2011-11-051-6/+41
| | | | llvm-svn: 143776
* serialized diagnostics: pull emission of filenames into diagnostic block.Ted Kremenek2011-11-051-81/+56
| | | | llvm-svn: 143765
* serialized diagnostics: pull emission of diagnostic flag string into ↵Ted Kremenek2011-11-051-65/+62
| | | | | | diagnostics block. llvm-svn: 143764
* Serialized diagnostics: pull category name serialization into diagnostic ↵Ted Kremenek2011-11-051-24/+33
| | | | | | blocks. The goal is to remove BLOCK_STRINGS so that the bitcode file can potentially be streamed. llvm-svn: 143763
OpenPOWER on IntegriCloud