summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-256-15/+15
| | | | llvm-svn: 140479
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-2512-91/+96
| | | | llvm-svn: 140478
* Inline this method now that its completely trivial, and prepare forChandler Carruth2011-09-251-18/+9
| | | | | | hoisting parts of the text diagnostic. llvm-svn: 140477
* Shuffle some names around. 'CaretDiagnostic' is inaccurate as this needsChandler Carruth2011-09-251-18/+21
| | | | | | | to handle non-caret diagnostics as well in order to be fully useful in libclang etc. Also sketch out some more of my plans on this refactoring. llvm-svn: 140476
* Actually remove the members of CaretDiagnostic no longer in use forChandler Carruth2011-09-251-10/+6
| | | | | | | | tracking the start and stop of macro expansion suppression. Also remove the Columns variable which was just a convenience variable based on DiagOpts. Instead we materialize it in the one piece of code that cared. llvm-svn: 140475
* Sink the logic for suppressing some macro expansion notes from theChandler Carruth2011-09-251-41/+29
| | | | | | | | | | | | | | | | TextDiagnosticPrinter into the CaretDiagnostic class. Several interesting results from this: - This removes a significant per-diagnostic bit of state from the CaretDiagnostic class, which should eventually allow us to re-use the object. - It removes a redundant recursive walk of the macro expansion stack just to compute the depth. We don't need the depth until we're unwinding anyways, so we can just mark when we reach it. - It also paves the way for several simplifications we can do to how we implement the suppression. llvm-svn: 140474
* Split the recursive macro expansion walk out from the routine whichChandler Carruth2011-09-251-58/+71
| | | | | | emits a source snippet and caret line. llvm-svn: 140467
* Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!Douglas Gregor2011-09-231-2/+43
| | | | llvm-svn: 140435
* More missing header inclusions from llvm_unreachable migration.David Blaikie2011-09-232-0/+2
| | | | llvm-svn: 140369
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-234-7/+8
| | | | llvm-svn: 140367
* Reenable -cxx-isystem for Objective C++, until I come up with a better solutionBenjamin Kramer2011-09-231-1/+1
| | | | llvm-svn: 140365
* Add support for CPATH and friends.Benjamin Kramer2011-09-222-63/+35
| | | | | | | | | | | | This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there. The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs. Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend. I tried to match GCC's behavior as close as possible Fixes PR8971. llvm-svn: 140341
* In the OpenCL mode, the AltiVec mode must be off and checks must be strictTobias Grosser2011-09-211-2/+2
| | | | | | | | | | OpenCL is different from AltiVec in the way it supports vector literals. OpenCL is strict with regards to semantic checks. For example, implicit conversions and explicit casts between vectors of different types are disallowed. Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com> llvm-svn: 140270
* Remove __WCHAR_UNSIGNED__ and anything that used it.Eric Christopher2011-09-201-3/+0
| | | | llvm-svn: 140155
* In libclang, when visiting preprocessed entities in a source range, useArgyrios Kyrtzidis2011-09-191-61/+1
| | | | | | | | | | PreprocessingRecord's getPreprocessedEntitiesInRange. Also remove all the stuff that were added in ASTUnit that are unnecessary now that we do a binary search for preprocessed entities and deserialize only what is necessary. llvm-svn: 140063
* Introduce local_begin()/local_end() methods in PreprocessingRecord whichArgyrios Kyrtzidis2011-09-191-1/+1
| | | | | | return iterators for local, non-loaded, preprocessed entities. llvm-svn: 140062
* [libclang] When getting a source location from a file:line:col tripletArgyrios Kyrtzidis2011-09-192-7/+44
| | | | | | | check whether the requested location points inside the precompiled preamble, in which case the returned source location will be a "loaded" one. llvm-svn: 140060
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-191-3/+3
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* Do not use builtin includes if -fms-compatibility is specified. Some MSVC ↵Francois Pichet2011-09-191-1/+2
| | | | | | header files have the same name as clang's builtins, this creates clash. llvm-svn: 140009
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-173-5/+5
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* As per discussion with Doug Gregor on the IRC channel, introduce a new ↵Francois Pichet2011-09-171-0/+1
| | | | | | | | | | | | compiler switch: -fms-compatility. Microsoft specific tweaking will now fall into 2 categories: - fms-extension: Microsoft specific extensions that should never change the meaning of an otherwise well formed code. Currently map to LangOptions::Microsoft. (To be clearer, I am planning to change the name to LangOptions::MicrosoftExt). - fms-compatibility: Really a MSVC emulation mode. Map to LangOptions::MicrosoftMode. Can change the meaning of an otherwise standard conformant program. llvm-svn: 139978
* Add an experimental flag -fauto-module-import that automatically turnsDouglas Gregor2011-09-153-2/+10
| | | | | | | #include or #import direcctives of framework headers into module imports of the corresponding framework module. llvm-svn: 139860
* Comment what's going on when we compile a moduleDouglas Gregor2011-09-151-0/+8
| | | | llvm-svn: 139837
* Detect cyclic module dependencies in a manner that is rather moreDouglas Gregor2011-09-151-0/+23
| | | | | | graceful than running out of stack space. llvm-svn: 139833
* Eliminate the list of modules from the preprocessor options. This wasDouglas Gregor2011-09-151-24/+0
| | | | | | | used back when we had an -import-module command-line option, but it's no longer used (or useful). llvm-svn: 139829
* Eliminate the unused -create-module cc1-level optionDouglas Gregor2011-09-151-3/+0
| | | | llvm-svn: 139827
* When we load the first module, make sure that we wire up the ASTConsumer to ↵Douglas Gregor2011-09-151-0/+2
| | | | | | the newly-created ASTReader. This makes sure that CodeGen sees the declarations it is interested in llvm-svn: 139824
* [PCH] Overhaul how preprocessed entities are [de]serialized.Argyrios Kyrtzidis2011-09-151-2/+2
| | | | | | | | | | | | | -Use an array of offsets for all preprocessed entities -Get rid of the separate array of offsets for just macro definitions; for references to macro definitions use an index inside the preprocessed entities array. -Deserialize each preprocessed entity lazily, at first request; not in bulk. Paves the way for binary searching of preprocessed entities that will offer efficiency and will simplify things on the libclang side a lot. llvm-svn: 139809
* Make -E work with module importsDouglas Gregor2011-09-141-5/+11
| | | | llvm-svn: 139750
* Encode the module hash in base-36, to reduce the length of the strings a bitDouglas Gregor2011-09-141-2/+6
| | | | llvm-svn: 139696
* Assert that the module hash produced after stripping away non-modular ↵Douglas Gregor2011-09-131-3/+2
| | | | | | options is the same as the module hash before stripping those options. llvm-svn: 139663
* For modules, use a hash of the compiler version, language options, andDouglas Gregor2011-09-133-14/+96
| | | | | | | | | target triple to separate modules built under different conditions. The hash is used to create a subdirectory in the module cache path where other invocations of the compiler (with the same version, language options, etc.) can find the precompiled modules. llvm-svn: 139662
* When building a module on-demand, clear out the "non-modular" languageDouglas Gregor2011-09-131-0/+3
| | | | | | and preprocessor options (such as macro definitions) first. llvm-svn: 139638
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-132-13/+13
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* When compiling a module on-demand, re-use the diagnostics clientDouglas Gregor2011-09-132-16/+33
| | | | | | | | already provided. This required a little bit of clean-up in the way that VerifyDiagnosticsClient managed ownership of its underlying "primary" client, because now it will no longer always take ownership. llvm-svn: 139570
* When an import statement fails to find a module in the module cache,Douglas Gregor2011-09-121-2/+76
| | | | | | | | | but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. llvm-svn: 139558
* Introduce a cc1-level option to provide the path to the module cache,Douglas Gregor2011-09-123-9/+10
| | | | | | | | where the compiler will look for module files. Eliminates the egregious hack where we looked into the header search paths for modules. llvm-svn: 139538
* [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
OpenPOWER on IntegriCloud