summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Driver, Frontend: add CUDA language supportPeter Collingbourne2010-12-013-0/+10
| | | | llvm-svn: 120544
* Don't check the isysroot path for Path::isValid(); if the user hasDan Gohman2010-12-011-1/+0
| | | | | | | specified a syntactically invalid path, it's better to let the OS diagnose the problem than to silently skip it. llvm-svn: 120542
* Such function decls,as objc's objc_msgSend, builtins in Fariborz Jahanian2010-11-301-1/+1
| | | | | | | | | a specific language. We are adding such language info. by extensing Builtins.def and via a language flag added to LIBBUILTIN/BUILTIN and check for that when deciding a name is builtin or not. Implements //rdar://8689273. llvm-svn: 120429
* When using a precompiled preamble with detailed preprocessing records,Douglas Gregor2010-11-301-2/+68
| | | | | | | | | | trap the serialized preprocessing records (macro definitions, macro instantiations, macro definitions) from the generation of the precompiled preamble, then replay those when walking the list of preprocessed entities. This eliminates a bug where clang_getCursor() wasn't able to find preprocessed-entity cursors in the preamble. llvm-svn: 120396
* When loading a precompiled preamble, use the file ID of theDouglas Gregor2010-11-301-2/+5
| | | | | | | | | | | | precompiled preamble as the "main" source file's file ID within the source manager. This makes compiling with a precompiled preamble produce the same source locations as when compiling without the precompiled preamble; prior to this change, we ended up with different file IDs for source locations within the precompiled preamble vs. those after the precompiled preamble, even for entities (e.g., preprocessing entities) in the same file. llvm-svn: 120390
* Merge System into Support.Michael J. Spencer2010-11-297-12/+12
| | | | llvm-svn: 120297
* When performing code completion within ASTUnit, allocate the ↵Douglas Gregor2010-11-291-6/+6
| | | | | | AugmentedCodeCompleteConsumer on the heap, so it's always cleaned up properly llvm-svn: 120290
* Add GCC 4.4.5 for Gentoo, and order them in a more sensible way. This allowsChandler Carruth2010-11-281-13/+15
| | | | | | | | Gentoo systems with multiple versions to pick up the newest one first. This is especially important with Gentoo because some of the older versions are left on systems in strange states. llvm-svn: 120238
* Add C++ header path for openSUSE 11.4.Rafael Espindola2010-11-251-0/+7
| | | | | | Patch by İsmail Dönmez. llvm-svn: 120154
* Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internalsJohn McCall2010-11-243-0/+34
| | | | | | | | | | | | | of the ASTs. Only available in assertions builds. No stability guarantee. This is intended solely as a debugging tool. I'm not sure if the goals are sufficiently aligned with the XML printer to allow a common implementation. Currently just falls back on the StmtDumper to display statements, which means it doesn't produce valid XML in those cases. llvm-svn: 120088
* change the 'is directory' indicator to be a null-or-notChris Lattner2010-11-231-2/+3
| | | | | | | | | pointer that is passed down through the APIs, and make FileSystemStatCache::get be the one that filters out directory lookups that hit files. This also paves the way to have stat queries be able to return opened files. llvm-svn: 120060
* simplify the cache miss handling code, eliminating CacheMissing.Chris Lattner2010-11-231-8/+3
| | | | llvm-svn: 120038
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-231-13/+19
| | | | | | | its own header and giving it some more structure. No functionality change. llvm-svn: 120030
* tidy up. Split FileManager::getBufferForFile intoChris Lattner2010-11-231-3/+2
| | | | | | | | | | two copies, since they are fundamentally different operations and the StringRef one should go away (it shouldn't be part of FileManager at least). Remove some dead arguments. llvm-svn: 120013
* don't allow remapping PTH file paths with -fworking-directory, theChris Lattner2010-11-231-1/+1
| | | | | | client should just pass in absolute paths. llvm-svn: 120012
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-238-58/+38
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* give FileManager a 'FileSystemOptions' ivar, which will be usedChris Lattner2010-11-233-5/+5
| | | | | | | to simplify a bunch of code in it. It should ultimately get inlined into FileManager. llvm-svn: 120007
* Partially revert Doug's PCH validation patch (r98585).Chris Lattner2010-11-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | This patch completely defeated the "passing in a prestat'd size to MemoryBuffer" optimization, leading to an extra fstat call for every buffer opened, in order to find out if the datestamp and size of the file on disk matches what is in the stat cache. I fully admit that I don't completely understand what is going on here: why punish code when a stat cache isn't in use? what is the point of a stat cache if you have to turn around and stat stuff to validate it? To resolve both these issues, just drop the modtime check and check the file size, which is the important thing anyway. This should also resolve PR6812, because presumably windows is stable when it comes to file sizes. If the modtime is actually important, we should get it and keep it on the first stat. This eliminates 833 fstat syscalls when processing Cocoa.h, speeding up system time on -Eonly Cocoa.h from 0.041 to 0.038s. llvm-svn: 120001
* Several PPCallbacks take an SourceLocation + IdentifierInfo, ratherCraig Silverstein2010-11-191-10/+7
| | | | | | | | | | | than a Token that holds the same information all in one easy-to-use package. There's no technical reason to prefer the former -- the information comes from a Token originally -- and it's clumsier to use, so I've changed the code to use tokens everywhere. Approved by clattner llvm-svn: 119845
* Use hasErrorOccurred() instead of getNumErrors() where it makes sense.Argyrios Kyrtzidis2010-11-181-1/+1
| | | | llvm-svn: 119746
* Remove the hack where, to get the return status, we had special case for ↵Argyrios Kyrtzidis2010-11-182-18/+2
| | | | | | | | VerifyDiagnosticsClient and just check the number of errors from the DiagnosticClient. llvm-svn: 119736
* Since multiple diagnostics can share one diagnostic client, have the client ↵Argyrios Kyrtzidis2010-11-185-12/+13
| | | | | | | | keeping track of the total number of warnings/errors reported. llvm-svn: 119731
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-183-16/+25
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* -Rename -Wargument-larger-than -> -Wlarge-by-value-copyArgyrios Kyrtzidis2010-11-181-1/+1
| | | | | | | | | -Improve the diagnostic message -Add some comments Suggestions by Chris. llvm-svn: 119594
* Introduce option -Wargument-larger-than[=N] which warns about function ↵Argyrios Kyrtzidis2010-11-171-0/+2
| | | | | | | | | | definitions if they take by-value or return by-value any POD that is larger than some threshold (default is 64 bytes). Implements rdar://8548050. llvm-svn: 119583
* Fix source-range information for Objective-C properties. Previously,Douglas Gregor2010-11-171-0/+14
| | | | | | | | | | | | we were just getting a range covering only the property name, which is certainly not correct (and broke token annotation, among other things). Also, teach libclang about the relationship between @synthesize/@dynamic and @property, so we get property name and cursor-reference information for @synthesize and @dynamic. llvm-svn: 119409
* Use an OwningPtr for the preamble buffer in ASTUnit. This plugs a leakDouglas Gregor2010-11-161-15/+5
| | | | | | | where we failed to free this buffer along one of the paths, and detangles the code a little. llvm-svn: 119379
* Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!Nico Weber2010-11-161-0/+5
| | | | llvm-svn: 119348
* Remove an unintended restriction on sysroots introduced during the PathChandler Carruth2010-11-161-1/+1
| | | | | | conversion. llvm-svn: 119346
* Tweak libclang's heuristics for building precompiled preambles andDouglas Gregor2010-11-151-8/+3
| | | | | | | | caching global code-completion results. In particular, don't perform either operation the first time we parse, but do both after the first reparse. llvm-svn: 119285
* Fix a think-o. Fixes PR8606.Chandler Carruth2010-11-151-0/+1
| | | | llvm-svn: 119139
* Clean up some names and fix the handling of default sysroots on Windows andChandler Carruth2010-11-151-9/+12
| | | | | | | | | | | other platforms where the textual default of '/' isn't the system's root directory. We should probably still make the textual default platform specific, but this should avoid the particularly bad problem with the previous state: we applied a sysroot of '/' to '/usr/local/google' which added '//usr/local/include' to the windows header search path, a share on another machine named 'usr'. Oops. llvm-svn: 119131
* Switch the sysroot logic to use the Path interface, resolving a FIXME andChandler Carruth2010-11-151-10/+12
| | | | | | making the code less gross. llvm-svn: 119099
* Make sysroot only apply to baked in paths which start with a '/'.Chandler Carruth2010-11-151-10/+7
| | | | llvm-svn: 119095
* Make sure to always check the result ofDouglas Gregor2010-11-123-13/+41
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* Improve ASTUnit's capture of diagnostics so that theDouglas Gregor2010-11-112-44/+40
| | | | | | | | | | diagnostic-capturing client lives as long as the ASTUnit itself does. Otherwise, we can end up with crashes when we get a diagnostic outside of parsing/code completion. The circumstances under which this happen are really hard to reproduce, because a file needs to change from under us. llvm-svn: 118751
* make sure #pragma clang is treated the same way as #pragma gcc in -E mode,Chris Lattner2010-11-101-2/+3
| | | | | | unknown pragmas should just be passed through to the .i file. llvm-svn: 118659
* Simplify code.Benjamin Kramer2010-11-091-28/+10
| | | | llvm-svn: 118619
* Appeasing MSVC, take 3Douglas Gregor2010-11-091-0/+1
| | | | llvm-svn: 118493
* Try to appease MSVCDouglas Gregor2010-11-091-0/+4
| | | | llvm-svn: 118487
* Add missing includeDouglas Gregor2010-11-091-0/+1
| | | | llvm-svn: 118485
* sprintf -> snprintf conversion, from Vladimir KirillovDouglas Gregor2010-11-091-1/+1
| | | | llvm-svn: 118478
* Change the StringSet used by CalculateHiddenNames() to use a BumpPtrAllocator.Ted Kremenek2010-11-071-6/+6
| | | | llvm-svn: 118372
* Implement -working-directory.Argyrios Kyrtzidis2010-11-038-33/+94
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Add support for Fedora 14. Patch by Daniel Kozlowski.Rafael Espindola2010-11-021-0/+5
| | | | llvm-svn: 118035
* Teach SourceManager::getPresumedLoc() how to fail gracefully if ↵Douglas Gregor2010-11-021-1/+1
| | | | | | getLineNumber/getColumnNumber fail llvm-svn: 117990
* Disable some timing codeDouglas Gregor2010-11-011-1/+1
| | | | llvm-svn: 117910
* If Consumer object failed to create due to someFariborz Jahanian2010-10-291-0/+2
| | | | | | | user error, fail gracefully. Fixes pr8508. llvm-svn: 117692
* Simplify ASTUnit's internal timers, by not trying to keep a pile ofDouglas Gregor2010-10-281-66/+64
| | | | | | | | timers to be dumped whenever the ASTUnit is destroyed. Instead, just print the time elapsed for each operation after we perform the operation. llvm-svn: 117550
* Introduce libclang-level options for C++ precompiled preambles,Douglas Gregor2010-10-271-3/+14
| | | | | | separating out chaining precompiled preambles from non-chaining ones. llvm-svn: 117457
OpenPOWER on IntegriCloud