Commit Graph

955 Commits

Author SHA1 Message Date
Dmitri Gribenko 0035372bb7 libclang: add clang_getTypeSpelling(CXType CT)
Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.

llvm-svn: 175299
2013-02-15 21:15:49 +00:00
Dmitri Gribenko 6b8fca1275 libclang: remove reinterpret_casts by using SourceLocation::getFromPtrEncoding
directly instead of casting a pointer to an integer

llvm-svn: 175206
2013-02-14 20:07:36 +00:00
Bill Wendling 41529c13c4 Use 'RC_XBS' instead of 'RC_BUILDIT' to catch all times when it's built in the Apple way.
llvm-svn: 175070
2013-02-13 19:44:17 +00:00
Argyrios Kyrtzidis 5d47a9b253 [libclang] Fix annotation of a range where the begin or end location
is inside a macro argument.

Previously we would give up and not annotate anything in the range.
rdar://11891550

llvm-svn: 175062
2013-02-13 18:33:28 +00:00
Dmitri Gribenko efbbd1e90c libclang: use CXCursor getters to simplify code
llvm-svn: 174809
2013-02-09 14:12:09 +00:00
Argyrios Kyrtzidis a2ed813afd [libclang] Attribute visitation happens out-of-source-order, make sure
we annotate properly when there is an attribute and not skip type specs
if the attribute is after the declaration.

rdar://13129077

llvm-svn: 174689
2013-02-08 01:12:25 +00:00
Dmitri Gribenko 0b62f8a632 libclang: reduce CXString abuse
ContainerUSR is not really a CXString, but it should own the underlying memory
buffer.  Thus, it is better to change the type to std::string.  This will not
introduce extra copying overhead, since the workaround that is being removed
was already making a copy.

llvm-svn: 174647
2013-02-07 19:09:22 +00:00
NAKAMURA Takumi 288c42e936 libclang: CursorVisitor::VisitBuiltinTypeLoc(): Add OCLSampler. [-Wswitch]
llvm-svn: 174606
2013-02-07 12:47:42 +00:00
Guy Benyei 610541989a Add OpenCL samplers as Clang builtin types and check sampler related restrictions.
llvm-svn: 174601
2013-02-07 10:55:47 +00:00
Dmitri Gribenko 2aedfbd177 Comment to XML conversion: replace string comparison with command ID comparison
llvm-svn: 174290
2013-02-03 17:48:05 +00:00
Dmitri Gribenko 18aa3bb819 libclang: wrap CXString implementation into 'namespace cxstring'
This removes quite a few 'cxstring::' qualifications where they are obvious.

llvm-svn: 174286
2013-02-03 13:54:26 +00:00
Dmitri Gribenko 7489521eec libclang: remove 'using namespace cxstring'
llvm-svn: 174285
2013-02-03 13:52:47 +00:00
Dmitri Gribenko bf7bf10d45 libclang: migrate IndexingDeclVisitor to ConstDeclVisitor
llvm-svn: 174284
2013-02-03 13:42:20 +00:00
Dmitri Gribenko d73f73b0dd libclang: remove unneeded const_cast
llvm-svn: 174283
2013-02-03 13:26:20 +00:00
Dmitri Gribenko 82700578d4 libclang: migrate USRGenerator to ConstDeclVisitor
llvm-svn: 174281
2013-02-03 13:21:23 +00:00
Dmitri Gribenko dd7dacfff9 libclang: remove unneeded const_casts
llvm-svn: 174280
2013-02-03 13:19:54 +00:00
Dmitri Gribenko 2f23e9c520 libclang: introduce cxstring::{createRef,createDup} for StringRefs
Also migrate all clients from the old API.

llvm-svn: 174263
2013-02-02 02:19:29 +00:00
Dmitri Gribenko 3c66b0be90 libclang: introduce cxstring::{createRef,createDup} for C strings
Also migrate all clients from the old API.

llvm-svn: 174238
2013-02-02 00:02:12 +00:00
Dmitri Gribenko 2e72dd4a43 Comment parsing: improve the fidelity of XML output for many block commands
This change introduces a 'kind' attribute for the <Para> tag, that captures the
kind of the parent block command.

For example:

\todo Meow.

used to be just <Para>Meow.</Para>, but now it is
<Para kind="todo">Meow.</Para>

llvm-svn: 174216
2013-02-01 20:23:57 +00:00
Dmitri Gribenko 946aca8524 libclang: document the purpose of createNull()
llvm-svn: 174195
2013-02-01 16:38:41 +00:00
Dmitri Gribenko 74f3e1e028 libclang: add comments for CXStringFlag
llvm-svn: 174194
2013-02-01 16:36:31 +00:00
Dmitri Gribenko 36a6dd04ef libclang: itroduce cxstring::createEmpty()
llvm-svn: 174174
2013-02-01 14:21:22 +00:00
Dmitri Gribenko f98dfbae94 libclang: introduce cxstring::createNull()
llvm-svn: 174173
2013-02-01 14:13:32 +00:00
Fariborz Jahanian 1a0cf80533 [Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511

llvm-svn: 174109
2013-01-31 23:12:39 +00:00
Evgeniy Stepanov 8660623576 Attempt to fix Windows build breakage.
llvm-svn: 174060
2013-01-31 14:27:38 +00:00
Douglas Gregor 0a0e2b3631 Allow the computation of the base priority for a declaration code completion result to consider the completion context
llvm-svn: 174037
2013-01-31 04:52:16 +00:00
Dmitri Gribenko b95b3f128b libclang: refactor CXStringPool: make it a class
We are not exposing the pool or string buffers to libclang users, so no need to
maintain a procedural interface.

llvm-svn: 173595
2013-01-26 22:44:19 +00:00
Dmitri Gribenko 183436e5b6 libclang: type safety for CXTranslationUnitImpl::CIdx
llvm-svn: 173590
2013-01-26 21:49:50 +00:00
Dmitri Gribenko ba82fea336 libclang: type safety for CXTranslationUnitImpl::FormatContext
llvm-svn: 173589
2013-01-26 21:39:50 +00:00
Dmitri Gribenko d36209e308 libclang: some type safety for CXTranslationUnitImpl's internals
There is no reason to store pointers as 'void*' in CXTranslationUnitImpl, since
it does not affect libclang ABI.

llvm-svn: 173588
2013-01-26 21:32:42 +00:00
Dmitri Gribenko c22ea1ce88 libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)
into a getter cxtu::getASTUnit(TU)

llvm-svn: 173585
2013-01-26 18:53:38 +00:00
Dmitri Gribenko a169118854 libclang: make getCursorParentDecl() return 'const Decl *'
llvm-svn: 173584
2013-01-26 18:12:08 +00:00
Dmitri Gribenko e4baea61b5 libclang: change getCursorAttr() to return 'const Attr *'
llvm-svn: 173583
2013-01-26 18:08:08 +00:00
Dmitri Gribenko e835406cd7 libclang: make getCursorStmt() and getCursorExpr() return const pointers
Also change EnqueueVisitor to use ConstStmtVisitor as a consequence.

llvm-svn: 173577
2013-01-26 15:29:08 +00:00
Argyrios Kyrtzidis ac08b26611 [libclang] Introduce clang_getFileUniqueID which returns a struct
for a CXFile containing device/inode/modification time.

Intended to be useful as a key associated with a unique file across
an indexing session.

rdar://13091837

llvm-svn: 173559
2013-01-26 04:52:52 +00:00
Dmitri Gribenko d15bb30dba libclang: change return type of getCursorDecl() to 'const Decl *'
llvm-svn: 173278
2013-01-23 17:25:27 +00:00
Dmitri Gribenko f930448bf6 Remove uneeded casts
llvm-svn: 173269
2013-01-23 15:56:07 +00:00
Bill Wendling e4e2e59740 Explicitly cast away the const-ness instead of doing it implicitly.
llvm-svn: 173241
2013-01-23 08:58:23 +00:00
Bill Wendling eade362f30 Explicitly cast away the const-ness instead of doing it implicitly.
llvm-svn: 173232
2013-01-23 08:25:41 +00:00
Guy Benyei 1b4fb3e08b Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
2013-01-20 12:31:11 +00:00
Chris Lattner 0e6c940d2c update to use the new BitcodeCursor readRecord that takes a StringRef blob parameter,
and adopt "advance" in more places.

llvm-svn: 172951
2013-01-20 02:38:54 +00:00
Sean Silva f1b49e237f Nuke SetUpBuildDumpLog.
Also, it was the only reason that `argc` and `argv` were being passed
into createDiagnostics, so remove those parameters and clean up callers.

llvm-svn: 172945
2013-01-20 01:58:28 +00:00
Chris Lattner c79fcfaf8e random tidying
llvm-svn: 172920
2013-01-19 21:35:35 +00:00
Chris Lattner 5b25f0b7a9 update header comment.
llvm-svn: 172909
2013-01-19 18:47:35 +00:00
Chris Lattner 5b313e7b2a this depends on the bitcode reader, since it is using it.
llvm-svn: 172905
2013-01-19 18:24:13 +00:00
Chandler Carruth 4b41745e05 Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

llvm-svn: 172892
2013-01-19 08:09:44 +00:00
Argyrios Kyrtzidis da4ba87181 [libclang] In clang_reparseTranslationUnit_Impl, move the check whether TU is
null before using it.

llvm-svn: 172632
2013-01-16 18:13:00 +00:00
Argyrios Kyrtzidis fbd7c2d3b2 [libclang] In clang_getCursorType, don't crash if the translation unit is not
set on the cursor; return a null type in such a case.

llvm-svn: 172625
2013-01-16 17:04:31 +00:00
David Greene e6c9fe035d Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172565
2013-01-15 22:09:51 +00:00
David Greene 02b002ac37 Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172564
2013-01-15 22:09:49 +00:00