Commit Graph

38219 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 1416e17c89 [libclang] Don't crash when saving a PCH from a prefix header
that does not exist.

rdar://11607033

llvm-svn: 158193
2012-06-08 05:48:06 +00:00
Argyrios Kyrtzidis bce6d51a4b [libclang] Add a triple to test/Index/index-decls.m
llvm-svn: 158192
2012-06-08 03:54:16 +00:00
Argyrios Kyrtzidis 31afb956ae [libclang/AST]
AST: For auto-synthesized ivars give them the location of the related
property (previously they had no source location). This allows them
to be indexed by libclang.

libclang: Make sure synthesized ivars are indexed before the methods that
may reference them.

Fixes rdar://11607001.

llvm-svn: 158189
2012-06-08 02:16:11 +00:00
Anna Zaks d60367b893 [analyzer] Use "issue hash" in CmpRuns; followup on r158180
(For the future: It would be more efficient to produce a hash key with
the embedded function info inside the compiler.)

llvm-svn: 158187
2012-06-08 01:50:49 +00:00
Richard Smith 337a5a1c3f Allow friend declarations of defaulted special member functions. Only
definitions of such members are prohibited, not mere declarations.

llvm-svn: 158186
2012-06-08 01:30:54 +00:00
Kaelyn Uhrain 055e9479eb Fix up the 'typename' suggestion logic introduced in r157085, based on
feedback from Doug Gregor.

llvm-svn: 158185
2012-06-08 01:07:26 +00:00
Richard Smith f76568591c PR13047: Fix various abuses of clang::Type in the MS mangler, to make it work
in the presence of type sugar.

llvm-svn: 158184
2012-06-08 00:37:04 +00:00
Douglas Gregor aadbfafcd1 Fix typo "CursorKind.CONDITONAL_OPERATOR" in Python bindings, from
Manish Verma!

llvm-svn: 158182
2012-06-08 00:16:27 +00:00
Chandler Carruth 392357eea0 Rename a test case to a more generic name. This is a completely useless
test, but David Sehr is looking at spiffing it up and adding some proper
tests for our alloca codegen.

llvm-svn: 158181
2012-06-08 00:06:56 +00:00
Anna Zaks b60908db3a [analyzer] Add experimental "issue hash" to the plist diagnostic.
CmpRuns.py can be used to compare issues from different analyzer runs.
Since it uses the issue line number to unique 2 issues, adding a new
line to the beginning of a file makes all issues in the file reported as
new. 

The hash will be an opaque value which could be used (along with the
function name) by CmpRuns to identify the same issues. This way, we only
fail to identify the same issue from two runs if the function it appears
in changes (not perfect, but much better than nothing).

llvm-svn: 158180
2012-06-08 00:04:43 +00:00
Anna Zaks 93205d0d12 [analyze] Change some of the malloc tests to use clang_analyzer_eval.
Thanks, Jordan.

llvm-svn: 158179
2012-06-08 00:04:40 +00:00
Kaelyn Uhrain 1dac08da4b Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.

llvm-svn: 158178
2012-06-07 23:57:12 +00:00
Kaelyn Uhrain 389e9c2d7c Ignore corrections to functions with bodies when deciding which
correction to use for an invalid function redeclaration.

llvm-svn: 158177
2012-06-07 23:57:08 +00:00
Douglas Gregor cb8cf4916f Minor comments and changes to clang-completion-mode.el, from David Wood!
llvm-svn: 158174
2012-06-07 22:33:29 +00:00
Anna Zaks a7dcc996a9 [analyzer] Fixit for r158136.
I falsely assumed that the memory spaces are equal when we reach this
point, they might not be when memory space of one or more is stack or
Unknown. We don't want a region from Heap space alias something with
another memory space.

llvm-svn: 158165
2012-06-07 20:18:08 +00:00
Fariborz Jahanian 5d53fcda7c User better API for vla in compund literals.
// rdar://11485774

llvm-svn: 158157
2012-06-07 18:15:55 +00:00
Douglas Gregor fed6699dd9 Add ext_vector type code for builtins, from John Garvin!
llvm-svn: 158156
2012-06-07 18:08:25 +00:00
Chandler Carruth 48687a5a00 Fix many doxygen formatting errors.
This patch affects docs only, and includes formatting changes only
(though those include some fixes for broken Doxygen markup that caused
some content to be missing from generated pages).  It avoids generating
many spurious pages such as
http://clang.llvm.org/doxygen/classRepresents.html, but likely not all
yet.

Patch by James Dennett.

llvm-svn: 158155
2012-06-07 17:55:42 +00:00
Fariborz Jahanian bbc5bbf4f1 When emitting compund literal of vla pointer elements, make
sure to emit vla size to prevent an irgen crash.
// rdar://11485774

llvm-svn: 158153
2012-06-07 17:07:15 +00:00
Benjamin Kramer 5d4cff72b4 Reuse APInt's getNumWords, which gets rounding right (my ad-hoc solution missed it).
llvm-svn: 158151
2012-06-07 15:54:03 +00:00
Benjamin Kramer 6003ad5848 Plug a long standing memory leak in TemplateArgument.
The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.

Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.

llvm-svn: 158150
2012-06-07 15:09:51 +00:00
NAKAMURA Takumi 29aaccda13 test/Frontend/rewrite-includes.c: Tweak for win32's pathsep.
llvm-svn: 158149
2012-06-07 14:21:02 +00:00
Benjamin Kramer b696a3639d Move sideeffecting call out of assert().
llvm-svn: 158146
2012-06-07 09:57:21 +00:00
Anna Zaks 3563fde6a0 [analyzer] Anti-aliasing: different heap allocations do not alias
Add a concept of symbolic memory region belonging to heap memory space.
When comparing symbolic regions allocated on the heap, assume that they
do not alias. 

Use symbolic heap region to suppress a common false positive pattern in
the malloc checker, in code that relies on malloc not returning the
memory aliased to other malloc allocations, stack.

llvm-svn: 158136
2012-06-07 03:57:32 +00:00
Jordan Rose aefcedae65 Attach fixits for CFBridgingRetain/Release outside any casts.
Before, the note showed the location where you could insert __bridge variants,
but the actual fixit edit came after the cast.

No functionality change.

llvm-svn: 158131
2012-06-07 01:10:35 +00:00
Jordan Rose 288c421b3d Insert a space if necessary when suggesting CFBridgingRetain/Release.
This was a problem for people who write 'return(result);'

Also fix ARCMT's corresponding code, though there's no test case for this
because implicit casts like this are rejected by the migrator for being
ambiguous, and explicit casts have no problem.

<rdar://problem/11577346>

llvm-svn: 158130
2012-06-07 01:10:31 +00:00
Argyrios Kyrtzidis b03cc793a9 [arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a +0 method,
automatically insert a __bridge cast.

radar://11560638

llvm-svn: 158127
2012-06-07 00:44:06 +00:00
Fariborz Jahanian ff045dc040 reverse r158117.
llvm-svn: 158119
2012-06-06 23:21:58 +00:00
Fariborz Jahanian 67164852a7 When doing arithmatic on vla pointer, make sure
to emit vla size to prevent an irgen crash.
// rdar://11485774

llvm-svn: 158117
2012-06-06 22:58:50 +00:00
Argyrios Kyrtzidis 4e633b56c0 Fix test/SemaObjC/cocoa-api-usage.m that broke via r158114.
llvm-svn: 158115
2012-06-06 22:32:07 +00:00
Argyrios Kyrtzidis 63aebfb4ae [objcmt] When in ARC mode, also convert "[[.. alloc] init]" messages to literals,
since the change from +1 to +0 will be handled fine by ARC.

rdar://11606358

llvm-svn: 158114
2012-06-06 22:23:12 +00:00
Manuel Klimek 9cc3c0307d Puts the linktime dependencies into stupid-ld-required order, as proposed by Jordan Rose.
llvm-svn: 158113
2012-06-06 21:30:34 +00:00
Manuel Klimek 0a8b9cd1e7 Switches the RewriterTestContext away from PathV1.
Now the ToolingTests all work on Windows, and they also clean up their temporary directory if they don't crash.

llvm-svn: 158112
2012-06-06 21:28:13 +00:00
Douglas Gregor 91c25eadea Whenever we have a BalancedDelimiterTracker, we have a 'nested' scope
where '>' is going to behave as an operator (and not as a '>' closing
a template argument list).

llvm-svn: 158111
2012-06-06 21:18:07 +00:00
Kaelyn Uhrain 493ea635fe Allow CorrectTypo to add/modify nested name qualifiers to typos that
are otherwise too short to try to correct.

The TODOs added to two of the tests are for existing deficiencies in the
typo correction code that could be exposed by using longer identifiers.

llvm-svn: 158109
2012-06-06 20:54:51 +00:00
Jordan Rose 0da4e77880 [analyzer] Provide debug descriptions for all memory space regions.
Patch by Guillem Marpons!

llvm-svn: 158106
2012-06-06 20:47:00 +00:00
Jordan Rose a929f2c863 Fix Makefile: Options.td depends on CC1Options.td.
llvm-svn: 158105
2012-06-06 20:46:55 +00:00
David Blaikie 40ed29730b Revert Decl's iterators back to pointer value_type rather than reference value_type
In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

llvm-svn: 158104
2012-06-06 20:45:41 +00:00
Benjamin Kramer 972a96aede Remove the last dead private member in clang.
llvm-svn: 158100
2012-06-06 20:15:08 +00:00
David Blaikie d5321247c4 Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.
Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).

llvm-svn: 158093
2012-06-06 18:52:13 +00:00
David Blaikie 987bcf9462 Escape \n and \r in doxycomment.
llvm-svn: 158091
2012-06-06 18:43:20 +00:00
Manuel Klimek a98032e4cf Documents linking requirements for libtooling.
llvm-svn: 158088
2012-06-06 17:51:31 +00:00
Benjamin Kramer d1d76b2da7 Remove unused private member variables found by clang's new -Wunused-private-field.
llvm-svn: 158086
2012-06-06 17:32:50 +00:00
Jordan Rose ccf43ca05c Add pedantic warning -Wempty-translation-unit (C11 6.9p1).
In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.

The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.

Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.

PR12665 and <rdar://problem/9165548>

llvm-svn: 158085
2012-06-06 17:25:21 +00:00
Francois Pichet b27ea02784 Zap the /Za compiler switch from MSVC projects, the option is considered harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed.
Only 1 minor code change was necessary: can't use cdecl as variable name anymore.

llvm-svn: 158063
2012-06-06 12:00:10 +00:00
Daniel Jasper 0baec549a3 Introduce -Wunused-private-field. If enabled, this warning detects
unused private fields of classes that are fully defined in the current
translation unit.

llvm-svn: 158054
2012-06-06 08:32:04 +00:00
Ted Kremenek f470a4c2ca Disable path pruning for UndefResultChecker. It turns out we usually want to see more of the path
to discover how a value was used uninitialized.

llvm-svn: 158048
2012-06-06 06:25:37 +00:00
Douglas Gregor c65e1598ad A non-explicit constructor template with a second parameter that is a
parameter pack is a converting constructor. Fixes PR13003.

llvm-svn: 158040
2012-06-05 23:44:51 +00:00
Ted Kremenek 54baf2e57d PlistDiagnostics: force the ranges for control-flow edges to be single locations, forcing
adjacent edges to have compatible ranges.  This simplifies the layout logic for some clients.

llvm-svn: 158028
2012-06-05 22:00:52 +00:00
Fariborz Jahanian 3da28f80e3 objective-c: merge deprecated/unavailable attributes to
the overriding deprecated/unavailable method.
// rdar://11475360

llvm-svn: 158022
2012-06-05 21:14:46 +00:00