David Blaikie
6adc78e0df
Replace TypeLoc llvm::cast support to be well-defined.
...
The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).
Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.
llvm-svn: 175462
2013-02-18 22:06:02 +00:00
Dmitri Gribenko
7d09808818
libclang: don't store nul-terminated strings as StringRefs,
...
if the nul-terminatedness property is important for clients.
Also, don't return the same CXString multiple times. This did not create a
correctness issue in practice because the CXString was of an CXS_Unmanaged
kind, and destruction was a no-op.
llvm-svn: 175455
2013-02-18 19:50:38 +00:00
Dmitri Gribenko
19b79c8bf9
libclang: remove reinterpret_casts by using SourceLocation::getPtrEncoding
...
llvm-svn: 175333
2013-02-16 01:07:48 +00:00
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
Ted Kremenek
3cfba5bf13
Teach ccc-analyze to pass on -iquote with no spaces between it an the argument.
...
llvm-svn: 175115
2013-02-14 00:32:25 +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
Jordan Rose
a7d03840e6
Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.
...
Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.
llvm-svn: 174768
2013-02-08 22:30:41 +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
Ted Kremenek
26c777c409
Add some horrible Perl code to teach scan-build to recursively walk a directory for HTML files.
...
llvm-svn: 174260
2013-02-02 01:52:41 +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
Ted Kremenek
23813454e9
scan-build: When using Xcode 4.6, use build settings for doing proper build interposition.
...
llvm-svn: 173954
2013-01-30 19:10:24 +00:00
Chad Rosier
dd60e09021
[driver] Refactor the driver so that a failing commands doesn't prevent
...
subsequent commands from being executed.
The diagnostics generation isn't designed for this use case, so add a note to
fix this in the very near future. For now, just generated the diagnostics for
the first failing command.
Part of rdar://12984531
llvm-svn: 173825
2013-01-29 20:15:05 +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
Jordan Rose
b18179da33
scan-build: Add a --keep-empty option for better testing.
...
SATestBuild expects to compare output directories for each invocation of
scan-build that it runs, but scan-build clears out empty directories by
default. We were coincidentally not getting that behavior until r173294.
llvm-svn: 173383
2013-01-24 23:07:59 +00:00
Ted Kremenek
15b47bc872
Always process an index.html file if we have HTML output. Patch by Justin Bogner.
...
llvm-svn: 173294
2013-01-23 21:22:14 +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
NAKAMURA Takumi
873a63ce19
libclang: Update comment about USEDLIBS in c-*-test/Makefile.
...
"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."
llvm-svn: 173124
2013-01-22 04:11:33 +00:00