summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* If we can't write the temporary module map file when compiling aDouglas Gregor2011-12-071-1/+2
| | | | | | module, at least have the decency to complain about it. llvm-svn: 146002
* Add a FIXME to provide a sensible error message hereDouglas Gregor2011-12-061-2/+3
| | | | llvm-svn: 145983
* Use absolute paths for temporary module map filesDouglas Gregor2011-12-061-1/+1
| | | | llvm-svn: 145973
* When building the main file to parse given a module map, don't skipDouglas Gregor2011-12-061-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
* Stack realignment is a tristate. Add -mno-stackrealign to turn off all stackNick Lewycky2011-12-061-1/+1
| | | | | | realignment, even with locals with alignment exceeding the ABI guarantee. llvm-svn: 145909
* Add -mstack-alignment=X and fix -mstackrealign handling now that theJoerg Sonnenberger2011-12-051-0/+5
| | | | | | backend options are gone. llvm-svn: 145868
* When we treat an #include or #import as a module import, create anDouglas Gregor2011-12-021-3/+13
| | | | | | | implicit ImportDecl in the translation unit to record the presence of the import. llvm-svn: 145727
* Introduce the notion of name visibility into modules. For a givenDouglas Gregor2011-12-011-3/+10
| | | | | | | | | | | | | | (sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). llvm-svn: 145586
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-303-10/+10
| | | | | | | | | 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
* Don't collide loop variable names (to appease GCC)Matt Beaumont-Gay2011-11-301-7/+6
| | | | llvm-svn: 145515
* Implement (de-)serialization of the description of a module and itsDouglas Gregor2011-11-301-26/+34
| | | | | | | | | submodules. This information will eventually be used for name hiding when dealing with submodules. For now, we only use it to ensure that the module "key" returned when loading a module will always be a module (rather than occasionally being a FileEntry). llvm-svn: 145497
* 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
OpenPOWER on IntegriCloud