summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] In ASTUnit::Parse copy the CompilerInvocation object instead ofArgyrios Kyrtzidis2011-09-121-16/+4
| | | | | | | | | | | | modifying directly for the preamble. This avoids an awful, hard to find, bug where "PreprocessorOpts.DisablePCHValidation = true" would be persistent for subsequent reparses of the translation unit which would result in defines, present in command-line but not in the PCH, being ignored. Fixes rdar://9615399. llvm-svn: 139512
* Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.Douglas Gregor2011-09-121-2/+4
| | | | | | | Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C exceptions are turned on. Fixes PR10910. llvm-svn: 139496
* Kill of the Decl::PCHLevel field entirely. We now only need to knowDouglas Gregor2011-09-101-7/+0
| | | | | | whether a Decl was deserialized from an AST file (any AST file). llvm-svn: 139438
* Treat the weak export of block runtime symbols as a deployment-targetJohn McCall2011-09-091-0/+3
| | | | | | | | feature akin to the ARC runtime checks. Removes a terrible hack where IR gen needed to find the declarations of those symbols in the translation unit. llvm-svn: 139404
* Extract the emission of the diagnostic's location into a separateChandler Carruth2011-09-071-103/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | function. This is really the beginning of the second phase of refactorings here. The end goal is to have (roughly) three interfaces: 1) Base class to format a single diagnostic suitable for display on the console. 2) Extension of the base class which also displays a caret diagnostic suitable for display on the console. 3) An adaptor that implements the DiagnosticClient by delegating to #1 and/or #2 as appropriate. Once we have these, things like libclang's formatDiagnostic can use #1 and #2 to provide really well formatted (and consistently formatted!) textual formatting of diagnostics. Getting there is going to be quite a bit of shuffling. I'm basically sketching out where the interface boundaries can be drawn for #1 and #2 within the existing classes. That lets me shuffle with a minimum of fuss and delta. Once that's done, and any of the related interfaces that need to change are updated, I'll hoist these into separate headers and re-implement libclang in terms of their interfaces. Long WIP, but comments at each step welcome. =D llvm-svn: 139228
* Move the HilightRange method from TextDiagnosticPrinter down toChandler Carruth2011-09-071-81/+79
| | | | | | | CaretDiagnostic. It's completely generic, with nothing to do with the diagnostic client or info APIs. llvm-svn: 139227
* Hoist the tab expansion into a helper function.Chandler Carruth2011-09-071-21/+25
| | | | llvm-svn: 139226
* Don't compute the same line number in two places, once inside a loop.Chandler Carruth2011-09-071-12/+8
| | | | llvm-svn: 139225
* Switch the CharSourceRange array to a small vector. The array wasChandler Carruth2011-09-071-39/+34
| | | | | | | | | | | | a stack array of a magical size with an assert() that we never overflowed it. That seems incredibly risky. We also have a very nice API for bundling up a vector we expect to usually have a small size without loss of functionality or security if the size is excessive. The fallout is to remove the last pointer+size parameter pair that are traced through the recursive caret diagnostic emission. llvm-svn: 139217
* Remove the doxyment for this now defunct parameter.Chandler Carruth2011-09-061-1/+0
| | | | llvm-svn: 139197
* Don't recompute the presumed loc twice in 5 lines of code... Spotted byChandler Carruth2011-09-061-1/+1
| | | | | | inspection. llvm-svn: 139196
* Use ArrayRef for the fixit hint array rather than a pointer and a size.Chandler Carruth2011-09-061-35/+34
| | | | | | | Clean up loops over the hints to use the more idiomatic iterator form in LLVM and Clang. llvm-svn: 139195
* Hoist the construction of the FixItHint line into a member function withChandler Carruth2011-09-061-64/+79
| | | | | | | | | | | | a defined interface. This isn't as nice as the previous one, but should get better as I push through better data types in all these functions. Also, I'm hoping to pull some aspects of this out into a common routine (such as tab expansion). Again, WIP, comments welcome as I'm going through. llvm-svn: 139190
* Add missing dependencyPeter Collingbourne2011-09-061-0/+1
| | | | | | Spotted by Ninja. llvm-svn: 139129
* Fix Lexer::ComputePreamble when MaxLines parameter is non-zero.Argyrios Kyrtzidis2011-09-041-1/+2
| | | | | | | | The function was only counting lines that included tokens and not empty lines, but MaxLines (mainly initiated to the line where the code-completion point resides) is a count of overall lines (even empty ones). llvm-svn: 139085
* Hoist the emission of parseable fixits into a helper method, simplifyingChandler Carruth2011-09-021-38/+38
| | | | | | and reducing indentation through the clever use of early exits. ;] llvm-svn: 139001
* Always construct an ASTReader with a non-NULL ASTContext andDouglas Gregor2011-09-022-8/+3
| | | | | | | | | Preprocessor, eliminating the constructor that was used by ASTUnit (which didn't provide an ASTContext or Prepreprocessor). Ensuring that both objects are non-NULL will simplify module loading (but none of that is done yet). llvm-svn: 138986
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-022-23/+26
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Allow the preprocessor to be constructed without performing target-Douglas Gregor2011-09-012-25/+40
| | | | | | | | and language-specific initialization. Use this to allow ASTUnit to create a preprocessor object *before* loading the AST file. No actual functionality change. llvm-svn: 138983
* Teach ASTContext and Preprocessor to hold on to references to the sameDouglas Gregor2011-09-011-6/+6
| | | | | | | | | LangOptions, rather than making distinct copies of LangOptions. Granted, LangOptions doesn't actually get modified, but this will eventually make it easier to construct ASTContext and Preprocessor before we know all of the LangOptions. llvm-svn: 138959
* Modules hide macro definitions by default, so that silly things likeDouglas Gregor2011-09-012-3/+5
| | | | | | | | | | | 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
* Create a CaretDiagnostic class to hold the logic for emittingChandler Carruth2011-08-311-263/+331
| | | | | | | | | | | | | | (unsurprisingly) caret diagnostics. This is designed to bring some organization to the monstrous EmitCaretDiagnostic function, and allow factoring it more easily and with less mindless parameter passing. Currently this just lifts the existing function into a method, and splits off the obviously invariant arguments to be class members. No functionality is changed, and there are still lots of warts to let existing code continue functioning as-is. Definitely WIP, more cleanups to follow. llvm-svn: 138921
* Sink all of the include stack printing logic into its member function.Chandler Carruth2011-08-311-18/+39
| | | | llvm-svn: 138920
* Switch the "no module found" default-fatal warning to a default-fatal error.Douglas Gregor2011-08-311-1/+1
| | | | llvm-svn: 138909
* 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
OpenPOWER on IntegriCloud