summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Change err_pp_file_not_found back to an Error; when it's a Warning, we ↵Eli Friedman2011-08-301-8/+2
| | | | | | | | suppress it in system headers. And it is not a good idea to suppress it in system headers. (This was originally changed in r134996 to implement -MG.) Fixes <rdar://10041960>. And also brings down the number of warnings without a flag by one :) llvm-svn: 138842
* Some minor updates to the Linux search path handling for Slackware. Patch ↵Eli Friedman2011-08-291-0/+11
| | | | | | by Will Dietz. PR10692. llvm-svn: 138753
* objective-c: Treat top-level objective-c declarationsFariborz Jahanian2011-08-271-3/+1
| | | | | | | | | | , such as list of forward @class decls, in a DeclGroup node. Deal with its consequence throught clang. This is in preparation for more Sema work ahead. // rdar://8843851. Feel free to reverse if it breaks something important and I am unavailable. llvm-svn: 138709
* Remove the -import-module option. It's no longer usefulDouglas Gregor2011-08-271-15/+0
| | | | llvm-svn: 138681
* Introduce support for a simple module import declaration, whichDouglas Gregor2011-08-262-33/+81
| | | | | | | | | | | | | | | | | | | | | | loads the named module. The syntax itself is intentionally hideous and will be replaced at some later point with something more palatable. For now, we're focusing on the semantics: - Module imports are handled first by the preprocessor (to get macro definitions) and then the same tokens are also handled by the parser (to get declarations). If both happen (as in normal compilation), the second one is redundant, because we currently have no way to hide macros or declarations when loading a module. Chris gets credit for this mad-but-workable scheme. - The Preprocessor now holds on to a reference to a module loader, which is responsible for loading named modules. CompilerInstance is the only important module loader: it now knows how to create and wire up an AST reader on demand to actually perform the module load. - We search for modules in the include path, using the module name with the suffix ".pcm" (precompiled module) for the file name. This is a temporary hack; we hope to improve the situation in the future. llvm-svn: 138679
* [driver] Add -mglobal-merge/-mno-global-merge machine options to ↵Chad Rosier2011-08-261-0/+3
| | | | | | | | | enable/disable merging of globals during codegen. Fixes <rdar://problem/10017909>. llvm-svn: 138612
* Eliminate the -chained-pch flag and all of the frontend and libclang options ↵Douglas Gregor2011-08-252-16/+0
| | | | | | associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file llvm-svn: 138597
* Remove the Chaining argument from the PCH/module generator. It's no longer usedDouglas Gregor2011-08-252-16/+8
| | | | llvm-svn: 138596
* Introduce a -cc1 option "-emit-module", that creates a binary moduleDouglas Gregor2011-08-256-19/+22
| | | | | | | | | 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
* Make Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may beArgyrios Kyrtzidis2011-08-252-2/+4
| | | | | | out-of-sync how a file is compiled. Patch by Matthias Kleine! llvm-svn: 138580
* Reset FirstID (first diagnostic's file ID) to allow for invocations of the ↵Axel Naumann2011-08-241-1/+3
| | | | | | VerifyDiagnosticsClient on several input files. llvm-svn: 138434
* Implement '-Weverything', which enables all warnings except those explicitly ↵Ted Kremenek2011-08-181-0/+7
| | | | | | | | | | | | | | mapped to be ignored. Currently this includes -pedantic warnings as well; we'll need to consider whether these should be included. This works as expected with -Werror. Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into their own test file. llvm-svn: 137910
* In the AST file format, eliminate the CHAINED_METADATA record. Instead,Douglas Gregor2011-08-171-5/+0
| | | | | | | | | | | | | all AST files have a normal METADATA record that has the same form regardless of whether we refer to a chained PCH or any other kind of AST file. Introduce the IMPORTS record, which describes all of the AST files that are imported by this AST file, and how (as a module, a PCH file, etc.). Currently, we emit at most one entry to this record, to support chained PCH. llvm-svn: 137869
* Add Gentoo gcc 4.3.4 include pathsNico Weber2011-08-171-0/+4
| | | | llvm-svn: 137834
* [MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift implicitly ↵NAKAMURA Takumi2011-08-171-2/+1
| | | | | | converted to 64 bits (was 64-bit shift intended?)". llvm-svn: 137803
* Accept -x objc++-cpp-output as an alias for -x objective-c++-cpp-outputNico Weber2011-08-131-0/+1
| | | | | | | This is the ObjC++ version of r129201. It's for example needed to use ccache with clang. llvm-svn: 137560
* Wire up -import-module to run ReadAST for each module loaded.Jonathan D. Turner2011-08-052-1/+36
| | | | llvm-svn: 136987
* Add a new libclang API to return a CXCompletionString for an arbitraryDouglas Gregor2011-08-041-0/+4
| | | | | | cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>. llvm-svn: 136911
* When performing code completion after at @interface, allow bothDouglas Gregor2011-07-301-2/+2
| | | | | | | | already-defined and forward-declared results. Already-defined results are fine because they could be the start of a category. Fixes <rdar://problem/9811691>. llvm-svn: 136559
* On Darwin, libc++ may be installed alongside the compiler inDouglas Gregor2011-07-291-1/+17
| | | | | | | lib/c++/v1. Look there first, before falling back to the normal /usr/include/c++/v1. <rdar://problem/9866149> llvm-svn: 136507
* Really remove FlatStoreManager and BasicStoreManager, this time from the ↵Ted Kremenek2011-07-281-1/+1
| | | | | | driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge. llvm-svn: 136422
* Introduce the "-index-header-map" option, to give special semanticsDouglas Gregor2011-07-282-13/+40
| | | | | | | for quoted header lookup when dealing with not-yet-installed frameworks. Fixes <rdar://problem/9824020>. llvm-svn: 136331
* Cut down the number of open/close system calls for output files.Argyrios Kyrtzidis2011-07-283-29/+36
| | | | | | | | | 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
* Add template instantiations to the output of -ast-dump.Richard Trieu2011-07-281-1/+2
| | | | llvm-svn: 136306
* This patch extends the previous patch by starting to incorporate more ↵Jonathan D. Turner2011-07-261-1/+1
| | | | | | functionality, like lookup-by-name and exporting lookup tables, into the module manager. Methods now have documentation. A few more functions have been switched over to the new iterator style and away from manual/explicit iteration. Ultimately we want to move away from name lookup here, as symlinks make filenames not a safe unique value, but we use it here as a stopgap before better measures are in place (namely instead using FileEntry* from a global FileManager). llvm-svn: 136107
* Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation APIChandler Carruth2011-07-261-3/+3
| | | | | | to isMacroArgExpansion. llvm-svn: 136053
* Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2011-07-251-2/+2
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135969
* Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth2011-07-252-3/+3
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135965
* Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.Chandler Carruth2011-07-251-1/+1
| | | | llvm-svn: 135962
* Rename SourceManager::getImmediateInstantiationRange toChandler Carruth2011-07-251-2/+2
| | | | | | getImmediateExpansionRange. llvm-svn: 135960
* Pick up expected diagnostics not only in the main file but also in the file ↵Axel Naumann2011-07-251-9/+21
| | | | | | | | | where the first diagnostic occurred. Useful if the main file is not relevant (like with cling). By Vassil Vassilev. llvm-svn: 135936
* Rename SourceManager::getInstantiationRange to getExpansionRange.Chandler Carruth2011-07-251-2/+2
| | | | llvm-svn: 135915
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-252-6/+6
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-1/+1
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-2320-239/+239
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Remove prepending of '$' to module names.Jonathan D. Turner2011-07-221-2/+2
| | | | llvm-svn: 135775
* Switch all of the "isysroot" const char*'s throughout the AST readerDouglas Gregor2011-07-223-9/+11
| | | | | | and writer to StringRef or std::string, as appropriate. llvm-svn: 135769
* Rename ASTReader::PerFileData to serialization::Module, pulling it outDouglas Gregor2011-07-222-4/+5
| | | | | | | of ASTReader so it can become its own full-fledged class (eventually). No functionality change. llvm-svn: 135767
* For ASTUnit::Save, write the AST to a temporary and then rename it to the ↵Argyrios Kyrtzidis2011-07-211-4/+26
| | | | | | | | actual filename. Should avoid race conditions. Addresses rdar://9788943. llvm-svn: 135691
* Cut down one open/close pair of system calls by using Path's makeUnique ↵Argyrios Kyrtzidis2011-07-212-2/+2
| | | | | | instead of createTemporaryFileOnDisk. llvm-svn: 135690
* Rework the detailed preprocessing record to separate preprocessingDouglas Gregor2011-07-211-9/+1
| | | | | | | | | | | | | | | entities generated directly by the preprocessor from those loaded from the external source (e.g., the ASTReader). By separating these two sets of entities into different vectors, we allow both to grow independently, and eliminate the need for preallocating all of the loaded preprocessing entities. This is similar to the way the recent SourceManager refactoring treats FileIDs and the source location address space. As part of this, switch over to building a continuous range map to track preprocessing entities. llvm-svn: 135646
* [arcmt] Add some additional driver flags to optionally emit or save the ↵Argyrios Kyrtzidis2011-07-191-0/+10
| | | | | | | | | | | pre-migration ARC errors. -arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else -arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file rdar://9791454 llvm-svn: 135491
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-193-23/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN andAlexis Hunt2011-07-191-0/+3
| | | | | | | WCHAR_MAX in limits.h, thus solving the problem where the system header thinks it knows better. llvm-svn: 135455
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-181-2/+2
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* Do not modify string returned by getenv on Windows. Francois Pichet2011-07-161-4/+2
| | | | | | Fixes PR9875, patch by Nikola Smiljanic! llvm-svn: 135356
* Update the remaining comments in Frontend to 'expansion'.Chandler Carruth2011-07-141-2/+2
| | | | llvm-svn: 135150
* NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2011-07-142-8/+8
| | | | | | | | | | | | | | | | This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
* Switch all local code and comments from '[Ii]nstantiat(ion|ed)' toChandler Carruth2011-07-141-14/+14
| | | | | | | | '[Ee]xpan(sion|ded)' in the TextDiagnosticPrinter. No functionality changed. llvm-svn: 135136
* Switch the diagnostic messages about macros to use the terms 'expanded'Chandler Carruth2011-07-141-2/+2
| | | | | | | | | and 'expansions' rather than 'instantiated' and 'contexts'. This is the first of several patches migrating Clang's terminology surrounding macros from 'instantiation' to 'expansion'. llvm-svn: 135135
OpenPOWER on IntegriCloud