aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2010-11-17CursorVisitor: migrate handling ofTed Kremenek
VAArgExpr to data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17CursorVisitor: migrate handling ofTed Kremenek
CXXTypeidExpr to data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17CursorVisitor: migrate handling ofTed Kremenek
TypesCompatibleExpr to data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17CursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive ↵Ted Kremenek
algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17Fix source-range information for Objective-C properties. Previously,Douglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16MSVC doesn't like the noinline attribute at the end of a declaration. Try ↵Benjamin Kramer
the other side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Rework USR generation from CXCursors to use CXStringBufsTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Change CXTranslationUnit to not directly cast to an ASTUnit*,Ted Kremenek
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Add CXString.cpp and CXString.hTed Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Move CXString creation/management routines intoTed Kremenek
their own .cpp file and make the interpretation of its flags private. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15CursorVisitor: cache worklists created for data-recursion to reduce malloc() ↵Ted Kremenek
traffic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119290 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall
certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Use LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Tweak libclang's heuristics for building precompiled preambles andDouglas Gregor
caching global code-completion results. In particular, don't perform either operation the first time we parse, but do both after the first reparse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Cast pointers instead of returning a new value within RunVisitorWorkList().Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Annotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.Ted Kremenek
Clang currently uses a ridiculous amount of stack space when inlining this function, which can lead to premature stack overflows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14"Fix" some unintentional fallout from convertingTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14CursorVisitor: make data-recursion algorithm the default except for the few ↵Ted Kremenek
remaining Exprs still covered by the normal recursive visitation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14Remove stale #include.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Rewrite reverse iteration loop in a more natural countdown manner.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to ↵Ted Kremenek
data-recursive algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: special-case CompoundStmt in data-recursion algorithm so we ↵Ted Kremenek
don't have to enqueue its children and then reverse them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr ↵Ted Kremenek
to data-recursive algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: migrate GotoStmt to data-recursive algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: migrate DeclStmt over to data-recursive algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13CursorVisitor: Convert logic for populating data-recursion worklist from a ↵Ted Kremenek
switch statement to a StmtVisitor. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12Use dyn_cast result instead of re-casting. Fixes -Werror build with:Nick Lewycky
/llvm/tools/clang/tools/libclang/CIndex.cpp:1823: error: unused variable 'E' [-Wunused-variable] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion ↵Ted Kremenek
algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to ↵Ted Kremenek
data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: add data-recursion support for InitListExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to ↵Ted Kremenek
data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion ↵Ted Kremenek
worklist. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12CursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general ↵Ted Kremenek
data-recursion algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12Make sure to always check the result ofDouglas Gregor
SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11Modify CursorVisitor to also walks CXXOperatorCallExprs using ↵Ted Kremenek
data-recursion. Fixes <rdar://problem/8659019>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11Annotate tokens in a separate thread to avoid blowing out stack space. ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11Generalize data-recursive visitation in CursorVisitor to also handle MemberExprsTed Kremenek
and CXXCallMemberExprs. This scheme is hopefully general enough to extend to the rest of the visitor if necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11Improve ASTUnit's capture of diagnostics so that theDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to ↵Argyrios Kyrtzidis
avoid leaking memory. Fixes rdar://8649963. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09ntroduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09Revert r118492, which didn't update all of its tests accordinglyDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09Introduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09libclang and c-index-test can be built on Cygming.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09c-index-test: Be available on Cygwin by using Win32's logic.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08Add CursorVisitor::VisitBinaryOperator() to explicitly handle the case where ↵Ted Kremenek
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07Remove broken support for variadic templates, along with the variousDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118385 91177308-0d34-0410-b5e6-96231b3b80d8