aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/c-index-test/c-index-test.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-10serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek1-1/+154
via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. llvm-svn: 144269
2011-11-05[libclang] For "c-index-test -index-file", print out the names of the callbacks.Argyrios Kyrtzidis1-29/+39
llvm-svn: 143779
2011-11-03[libclang] Add missing return in clang_getExpansionLocation that resulted in ↵Argyrios Kyrtzidis1-1/+1
that function always returning a null file/line/column. Also add at least one use of clang_getExpansionLocation inside c-index-test that would have made the tests to catch that. llvm-svn: 143606
2011-11-03[libclang] For c-index-test disable caching of code completion results ifArgyrios Kyrtzidis1-0/+2
the CINDEXTEST_COMPLETION_NO_CACHING environment variable is present. llvm-svn: 143604
2011-10-28[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable ↵Argyrios Kyrtzidis1-2/+83
which, if set, will cause c-index-test to return as failed if a compiler error occurred. llvm-svn: 143243
2011-10-20[libclang] Don't use C++-style comments in c-index-test.c.Argyrios Kyrtzidis1-3/+3
llvm-svn: 142590
2011-10-18[libclang] Index implicit property references.Argyrios Kyrtzidis1-0/+5
llvm-svn: 142355
2011-10-18[libclang] When printing the diagnostic print it with a new line.Argyrios Kyrtzidis1-1/+1
llvm-svn: 142354
2011-10-17Try fixing MSVC compiler errors.Argyrios Kyrtzidis1-3/+9
llvm-svn: 142289
2011-10-17[libclang] Introduce a new high level API for indexing clients that assumesArgyrios Kyrtzidis1-0/+501
more of the work involved in indexing a translation unit and simplifies client implementations. Only C/ObjC for now, C++ (and comments) to come. llvm-svn: 142233
2011-10-14Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations toErik Verbruggen1-0/+17
retrieve annotations from completion string. llvm-svn: 141953
2011-10-06Fixed GCC (C90) and Clang warnings.Erik Verbruggen1-6/+3
llvm-svn: 141281
2011-10-06Added CXAvailability_NotAccessible to indicate that a declaration is ↵Erik Verbruggen1-0/+8
available, but not accessible from the current code completion context. llvm-svn: 141278
2011-10-06[libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,Argyrios Kyrtzidis1-9/+108
and a callback and finds all identifier references of the cursor in the file. rdar://7948304 llvm-svn: 141277
2011-09-26Don't map a file:line:col triplet that is inside the preamble range toArgyrios Kyrtzidis1-0/+11
a "loaded" location of the precompiled preamble. Instead, handle specially locations of preprocessed entities: -When looking up for preprocessed entities, map main file locations inside the preamble range to a preamble loaded location. -When getting the source range of a preprocessing cursor, map preamble loaded locations back to main file locations. Fixes rdar://10175093 & http://llvm.org/PR10999 llvm-svn: 140519
2011-09-12[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment ↵Argyrios Kyrtzidis1-1/+10
variable, which when set it determines the trial number after which the remapping of files should take effect. llvm-svn: 139511
2011-08-29Fix type mismatch in initialization (caught by -Wliteral-conversion)Matt Beaumont-Gay1-1/+1
llvm-svn: 138736
2011-08-04Add a new libclang API to return a CXCompletionString for an arbitraryDouglas Gregor1-0/+6
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>. llvm-svn: 136911
2011-07-26Add new libclang API, clang_codeCompleteGetObjCSelector(), whichDouglas Gregor1-1/+11
provides the partial Objective-C selector used in a code completion. From Connor Wakamo! llvm-svn: 136084
2011-07-25Added clang_getCursorReferenceNameRange to libclang to to retrieve parts ofDouglas Gregor1-12/+39
a cursor reference, from Erik Verbruggen! llvm-svn: 135920
2011-07-21New libclang API to expose container type for code completion, fromDouglas Gregor1-1/+23
Connor Wakamo! llvm-svn: 135651
2011-07-14NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth1-1/+1
This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
2011-07-07Introduce a new libclang aPI function,Douglas Gregor1-0/+78
clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! llvm-svn: 134615
2011-07-06MSVC doesn't like mixing declarations and statements in a C file.Francois Pichet1-2/+1
llvm-svn: 134550
2011-07-06libclang: Allow callers of clang_saveTranslationUnit() to distinguishDouglas Gregor1-3/+27
between different classes of errors. Addresses most of <rdar://problem/9660328>. llvm-svn: 134495
2011-05-13Add c-index-test printing and tests for static and virtual methodDouglas Gregor1-0/+5
query functions, from Erik Verbruggen! llvm-svn: 131295
2011-05-06Introduce a new libclang parsing flag,Douglas Gregor1-10/+13
CXTranslationUnit_NestedMacroInstantiations, which indicates whether we want to see "nested" macro instantiations (e.g., those that occur inside other macro instantiations) within the detailed preprocessing record. Many clients (e.g., those that only care about visible tokens) don't care about this information, and in code that uses preprocessor metaprogramming, this information can have a very high cost. Addresses <rdar://problem/9389320>. llvm-svn: 130990
2011-05-04Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),Douglas Gregor1-10/+16
which determines whether a particular file is actually a header that is intended to be guarded from multiple inclusions within the same translation unit. llvm-svn: 130808
2011-04-20Rename 'CXTUMemoryUsage…' to 'CXTUResourceUsage…'.Ted Kremenek1-3/+3
llvm-svn: 129857
2011-04-18Report memory usage for global code completion results in CXTUMemoryUsage.Ted Kremenek1-8/+7
llvm-svn: 129733
2011-04-18Unbreak the MSVC build: Don't mix variable declarations and statements in a ↵Francois Pichet1-2/+4
.c file. llvm-svn: 129732
2011-04-18Add libclang API to query how much memory is used by a CXTranslationUnit. ↵Ted Kremenek1-4/+32
This is a WIP. Currently we report the amount used for expressions, types, identifiers, and selectors. llvm-svn: 129730
2011-03-09c-index-test.c: Fix cygwin warning not to pass signed char to islower(c).NAKAMURA Takumi1-1/+1
Cygwin's ctype.h says; /* These macros are intentionally written in a manner that will trigger a gcc -Wall warning if the user mistakenly passes a 'char' instead of an int containing an 'unsigned char'. (snip) */ llvm-svn: 127308
2011-02-03If any Fix-Its attached to a diagnostic have invalid source locationsDouglas Gregor1-1/+1
or source locations that refer into a macro instantiation, delete all of the Fix-Its on that diagnostic. llvm-svn: 124833
2011-01-31Teach Diagnostic::setClient() to free the existing, ownedDouglas Gregor1-0/+2
client. Fixes a libclang leak. llvm-svn: 124614
2011-01-27Teach ASTUnit to save the specified target features, sinceDouglas Gregor1-1/+1
TargetInfo::CreateTargetInfo() mangles the target options in a way that is not idempotent. Fixes <rdar://problem/8807535>. llvm-svn: 124382
2011-01-27Add libclang functions to determine the const/volatile/restrictDouglas Gregor1-0/+6
qualifiers on a CXType. Patch from Stefan Seefeld, test by me. llvm-svn: 124377
2010-11-30De-C99-ify for loopDouglas Gregor1-1/+2
llvm-svn: 120395
2010-11-30Teach c-index-test to reparse the source file a few times when testingDouglas Gregor1-17/+36
clang_getCursor() via -cursor-at=??? and CINDEXTEST_EDITING is set in the environment. This mirrors how we test code completion and source-loading in the presence of this environment variable. llvm-svn: 120392
2010-11-19Extend the libclang diagnostic API to provide information about theDouglas Gregor1-1/+2
option name, category ID, and category name corresponding to a diagnostic. llvm-svn: 119802
2010-11-16Change CXTranslationUnit to not directly cast to an ASTUnit*,Ted Kremenek1-3/+3
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
2010-11-16Move CXString creation/management routines intoTed Kremenek1-3/+3
their own .cpp file and make the interpretation of its flags private. llvm-svn: 119319
2010-11-15Tweak libclang's heuristics for building precompiled preambles andDouglas Gregor1-0/+5
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
2010-11-09ntroduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor1-22/+22
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
2010-11-09Revert r118492, which didn't update all of its tests accordinglyDouglas Gregor1-22/+22
llvm-svn: 118494
2010-11-09Introduce clang_getSpellingLocation() into libclang, to provide theDouglas Gregor1-22/+22
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
2010-11-04Adjust return type of thread_runner.Benjamin Kramer1-2/+1
llvm-svn: 118259
2010-11-04c-index-test: Switch to using clang_executeOnThread instead of mucking aboutDaniel Dunbar1-27/+1
with system specific stuff. llvm-svn: 118224
2010-10-27Add an environment variable that allows us to turn off threading in c-index-testDouglas Gregor1-0/+3
llvm-svn: 117449
2010-10-20Extend the preprocessing record and libclang with support forDouglas Gregor1-0/+7
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