Benjamin Kramer
474261af7b
Fix typos found by http://github.com/lyda/misspell-check
...
llvm-svn: 157886
2012-06-02 10:20:41 +00:00
Alexander Kornienko
06caf7d59f
Implementation of a "soft opt-in" option for -Wimplicit-fallthrough diagnostics: -Wimplicit-fallthrough-per-method
...
llvm-svn: 157871
2012-06-02 01:01:07 +00:00
Anna Zaks
7ba2615047
[analyzer] Rely on canBeInlined utility instead of checking CallExpr
...
explicitly.
This will make it easier to add inlining support to more expressions.
llvm-svn: 157870
2012-06-02 00:40:52 +00:00
Anna Zaks
bec49efdf2
[analyzer] Fix a spurious undef value warning.
...
When we timeout or exceed a max number of blocks within an inlined
function, we retry with no inlining starting from a node right before
the CallEnter node. We assume the state of that node is the state of the
program before we start evaluating the call. However, the node pruning
removes this node as unimportant.
Teach the node pruning to keep the predecessors of the call enter nodes.
llvm-svn: 157860
2012-06-01 23:48:44 +00:00
Anna Zaks
1b37ea0a5f
[analyzer] Fix lack of coverage after empty inlined function.
...
We should not stop exploring the path after we return from an empty
function.
llvm-svn: 157859
2012-06-01 23:48:40 +00:00
Ted Kremenek
5d6e7c3351
Disable diagnosic path pruning for ReturnUndefChecker.
...
llvm-svn: 157851
2012-06-01 23:04:04 +00:00
Jordan Rose
573649eb8b
[diagtool] Pull show-enabled back out for now.
...
Need to figure out how to get Frontend's warning parsing without bringing
in all of Frontend.
llvm-svn: 157847
2012-06-01 22:23:02 +00:00
Jordan Rose
74516bafae
[diagtool] Unbork Makefile build.
...
llvm-svn: 157846
2012-06-01 22:02:18 +00:00
Ted Kremenek
ac80f60eed
Update checker build.
...
llvm-svn: 157844
2012-06-01 21:51:15 +00:00
Jordan Rose
dbdef881a8
[diagtool] Appease buildbot by adding llvm_unreachable.
...
llvm-svn: 157843
2012-06-01 21:50:37 +00:00
Jordan Rose
d617e06997
[diagtool] Add 'show-enabled', which displays which warnings are enabled.
...
show-enabled uses the command line you give it to build a CompilerInstance,
so any flags you pass will be processed as if running clang proper.
llvm-svn: 157842
2012-06-01 21:23:17 +00:00
Jordan Rose
8b4fcec988
[diagtool] The driver skips two arguments, not one.
...
llvm-svn: 157841
2012-06-01 21:23:13 +00:00
Ted Kremenek
c3da376fbc
static analyzer: add inlining support for directly called blocks.
...
llvm-svn: 157833
2012-06-01 20:04:04 +00:00
Kaelyn Uhrain
ba896f17ae
Don't allow multiple correction candidates that have the same identifier
...
but different nested name specifiers to quietly clobber each other so
only one remains if they do not refer to the same NamedDecl. Fixes
PR12951.
llvm-svn: 157823
2012-06-01 18:11:16 +00:00
Alexander Kornienko
685f43ff02
#ifdef out a broken test on win32
...
llvm-svn: 157819
2012-06-01 16:48:55 +00:00
Jordan Rose
dc191a184f
[analyzer] SATestBuild should execute SVN updates even if Verbose is off.
...
Also, re-use glob results when looking for failure logs.
llvm-svn: 157817
2012-06-01 16:24:43 +00:00
Jordan Rose
01ac57244c
[analyzer] Fix SATestAdd to work with SATestBuild.
...
Also, eliminate global 'IsReferenceBuild' in SATestBuild. It doesn't get
passed around that much.
llvm-svn: 157816
2012-06-01 16:24:38 +00:00
Alexander Kornienko
55f2ca9b27
Added a test for ToolInvocation::mapVirtualFile method.
...
llvm-svn: 157812
2012-06-01 14:50:43 +00:00
Eric Christopher
31a1fc6654
Support C++11 enum forward declarations.
...
Part of rdar://11570854
llvm-svn: 157787
2012-06-01 00:22:57 +00:00
Argyrios Kyrtzidis
273c7c40b2
[arcmt] Use CFBridgingRetain/CFBridgingRelease instead of __bridge_retained/__bridge_transfer
...
when migrating.
rdar://11569198
llvm-svn: 157785
2012-06-01 00:10:47 +00:00
Aaron Ballman
a0bc07262b
Anonymous union members within a struct are now properly handled as an unevaluated field in C++11 mode. This fixes PR12866.
...
llvm-svn: 157784
2012-06-01 00:02:08 +00:00
Kaelyn Uhrain
34fab5598d
In TypoCorrectionConsumer, BestResults to CorrectionResults to lessen
...
the confusion among all of the uses of Best* in relation to the set of
possible typo correction results. Also add a method to return the set of
typo corrections that have the single best edit distance--it returns the
second half of the first pair in TypoEditDistanceMap (with
getBestEditDistance already returning the first half).
llvm-svn: 157781
2012-05-31 23:32:58 +00:00
Fariborz Jahanian
bebd0ba549
objc: properties of NSObject attribute must
...
have correct pointer type or issue error,
instead of crashing in IRGen. // rdar:// 11569860
llvm-svn: 157780
2012-05-31 23:18:32 +00:00
Tom Care
698daefb58
[analyzer] Fix BugType memory leak in IdempotentOperationChecker.
...
llvm-svn: 157772
2012-05-31 21:24:58 +00:00
Aaron Ballman
f4f486f732
Updating the visualizers to include more datatypes. Patch thanks to Jay Blanchard.
...
llvm-svn: 157763
2012-05-31 19:27:30 +00:00
Anna Zaks
2774f99913
[analyzer] Cleanup for r157721.
...
We should lock the number of elements after the initial parsing is
complete. Recursive AST visitors in AnalyzesConsumer and CallGarph can
trigger lazy pch deserialization resulting in more calls to
HandleTopLevelDecl and appending to the LocalTUDecls list. We should
ignore those.
llvm-svn: 157762
2012-05-31 18:07:55 +00:00
Alexander Kornienko
21d6ec9224
Fix an object lifetime issue in clang/Tooling.
...
llvm-svn: 157759
2012-05-31 17:58:43 +00:00
Ted Kremenek
16704bb15b
Allow some BugReports to opt-out of PathDiagnostic callstack pruning until we have significantly
...
improved the pruning heuristics. The current heuristics are pretty good, but they make diagnostics
for uninitialized variables warnings particularly useless in some cases.
llvm-svn: 157734
2012-05-31 06:03:17 +00:00
Craig Topper
3f122a7636
Add builtin for pclmulqdq instruction.
...
llvm-svn: 157733
2012-05-31 05:18:48 +00:00
Richard Smith
ee48633937
Only visit default arguments for template declarations when visiting the template declaration which introduced them. Patch by Yang Chen!
...
llvm-svn: 157723
2012-05-30 23:55:51 +00:00
Anna Zaks
d08d9159c2
Change wording of 'memcpy' type mismatch warning and remove fixit.
...
As per comments following r157659.
llvm-svn: 157722
2012-05-30 23:14:52 +00:00
Anna Zaks
34d89b7ddc
[analyzer]Fix another occurrence of iterator invalidation (LocalTUDecls)
...
Follow up in r155693, r155680.
Prevents a hard to reproduce crash with the following stack trace:
3 libsystem_c.dylib 0x00007ff55a835050 _sigtramp + 18446744029881443184
4 clang 0x0000000106218e97 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
+ 519
5 clang 0x0000000105cf3002 clang::ParseAST(clang::Sema&,
bool, bool) + 690
6 clang 0x00000001059a41d8
clang::ASTFrontendAction::ExecuteAction() + 312
7 clang 0x00000001059a3df7 clang::FrontendAction::Execute()
+ 231
8 clang 0x00000001059b0ecc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 860
9 clang 0x000000010595e451
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
10 clang 0x0000000105947f29 cc1_main(char const**, char
const**, char const*, void*) + 969
11 clang 0x0000000105958259 main + 473
12 clang 0x0000000105947b34 start + 52
llvm-svn: 157721
2012-05-30 23:14:48 +00:00
Jordan Rose
95341bf4d4
Add a test for '%@' suggestion for classes.
...
llvm-svn: 157718
2012-05-30 22:41:32 +00:00
Jordan Rose
68f6d3b1a6
Suggest '%@' for Objective-C objects in ObjC format strings.
...
llvm-svn: 157716
2012-05-30 21:53:13 +00:00
David Blaikie
7e6ad46275
Disable -Wunique-enum for anonymous enums.
...
This is a large class of false positives where anonymous enums are used to
declare constants (see Clang's Diagnostics.h for example). A small number of
true positives could probably be found in this bucket by still warning if the
anonymous enum is used in a declarator (enum { ... } x;) but so far we don't
believe this to be a source of significant benefit so I haven't bothered to
preserve those cases.
General offline review/acknowledgment by rtrieu.
llvm-svn: 157713
2012-05-30 20:45:14 +00:00
Jim Grosbach
6acd46f5e9
TableGen: Remove extraneous '\' at EOL in generated tests.
...
llvm-svn: 157700
2012-05-30 18:18:29 +00:00
Fariborz Jahanian
a1d29cd471
objective-c: revert r157407. It broke a project
...
and reported as PR12959. // rdar://11499742
llvm-svn: 157697
2012-05-30 17:33:54 +00:00
Manuel Klimek
8b1c60220d
Adds a toString method to Replacement, which helps debugging.
...
Adds missing header guards to Refactoring.h.
llvm-svn: 157694
2012-05-30 16:04:29 +00:00
Alexander Kornienko
9e8d22896c
Fixed a memory leak in clang/Tooling.
...
llvm-svn: 157687
2012-05-30 12:10:28 +00:00
Gabor Greif
0d1c121bf7
supply a simple-minded testcase for r156813, to check whether the embedded montavista gcc toolchain is recognized
...
llvm-svn: 157686
2012-05-30 09:56:26 +00:00
Alexey Samsonov
731eb477c1
Clang docs update: list command-line flags that control the size of generated debug information. Reviewed by chandlerc@ and echristo@.
...
llvm-svn: 157681
2012-05-30 06:55:10 +00:00
Craig Topper
9ee12508ca
SSE4A should not imply LZCNT and POPCNT. FMA4 should imply SSE4A. Add missing break at the end of btver1 feature list.
...
llvm-svn: 157680
2012-05-30 05:54:54 +00:00
Craig Topper
9fd12db1c0
Update FIXME. ABM is already covered by LZCNT and POPCNT.
...
llvm-svn: 157676
2012-05-30 04:49:49 +00:00
Craig Topper
85e100ff37
Mark extrqi and insertqi immediate arguments as being ICE.
...
llvm-svn: 157675
2012-05-30 04:45:24 +00:00
Daniel Jasper
41acbc62fb
Test commit - Fix typo in comment.
...
llvm-svn: 157674
2012-05-30 04:30:08 +00:00
Eric Christopher
13586ab6d8
Remove some extra braces.
...
llvm-svn: 157667
2012-05-30 01:14:28 +00:00
Richard Trieu
01cf09302d
Add new -Wunique-enum which will warn on enums which all elements have the
...
same value and were initialized with literals. Clang will warn on code like
this:
enum A {
FIRST = 1,
SECOND = 1
};
llvm-svn: 157666
2012-05-30 01:01:11 +00:00
Anna Zaks
869aeccada
Add fixits for memory access warnings.
...
Also, do not display the builtin name and macro expansion when the
function is a builtin.
llvm-svn: 157659
2012-05-30 00:34:21 +00:00
Fariborz Jahanian
b6499eb60d
objc: position of 'fixit' was off by one.
...
This patch fixes it. // rdar://11488351
llvm-svn: 157646
2012-05-29 21:52:45 +00:00
Fariborz Jahanian
836914c0aa
fixes radar no. in this test.
...
llvm-svn: 157642
2012-05-29 19:59:25 +00:00
Fariborz Jahanian
b5dd2cb13c
objective-c: fix a sema and IRGen crash when property
...
getter result type is safe but does not match with property
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196
llvm-svn: 157641
2012-05-29 19:56:01 +00:00
Benjamin Kramer
1ab16ba501
Install ammintrin.h in the cmake build.
...
llvm-svn: 157639
2012-05-29 19:36:17 +00:00
Benjamin Kramer
ba6e2528fa
Add an ammintrin.h header for SSE4a intrinsics.
...
This is a clean-room implementation based on public documentation and
I tried to validate it as much as possible against gcc.
llvm-svn: 157638
2012-05-29 19:10:17 +00:00
Simon Atanasyan
217dc2d8dd
MIPS: Pass -KPIC argument to MIPS assembler if necessary.
...
llvm-svn: 157635
2012-05-29 19:07:33 +00:00
Simon Atanasyan
a16b7fd029
Factor out the code retrieves the last PIC related argument from
...
the Clang::ConstructJob() to the new ArgList::getLastArg() routine
with eight argument. That simplifies reusing of this code.
llvm-svn: 157633
2012-05-29 18:50:33 +00:00
Benjamin Kramer
8ac9c22391
Define __SSE4A__ when targeting new AMD CPUs.
...
This doesn't really fit the existing SSELevel so it gets an extra flag.
llvm-svn: 157630
2012-05-29 17:48:39 +00:00
David Blaikie
48b812854e
Fix indenting.
...
llvm-svn: 157628
2012-05-29 17:05:42 +00:00
Chad Rosier
68d2ca7ecc
Revert r155737, restoring the MaxDepth in the BalancedDelimiterTracker to 256.
...
r155737 turned out to be a temporary work around. The correct fix was in r155823.
llvm-svn: 157627
2012-05-29 16:57:50 +00:00
Roman Divacky
67030280f9
Sparc is bigendian.
...
llvm-svn: 157626
2012-05-29 16:10:50 +00:00
Alexey Samsonov
dda3a7f914
Make Clang driver pass the last option from -g group to the compiler.
...
Leave a better fixme for different debug info flags
llvm-svn: 157602
2012-05-29 08:10:34 +00:00
Charles Davis
e8ccc1134b
Use fewer temporaries mangling APSInt objects. The performance difference
...
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.
llvm-svn: 157601
2012-05-29 07:01:45 +00:00
Peter Collingbourne
aac265cc78
OpenCL: Fix vector conditional operator CodeGen for the case where
...
the operands are vectors of doubles.
llvm-svn: 157596
2012-05-29 00:35:18 +00:00
Benjamin Kramer
938a71ff18
Fix suspicous isIntegerType() check, found by PVS Studio (PR12357).
...
llvm-svn: 157593
2012-05-28 21:01:59 +00:00
David Blaikie
7e64fd9d53
Address minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.
...
Use actual factory functions rather than derived classes acting as named constructors/factories.
llvm-svn: 157588
2012-05-28 19:38:42 +00:00
Charles Davis
6770dea704
Fix mangling of integral template arguments between 1 and 10. Add a test case
...
for this. Reported by Timur Iskhodzhanov.
llvm-svn: 157583
2012-05-28 16:53:33 +00:00
Charles Davis
ee855f06e7
Fix Lang's fix. This should fix the tests for +Asserts builds.
...
llvm-svn: 157561
2012-05-28 03:54:22 +00:00
Chris Lattner
a2db6f2bd8
adjust to mainline llvm API change.
...
llvm-svn: 157557
2012-05-28 01:47:53 +00:00
David Blaikie
c4c0e8aa9a
Fix PR12960 by not attempting to correct cases when we're not actually instantiatiating a template.
...
This comes up in the begin/end calls of a range-for (see the included test
case). Other suggestions are welcome, though this seems to do the trick without
regressing anything.
llvm-svn: 157553
2012-05-28 01:26:45 +00:00
Charles Davis
7fb195b683
Test case for 157547. Before that patch, all the digits would be mangled
...
as zeroes. Now the digits are properly non-zero.
llvm-svn: 157552
2012-05-28 00:43:56 +00:00
Benjamin Kramer
ea388a2832
PR12962: Fix a rare use after free when collecting virtual overrides.
...
The DenseMap reallocates after 64 insertions so this only happened in
large test cases under very specific circumstances.
llvm-svn: 157549
2012-05-27 22:41:08 +00:00
Lang Hames
6ccb51130e
Fix call to APSInt constructor - it doesn't take an initial value, just a
...
bitwidth and signedness. Also rename the variable to reflect its purpose.
No test case - discovered during random code exploration.
llvm-svn: 157547
2012-05-27 21:39:49 +00:00
Fariborz Jahanian
f021889036
-Wdeprecated warning to include reference (as a note)
...
to the declaration in this patch. // rdar://10893232
llvm-svn: 157537
2012-05-27 16:59:48 +00:00
Benjamin Kramer
443488eba9
Pass ProgramStateRef by reference.
...
Retain + Release on a ref counted pointer is cheap, but not free (it adds a function call in this case).
llvm-svn: 157534
2012-05-27 15:32:10 +00:00
Dmitri Gribenko
34983f25c6
Close HTML tag properly.
...
llvm-svn: 157533
2012-05-27 14:08:44 +00:00
Benjamin Kramer
b33ffee04f
Use the SelectorSet typedef more widely throughout Sema.
...
While there make it a SmallPtrSet.
llvm-svn: 157532
2012-05-27 13:28:52 +00:00
Benjamin Kramer
69b5a60d96
Replace some custom hash combines with the standard stuff from DenseMapInfo.
...
llvm-svn: 157531
2012-05-27 13:28:44 +00:00
NAKAMURA Takumi
42e5ac409c
clang/unittests/Tooling/RewriterTestContext.h: Don't try to remove TemporaryDirectory.
...
llvm-svn: 157530
2012-05-27 13:10:14 +00:00
NAKAMURA Takumi
ce6ad6748a
clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32 doesn't allow rename/removing opened files.
...
llvm-svn: 157528
2012-05-27 12:59:58 +00:00
Charles Davis
5511dfb399
Mangle template instantiations properly (as of VC 7.x) when compiling for
...
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!
llvm-svn: 157524
2012-05-26 23:12:19 +00:00
Benjamin Kramer
7b01b578a9
Only emit one set of braces for __VERSION__, getClangFullRepositoryVersion already adds some.
...
No test as the output is highly dependend on the local configuration.
llvm-svn: 157520
2012-05-26 19:39:52 +00:00
Fariborz Jahanian
f3b7681f2b
Change warning to error when property setter names conflict.
...
// rdar://11528439
llvm-svn: 157517
2012-05-26 16:10:06 +00:00
Richard Smith
1bb8edb8ac
In response to some discussions on IRC, tweak the wording of the new
...
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.
To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.
Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.
llvm-svn: 157511
2012-05-26 06:20:46 +00:00
David Blaikie
3d8edc24c7
Fix indentation.
...
llvm-svn: 157510
2012-05-26 05:35:39 +00:00
Alexander Kornienko
246e85ddb0
Don't offer '[[clang::fallthrough]];' fix-it when a fall-through occurs to a
...
switch label immediately followed by a 'break;'.
llvm-svn: 157508
2012-05-26 00:49:15 +00:00
Nuno Lopes
f491fbd715
fix codegen support for alloc_size attribute for static C++ methods
...
add test case for C++ codegen
llvm-svn: 157500
2012-05-25 21:45:08 +00:00
Argyrios Kyrtzidis
e99b084cd7
[libclang] Add a test I forgot to commit for r156890.
...
llvm-svn: 157491
2012-05-25 20:05:57 +00:00
Rafael Espindola
67a498cc5f
Don't ignore linkage when ignoring visibility in the instantiation of a
...
method template.
llvm-svn: 157486
2012-05-25 17:22:33 +00:00
Nuno Lopes
147dcd8c33
add CodeGen support for the alloc_size attribute
...
llvm-svn: 157483
2012-05-25 17:04:42 +00:00
Rafael Espindola
340941dc16
Don't ignore linkage when ignoring visibility in the instantiation of a
...
function template.
llvm-svn: 157480
2012-05-25 16:41:35 +00:00
Anna Zaks
6a65819ba3
[analyzer] Don't crash on LValBitCast
...
llvm-svn: 157478
2012-05-25 16:02:16 +00:00
Rafael Espindola
a28bf63d9a
Consider the linkage for member class templates even when we have to ignore
...
the visibility.
llvm-svn: 157475
2012-05-25 15:51:26 +00:00
Rafael Espindola
0cf10ac9ab
When ignoring visibility in an instantiation, still consider the linkage.
...
Similar fixes for function and member template to follow as I write the
testcases.
llvm-svn: 157470
2012-05-25 14:47:05 +00:00
Rafael Espindola
4d71d0f9fa
Whitespace fixes.
...
llvm-svn: 157469
2012-05-25 14:17:45 +00:00
Manuel Klimek
5d9e8362df
Links the entry point to the tooling documentation into clang's menu bar.
...
llvm-svn: 157462
2012-05-25 08:39:21 +00:00
Richard Smith
cff136cda8
Release notes update for -Wsometimes-uninitialized.
...
llvm-svn: 157459
2012-05-25 02:35:34 +00:00
Richard Smith
4323bf8e2e
Split a chunk of -Wconditional-uninitialized warnings out into a separate flag,
...
-Wsometimes-uninitialized. This detects cases where an explicitly-written branch
inevitably leads to an uninitialized variable use (so either the branch is dead
code or there is an uninitialized use bug).
This chunk of warnings tentatively lives within -Wuninitialized, in order to
give it more visibility to existing Clang users.
llvm-svn: 157458
2012-05-25 02:17:09 +00:00
Anna Zaks
268f154f48
[analyzer] Loading external plugins with scan-build
...
Load custom plugins when running scan-build. This is useful when
additional static analysis Checkers must be provided via clang's plugin
interface.
Loading additional plugins can now be done via the scan-build call:
scan-build -load-plugin <plugin.so>
A patch by Thomas Hauth.
llvm-svn: 157452
2012-05-25 01:13:50 +00:00
Seth Cantrell
14340ca173
ensure value passed to is space is representable as unsigned char
...
if the value isn't an unsigned char or EOF behavior is undefined
(and on Windows there's an assertion)
llvm-svn: 157445
2012-05-25 00:03:29 +00:00
Richard Smith
3d31e8b280
Some cleanups around the uninitialized variables warning, and a FIXME. No functional change.
...
llvm-svn: 157440
2012-05-24 23:45:35 +00:00
Fariborz Jahanian
c37a1d6e0f
cleanup some code.
...
llvm-svn: 157436
2012-05-24 22:59:56 +00:00