summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* CursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive ↵Ted Kremenek2010-11-171-10/+7
| | | | | | algorithm. llvm-svn: 119437
* Fix source-range information for Objective-C properties. Previously,Douglas Gregor2010-11-172-4/+28
| | | | | | | | | | | | 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
* MSVC doesn't like the noinline attribute at the end of a declaration. Try ↵Benjamin Kramer2010-11-161-1/+1
| | | | | | the other side. llvm-svn: 119349
* Rework USR generation from CXCursors to use CXStringBufsTed Kremenek2010-11-161-20/+42
| | | | | | | | | | | for the backing of generated USRs. This optmizes for the case when a client generates a sequence of USRs in sequence, disposing of them soon after generating them. By using a string buffer, we recycle malloc'ed memory instead of constantly malloc'ing and copying strings. llvm-svn: 119338
* Change CXTranslationUnit to not directly cast to an ASTUnit*,Ted Kremenek2010-11-1611-188/+308
| | | | | | | | | | | | | | | | | | | but to wrap both an ASTUnit and a "string pool" that will be used for fast USR generation. This requires a bunch of mechanical changes, as there was a ton of code that assumed that CXTranslationUnit and ASTUnit* were the same. Along with this change, introduce CXStringBuf, which provides an llvm::SmallVector<char> backing for repeatedly generating CXStrings without a huge amount of malloc() traffic. This requires making some changes to the representation of CXString by renaming a few fields (but keeping the size of the object the same). llvm-svn: 119337
* Add CXString.cpp and CXString.hTed Kremenek2010-11-162-0/+100
| | | | llvm-svn: 119322
* Move CXString creation/management routines intoTed Kremenek2010-11-169-53/+7
| | | | | | | their own .cpp file and make the interpretation of its flags private. llvm-svn: 119319
* CursorVisitor: cache worklists created for data-recursion to reduce malloc() ↵Ted Kremenek2010-11-151-3/+26
| | | | | | traffic. llvm-svn: 119290
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+1
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Use LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).Ted Kremenek2010-11-151-1/+2
| | | | llvm-svn: 119287
* Cast pointers instead of returning a new value within RunVisitorWorkList().Ted Kremenek2010-11-151-14/+16
| | | | llvm-svn: 119282
* Annotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.Ted Kremenek2010-11-151-1/+1
| | | | | | | Clang currently uses a ridiculous amount of stack space when inlining this function, which can lead to premature stack overflows. llvm-svn: 119281
* "Fix" some unintentional fallout from convertingTed Kremenek2010-11-142-4/+13
| | | | | | | | | | | | | | | | | | | | the Stmt* visitation in CursorVisitor to be data-recursive. Since AnnotationTokensWorker explicitly calls CursorVisitor::VisitChildren(), it essentially transforms the data-recursive algorithm in CursorVisitor back into a non-data recursive one. This is particularly bad because the data-recursive algorithm uses more stack space per stack frame, which can cause us to blow the stack in some cases. "Fix" this by making the stack that AnnotationTokensWorker runs in really huge. The real fix is to modify AnnotationTokensWorker not to do the explicit recursive call. llvm-svn: 119047
* CursorVisitor: make data-recursion algorithm the default except for the few ↵Ted Kremenek2010-11-141-73/+22
| | | | | | | | remaining Exprs still covered by the normal recursive visitation. llvm-svn: 119030
* Remove stale #include.Ted Kremenek2010-11-141-3/+0
| | | | llvm-svn: 119028
* Rewrite reverse iteration loop in a more natural countdown manner.Ted Kremenek2010-11-131-4/+2
| | | | llvm-svn: 118990
* CursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to ↵Ted Kremenek2010-11-131-26/+19
| | | | | | data-recursive algorithm. llvm-svn: 118989
* CursorVisitor: special-case CompoundStmt in data-recursion algorithm so we ↵Ted Kremenek2010-11-131-0/+7
| | | | | | | | don't have to enqueue its children and then reverse them. llvm-svn: 118986
* CursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr ↵Ted Kremenek2010-11-131-21/+19
| | | | | | to data-recursive algorithm. llvm-svn: 118964
* CursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.Ted Kremenek2010-11-131-25/+28
| | | | llvm-svn: 118961
* CursorVisitor: migrate GotoStmt to data-recursive algorithm.Ted Kremenek2010-11-131-5/+9
| | | | llvm-svn: 118960
* CursorVisitor: migrate DeclStmt over to data-recursive algorithm.Ted Kremenek2010-11-131-47/+62
| | | | llvm-svn: 118957
* CursorVisitor: Convert logic for populating data-recursion worklist from a ↵Ted Kremenek2010-11-131-119/+107
| | | | | | switch statement to a StmtVisitor. No functionality change. llvm-svn: 118956
* Use dyn_cast result instead of re-casting. Fixes -Werror build with:Nick Lewycky2010-11-121-1/+1
| | | | | | /llvm/tools/clang/tools/libclang/CIndex.cpp:1823: error: unused variable 'E' [-Wunused-variable] llvm-svn: 118947
* CursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion ↵Ted Kremenek2010-11-121-13/+18
| | | | | | algorithm. llvm-svn: 118934
* CursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.Ted Kremenek2010-11-121-9/+6
| | | | llvm-svn: 118933
* CursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to ↵Ted Kremenek2010-11-121-40/+45
| | | | | | data-recursion algorithm. llvm-svn: 118929
* CursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.Ted Kremenek2010-11-121-14/+43
| | | | llvm-svn: 118928
* CursorVisitor: add data-recursion support for InitListExprs.Ted Kremenek2010-11-121-23/+27
| | | | llvm-svn: 118927
* CursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to ↵Ted Kremenek2010-11-121-34/+22
| | | | | | data-recursion algorithm. llvm-svn: 118912
* CursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion ↵Ted Kremenek2010-11-121-20/+13
| | | | | | worklist. llvm-svn: 118911
* CursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.Ted Kremenek2010-11-121-18/+19
| | | | llvm-svn: 118910
* CursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general ↵Ted Kremenek2010-11-121-80/+45
| | | | | | data-recursion algorithm. llvm-svn: 118909
* Make sure to always check the result ofDouglas Gregor2010-11-121-1/+1
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* Modify CursorVisitor to also walks CXXOperatorCallExprs using ↵Ted Kremenek2010-11-111-15/+17
| | | | | | data-recursion. Fixes <rdar://problem/8659019>. llvm-svn: 118853
* Annotate tokens in a separate thread to avoid blowing out stack space. ↵Ted Kremenek2010-11-111-1/+16
| | | | | | | | | | While the CursorVisitor is gradually becoming more data recursive, AnnotateTokensVisitor does its own recursive call within the visitor that can still blow out the stack. This can potentially be reworked to avoid this, but for now just do token annotation on a separate thread. llvm-svn: 118783
* Generalize data-recursive visitation in CursorVisitor to also handle MemberExprsTed Kremenek2010-11-111-119/+175
| | | | | | | and CXXCallMemberExprs. This scheme is hopefully general enough to extend to the rest of the visitor if necessary. llvm-svn: 118782
* Improve ASTUnit's capture of diagnostics so that theDouglas Gregor2010-11-111-1/+1
| | | | | | | | | | 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
* Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to ↵Argyrios Kyrtzidis2010-11-101-1/+1
| | | | | | | | avoid leaking memory. Fixes rdar://8649963. llvm-svn: 118674
* ntroduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor2010-11-094-8/+56
| | | | | | | | | | | | | | location where we're spelling a token even within a macro. clang_getInstantiationLocation() tells where we instantiated the macro. I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs, since they gloss over macro-instantiation information. Take 2: this time, adjusted tests appropriately and used a "simple" approach to the spelling location. llvm-svn: 118495
* Revert r118492, which didn't update all of its tests accordinglyDouglas Gregor2010-11-094-47/+8
| | | | llvm-svn: 118494
* Introduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor2010-11-094-8/+47
| | | | | | | | | | | location where we're spelling a token even within a macro. clang_getInstantiationLocation() tells where we instantiated the macro. I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs, since they gloss over macro-instantiation information. llvm-svn: 118492
* c-index-test: Be available on Cygwin by using Win32's logic.NAKAMURA Takumi2010-11-091-1/+12
| | | | llvm-svn: 118479
* Add CursorVisitor::VisitBinaryOperator() to explicitly handle the case where ↵Ted Kremenek2010-11-081-0/+90
| | | | | | | | | we can blow out the stack due to deeply nested BinaryOperators. This is done by turning the explicit recursion into being data recursive. Fixes: <rdar://problem/8289205> llvm-svn: 118444
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-2/+2
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* Teach clang_getCursorReferenced() that aDouglas Gregor2010-11-051-0/+12
| | | | | | | | CXXConstructorExpr/CXXTemporaryObjectExpr references the constructor it calls. Then, tweak clang_getCursor() to prefer such a call over a type reference to the type being called. llvm-svn: 118297
* libclang: Enable requesting a larger stack for several libclang entry pointsDaniel Dunbar2010-11-051-1/+2
| | | | | | using "safety" threads. llvm-svn: 118278
* libclang: Add some support for running certain entry points in a "safety"Daniel Dunbar2010-11-053-4/+43
| | | | | | | thread, primarily to get a larger stack. - Yes, I feel dirty. llvm-svn: 118274
* Fix 80-col violas.Daniel Dunbar2010-11-051-9/+11
| | | | llvm-svn: 118273
* 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
OpenPOWER on IntegriCloud