summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
* Adjust return type of thread_runner.Benjamin Kramer2010-11-041-2/+1
| | | | llvm-svn: 118259
* c-index-test: Switch to using clang_executeOnThread instead of mucking aboutDaniel Dunbar2010-11-041-27/+1
| | | | | | with system specific stuff. llvm-svn: 118224
* libclang: Add clang_executeOnThread, for use in c-index-test (and only there,Daniel Dunbar2010-11-043-0/+7
| | | | | | preferably). Good thing c-index-test is written in C!!!! llvm-svn: 118223
* Implement -working-directory.Argyrios Kyrtzidis2010-11-033-7/+17
| | | | | | | | | | | | | | | | | | | 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
* Added cursor visitor that takes a block as an argument. Tested compilingDavid Chisnall2010-11-032-0/+36
| | | | | | | libclang with both clang -fblocks and gcc (no blocks support). Only exposed in the header to compilers that do have blocks support. llvm-svn: 118170
* Improve source-location information for CXXConstructExpr nodes, byDouglas Gregor2010-11-031-1/+28
| | | | | | | | | ensuring that they cover all of their child nodes. There's still a clang_getCursor()-related issue with CXXFunctionalCastExprs with CXXConstructExprs as children (see FIXME in the test case); I'll look at that separately. llvm-svn: 118132
* Don't add Decls with an invalid location to DeclsInContainer.Ted Kremenek2010-11-021-1/+2
| | | | llvm-svn: 118111
* Hack to workaround deficiency in ObjC ASTs. Functions and variables may be ↵Ted Kremenek2010-11-021-27/+121
| | | | | | | | | | | declared within an @implementation, but we have no way to record that information in the AST. This may cause CursorVisitor to miss these Decls when doing a AST walk. Fixes <rdar://problem/8595462>. llvm-svn: 118109
* Encapsulate within CXCursor the notion of whether a VarDecl* is the first ↵Ted Kremenek2010-11-013-7/+47
| | | | | | | | | | | | Decl in a DeclGroup. We use this to recover some context that is currently not modeled directly in the AST. Currently VarDecl's cannot properly determine their source range because they have no context on whether or not they appear in a DeclGroup. For the meantime, this bandaid suffices in libclang since that is where the correct SourceRange is directly needed. Fixes <rdar://problem/8595749>. llvm-svn: 117973
* Do not compare invalid source locationsDouglas Gregor2010-11-011-6/+5
| | | | llvm-svn: 117946
* Turns out that we may end up calling dladdr on GetExecutablePath, give it ↵Benjamin Kramer2010-10-301-2/+1
| | | | | | external linkage to make sure the lookup works on all platforms. llvm-svn: 117813
* This function doesn't need external linkage either.Benjamin Kramer2010-10-301-1/+2
| | | | llvm-svn: 117786
* Remove old CrashTracer cruft from CIndex.Ted Kremenek2010-10-291-89/+1
| | | | llvm-svn: 117634
* Introduce libclang-level options for C++ precompiled preambles,Douglas Gregor2010-10-271-2/+9
| | | | | | separating out chaining precompiled preambles from non-chaining ones. llvm-svn: 117457
* Add an environment variable that allows us to turn off threading in c-index-testDouglas Gregor2010-10-271-0/+3
| | | | llvm-svn: 117449
* Teach clang_getCursorReferenced() and friends about BlockDeclRefExprs.Douglas Gregor2010-10-221-0/+4
| | | | llvm-svn: 117167
* Improve the implementation of libclang's token-annotation logic forDouglas Gregor2010-10-211-15/+69
| | | | | | | | | | | | | | | | | entities in the preprocessing record. Previously, we would only end up getting the first token of a preprocessing record annotated correctly. For example, given #include "foo.h" we would only get the '#' annotated as an inclusion directive; the 'include' and '"foo.h"' tokens would be given the general 'processing directive' annotation. Now, we get proper annotations for entities in the preprocessing record. llvm-svn: 117001
* Extend the preprocessing record and libclang with support forDouglas Gregor2010-10-206-4/+60
| | | | | | | | | inclusion directives, keeping track of every #include, #import, etc. in the translation unit. We keep track of the source location and kind of the inclusion, how the file name was spelled, and the underlying file to which the inclusion resolved. llvm-svn: 116952
* Call clang_disposeTokens() when we are done with the set of tokens.Ted Kremenek2010-10-201-0/+1
| | | | llvm-svn: 116946
* Introduce code completion results for Objective-C methods, both whenDouglas Gregor2010-10-181-6/+52
| | | | | | | | | declaring methods and when sending messages to them, by bringing all of the selector into TypedCheck chunks in the completion result. This way, we can improve the sorting of these results to account for the full selector name rather than just the first chunk. llvm-svn: 116746
* Do not use absolute path on the clang++ symlink.Oscar Fuentes2010-10-181-3/+5
| | | | | | Based on a patch by Ryuta Suzuki! llvm-svn: 116695
* Use a script for creating the clang++ executable.Oscar Fuentes2010-10-172-2/+19
| | | | | | | The previous method used the DESTDIR environment variable at configure time, but sometimes it is only available at install time. See PR8397. llvm-svn: 116689
* Tweak scan-build to work with naked clang commands.Ted Kremenek2010-10-161-0/+2
| | | | llvm-svn: 116651
* Add clang_getLocationForOffset() to libclang, for gives a source location ↵David Chisnall2010-10-153-0/+23
| | | | | | from a character index into a file. llvm-svn: 116587
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-1/+0
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Don't claim that things that are Objective-C keywords if preceded by an @ ↵David Chisnall2010-10-131-1/+3
| | | | | | | | | | are keywords unless they are preceded by an @. For example, don't claim that end is a keyword in: unsigned end; llvm-svn: 116439
* Call InitSections when assembling. This makes clang's output match that ofRafael Espindola2010-10-131-0/+1
| | | | | | llvm-mc. llvm-svn: 116405
* This patch remove the Win32 XFAIL from remap-complete.cFrancois Pichet2010-10-122-2/+3
| | | | | | The problem was that text files were open in text mode and Microsoft implementation of fread and write will try to do nasty line-feed conversion which make the line position no longer valid. The fix is to read and write files in binary mode. llvm-svn: 116286
* When we load an ASTUnit from command-line arguments, hold on to theDouglas Gregor2010-10-121-6/+2
| | | | | | | | | diagnostics produced by the driver itself. Previously, we were allowing these to either be dropped or to slip through to stderr. Fixes <rdar://problem/7595339>. llvm-svn: 116285
* Eliminate CIndexer::getClangPath(), since libclang no longer dependsDouglas Gregor2010-10-112-41/+18
| | | | | | | | | | | on the presence of a 'clang' executable. Simplify CIndexer::getClangResourcesPath() a bit. Patch up the CMake makefiles to install headers into two locations in the build tree, for those silly cases where 'clang' will end up looking into the wrong build directory for headers. llvm-svn: 116260
* Eliminate -fdiagnostics-binary and all of the infrastructure forDouglas Gregor2010-10-112-73/+0
| | | | | | | | emitting diagnostics in a binary form to be consumed by libclang, since libclang no longer does any of its work out-of-process, making this code dead. Besides, this stuff never worked at 100% anyway. llvm-svn: 116250
* Eliminate clang_codeComplete(). libclang clients should be using theDouglas Gregor2010-10-113-295/+0
| | | | | | faster, in-process, more-configurable clang_codeCompleteAt(). llvm-svn: 116245
* Switch c-index-test from clang_codeComplete() over toDouglas Gregor2010-10-112-34/+65
| | | | | | | | | | clang_codeCompleteAt(). This uncovered a few issues with the latter: - ASTUnit wasn't saving/restoring diagnostic state appropriately between reparses and code completions. - "Overload" completions weren't being passed through to the client llvm-svn: 116241
* Eliminate clang_setUseExternalASTGeneration() from libclang. BetweenDouglas Gregor2010-10-115-234/+53
| | | | | | | | | improvements to the compiler and the introduction of crash recovery, it no longer makes sense to allow this mode. Moreover, this eliminates one use of the "clang" executable from within libclang; we'd like them all to go away. llvm-svn: 116207
* Fix the mapping of vertical-space cursor kinds to produce a newline,Douglas Gregor2010-10-082-4/+6
| | | | | | rather than a space. llvm-svn: 116097
* libclang: Disable LLVM pretty stack trace functionality, which inadvertentlyDaniel Dunbar2010-10-081-0/+5
| | | | | | sets up signal handlers it shouldn't when we are being used a shared library. llvm-svn: 116084
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | following amusing sequence: - AST writing schedules writing a type X* that it had never seen before - AST writing starts writing another declaration, ends up deserializing X* from a prior AST file. Now we have two type IDs for the same type! - AST writer tries to write X*. It only has the lower-numbered ID from the the prior AST file, so references to the higher-numbered ID that was scheduled for writing go off into lalaland. To fix this, keep the higher-numbered ID so we end up writing the type twice. Since this issue occurs so rarely, and type records are generally rather small, I deemed this better than the alternative: to keep a separate mapping from the higher-numbered IDs to the lower-numbered IDs, which we would end up having to check whenever we want to deserialize any type. Fixes <rdar://problem/8511624>, I think. llvm-svn: 115647
* Introduce a new libclang function, clang_getCursorDisplayName(), whichDouglas Gregor2010-10-024-2/+98
| | | | | | | | produces a simple "display" name that captures the arguments/parameters for a function, function template, class template, or class template specialization. llvm-svn: 115428
* Teach clang_getCursorType() about base specifiers and other referencesDouglas Gregor2010-10-021-15/+71
| | | | | | | | | | | to types. Also, teach clang_getTypeDeclaration() about template specializations, injected-class-names, and elaborated types. Fixes <rdar://problem/8506460>. llvm-svn: 115425
* Don't add -fno-spell-checking in libclang if a spell-checking-related ↵Douglas Gregor2010-10-021-3/+11
| | | | | | argument is already in the command-line arguments llvm-svn: 115420
* Provide proper source location and range information for C++ baseDouglas Gregor2010-10-021-4/+11
| | | | | | | specifier cursors in libclang. FIXME -=2, fixes the rest of <rdar://problem/8274883>. llvm-svn: 115419
* Teach clang_getCursorReferenced() about Objective-C property referenceDouglas Gregor2010-10-011-3/+9
| | | | | | and protocol expressions. Fixes <rdar://problem/7833565>. llvm-svn: 115346
* Extend libclang with an API that determines, given a C++ virtualDouglas Gregor2010-10-014-1/+133
| | | | | | | member function or an Objective-C method, which other member functions/methods it overrides. llvm-svn: 115338
* perform_code_completion(): fix type declaration for TU.Dawn Perchik2010-09-301-1/+1
| | | | llvm-svn: 115224
* c-index-test: Run inside a separate thread iff we have pthread support, toDaniel Dunbar2010-09-301-1/+55
| | | | | | | ensure we at least get some minimal testing of running in a multithreaded environment (for example, having a reduced stack size). llvm-svn: 115200
* Updated scan-build:Tom Care2010-09-301-12/+134
| | | | | | | | - Idempotent operations are on by default, to match --analyze in the driver. - Integrated stats calculation based on parsing warnings emitted with the -analyzer-stats flag. The new -stats flag enables this. - New -maxloop flag to pass down a maxloop value to the analyzer. llvm-svn: 115123
* Modified the ccc-analyzer script to print the compiler command when log ↵Tom Care2010-09-291-0/+3
| | | | | | level verbosity is enabled. This is handy for debugging. llvm-svn: 115109
* Enable caching of global code completion results in the suggestedDouglas Gregor2010-09-271-1/+2
| | | | | | libclang options for editing a translation unit. llvm-svn: 114810
* Teach libclang to enable multithreading in LLVM, since libclang clients are ↵Douglas Gregor2010-09-241-2/+14
| | | | | | likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients llvm-svn: 114760
* Add some missing concurrency checks into libclangDouglas Gregor2010-09-232-3/+9
| | | | llvm-svn: 114682
OpenPOWER on IntegriCloud