Daniel Jasper
0ca819410d
Temporary fix of tests to make buildbots happy.
...
Permanent solution coming up after checking back with Fariborz/Douglas.
llvm-svn: 170887
2012-12-21 12:10:20 +00:00
Evgeniy Stepanov
acef0e66a6
Slight rewording of -fsanitize=memory docs.
...
llvm-svn: 170880
2012-12-21 10:53:20 +00:00
Evgeniy Stepanov
17d5590003
User manual chapter on MemorySanitizer.
...
llvm-svn: 170879
2012-12-21 10:50:00 +00:00
Daniel Jasper
ab7654e894
Use OperatorPrecedence.h in clang-format
...
No indented functional changes other than handling more operators
correctly.
llvm-svn: 170875
2012-12-21 10:20:02 +00:00
Daniel Jasper
8dd404737b
Formatting fixes for PR14680
...
Also, some (automated) formatting fixes and slight cleanups.
llvm-svn: 170873
2012-12-21 09:41:31 +00:00
Dmitry Vyukov
42de108861
Remove the working that ThreadSanitizer is *experimental*.
...
llvm-svn: 170868
2012-12-21 08:21:25 +00:00
Richard Smith
38a549bc42
Fix regression in r170489: when instantiating a direct initializer which is a
...
CXXScalarValueInitExpr (or an ImplicitValueInitExpr), strip it back down to an
empty pair of parentheses so that the initialization code can tell that we're
performing value-initialization.
llvm-svn: 170867
2012-12-21 08:13:35 +00:00
Ted Kremenek
9304da9578
Extend checkUnsafeAssigns() to also handle assigning an object literal to a weak reference.
...
Thanks to Jordan Rose and John McCall for their sage code review.
Fixes <rdar://problem/12569201>.
llvm-svn: 170864
2012-12-21 08:04:28 +00:00
Ted Kremenek
b36234deca
Refactor checkUnsafeAssigns() to avoid code duplication with while loop.
...
This is just a minor bit of refactoring, but it is nice cleanup for
the subsequent patch that adds warning support for assigning literals
to weak variables.
llvm-svn: 170863
2012-12-21 08:04:20 +00:00
Richard Smith
d82a2ce3a0
Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for a value-initialized bool!
...
llvm-svn: 170837
2012-12-21 03:17:28 +00:00
NAKAMURA Takumi
3df909d030
Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when emitting a null constant of type pointer-to-data-member."
...
It broke stage2.
llvm-svn: 170835
2012-12-21 02:50:38 +00:00
Argyrios Kyrtzidis
d4635d4865
[libclang] Follow-up to r170824, provide the correct number of arguments for
...
a not-fully-formed macro invocation during code-completion.
llvm-svn: 170833
2012-12-21 01:51:12 +00:00
Anna Zaks
9747febba9
[analyzer] Address Jordan's nitpicks as per code review of r170625.
...
llvm-svn: 170832
2012-12-21 01:50:14 +00:00
Rafael Espindola
e7ec558f25
Revert r170826. The output of
...
./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks
changes in each run.
llvm-svn: 170829
2012-12-21 01:30:23 +00:00
Rafael Espindola
2be6b72ce0
Don't eagerly emit a global static merged with a local extern.
...
When we are visiting the extern declaration of 'i' in
static int i = 99;
int foo() {
extern int i;
return i;
}
We should not try to handle it as if it was an function static. That is, we
must consider the written storage class.
Fixing this then exposes that the assert in EmitGlobalVarDeclLValue and the
if leading to its call are not completely accurate. They were passing before
because the second decl was marked as having external storage. I changed them
to check the linkage, which I find easier to understand.
Last but not least, there is something strange going on with cuda and opencl.
My guess is that the linkage computation for these languages needs to be
audited, but I didn't want to change that in this patch so I just updated
the storage classes to keep the current behavior.
Thanks to Reed Kotler for reporting this.
llvm-svn: 170827
2012-12-21 01:21:33 +00:00
Anna Zaks
77ca7f1bbe
[analyzer] Traverse the Call Graph in topological order.
...
Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.
Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.
Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.
llvm-svn: 170826
2012-12-21 01:19:22 +00:00
Anna Zaks
5c32dfc5fb
[analyzer] Add blocks and ObjC messages to the call graph.
...
This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.
Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).
llvm-svn: 170825
2012-12-21 01:19:15 +00:00
Argyrios Kyrtzidis
c1d9a67e2b
[libclang] Make sure we can code-complete inside a macro argument even though
...
the macro invocation is not fully formed.
rdar://11290992
llvm-svn: 170824
2012-12-21 01:17:20 +00:00
NAKAMURA Takumi
f115642b61
EditedSource.cpp: Appease msvc, to add <cctype>.
...
llvm-svn: 170817
2012-12-21 00:21:02 +00:00
Sean Silva
426914a549
docs: Convert ObjectiveCLiterals to reST.
...
Sphinx's syntax highlighter doesn't recognize the new literals, so the
syntax highlighting is pretty pathetic.
llvm-svn: 170814
2012-12-21 00:17:02 +00:00
Sean Silva
2ff89eb835
docs: fix Sphinx toctree warning.
...
llvm-svn: 170813
2012-12-21 00:16:58 +00:00
Sean Silva
5f25c50e91
docs: Convert DriverInternals to reST.
...
llvm-svn: 170812
2012-12-21 00:16:53 +00:00
Richard Smith
789ce142df
Fix some bugs where we would sometimes use 0, not -1, when emitting a null constant of type pointer-to-data-member.
...
llvm-svn: 170806
2012-12-20 23:49:09 +00:00
Douglas Gregor
27c42e66bb
Revert r170801, which breaks the mingw build.
...
llvm-svn: 170804
2012-12-20 23:36:52 +00:00
Douglas Gregor
d04592dc81
Eliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!
...
llvm-svn: 170801
2012-12-20 23:11:42 +00:00
Ted Kremenek
9453721985
Revert "Warn if a __weak variable is initialized with an Objective-C object literal."
...
Per code feedback, I want to see if there is a more general way to do this.
llvm-svn: 170777
2012-12-20 22:31:27 +00:00
Argyrios Kyrtzidis
cbfd4d2483
Use some heuristics so that when a fixit removes a source range, we try
...
to also remove a trailing space if possible.
For example, removing '__bridge' from:
i = (__bridge I*)p;
should result in:
i = (I*)p;
not:
i = ( I*)p;
rdar://11314821
llvm-svn: 170764
2012-12-20 21:05:53 +00:00
Ted Kremenek
b39cfd41f2
Warn if a __weak variable is initialized with an Objective-C object literal.
...
Such variables may immediately become nil or may have unpredictable
behavior.
Fixes <rdar://problem/12569201>.
llvm-svn: 170763
2012-12-20 20:55:03 +00:00
Dmitri Gribenko
b420ef75fb
Documentation: use monospaced font in BlockLanguageSpec, and fix a link to this
...
document
llvm-svn: 170762
2012-12-20 20:51:59 +00:00
Chad Rosier
f8a2e70b08
Use the MaybeParseMicrosoftAttributes function.
...
llvm-svn: 170761
2012-12-20 20:37:53 +00:00
Daniel Jasper
9dd7e0f1f9
Remove namespace qualifier that lead to build breakage.
...
llvm-svn: 170759
2012-12-20 20:31:38 +00:00
Daniel Jasper
d1122cb50d
Move operator precedence calculation to new header
...
Thereby, it can be reused by clang-format and others.
Review: http://llvm-reviews.chandlerc.com/D229
llvm-svn: 170757
2012-12-20 20:25:19 +00:00
Fariborz Jahanian
68a542aea7
Add objective-C style formatting to clang format and
...
use it to format xml declaration tags.
// rdar://12378714
llvm-svn: 170727
2012-12-20 19:54:13 +00:00
Ted Kremenek
89abaa3517
Update RetainCountChecker to understand attribute ns_returns_autoreleased.
...
Fixes <rdar://problem/12887356>.
llvm-svn: 170724
2012-12-20 19:36:22 +00:00
Ted Kremenek
8f895741a2
Attribute 'cf_returns_autoreleased' doesn't really exist.
...
llvm-svn: 170723
2012-12-20 19:36:20 +00:00
Bill Wendling
207f05369d
Rename llvm::Attributes to llvm::Attribute.
...
llvm-svn: 170722
2012-12-20 19:27:06 +00:00
Bill Wendling
4442605f18
Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
...
llvm-svn: 170721
2012-12-20 19:22:21 +00:00
Rafael Espindola
ec5999e622
Fix Generic_GCC::GCCVersion::operator<
...
Without this patch comparing two equal versions without patch numbers (4.7 for
example) will result in A < B and B < A.
Patch by Simon Atanasyan.
llvm-svn: 170705
2012-12-20 16:15:07 +00:00
NAKAMURA Takumi
f827eb629d
c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.
...
llvm-svn: 170693
2012-12-20 13:30:10 +00:00
NAKAMURA Takumi
393bf4c3c8
c-index-test/Makefile: Reformat.
...
llvm-svn: 170692
2012-12-20 13:30:05 +00:00
Alexander Kornienko
9bdeb11508
Minor coding style issue: NULL -> 0
...
llvm-svn: 170688
2012-12-20 12:23:54 +00:00
Evgeniy Stepanov
a8df444a1c
Add __has_feature(memory_sanitizer).
...
llvm-svn: 170686
2012-12-20 12:03:13 +00:00
Alexander Kornienko
787f4c399f
ASTDumper coding style fixes.
...
http://llvm-reviews.chandlerc.com/D226
Patch by Philip Craig!
llvm-svn: 170684
2012-12-20 11:08:38 +00:00
NAKAMURA Takumi
712c3882f6
clang/test/Driver/warning-options.cpp: Appease MSYS bash.
...
llvm-svn: 170683
2012-12-20 11:08:13 +00:00
NAKAMURA Takumi
df3cf71dd7
clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on all targets.
...
llvm-svn: 170645
2012-12-20 03:30:30 +00:00
Michael Gottesman
2799ad4cce
Updated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst instead of BlockLanguageSpec.txt.
...
Thanks to Jean-Daniel Dupas for comments!
llvm-svn: 170644
2012-12-20 03:23:52 +00:00
Michael Gottesman
5cf1f65dc9
Changed UTF-8 emdashes to --- ala Dmitri Gribenko's comments.
...
llvm-svn: 170643
2012-12-20 03:23:49 +00:00
Richard Smith
da4de6c246
Fix another uninitialized bool member bug found by -fsanitize=bool. This one
...
appears to currently be benign (we happen to test the flags in the right
order, so we never depend on the uninitialized value).
llvm-svn: 170640
2012-12-20 02:47:01 +00:00
John McCall
393a78d4d3
Robustify the @encode code and add support for _Atomic.
...
Fixes PR14628.
llvm-svn: 170639
2012-12-20 02:45:14 +00:00
Richard Smith
5bb4cdfaa9
Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
...
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.
llvm-svn: 170636
2012-12-20 02:22:15 +00:00