Nico Weber
cdfb1ae7f7
Improve fixit for comparison operator on lhs of bitwise operator.
...
Before:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
if (0 == flags & 0xdd)
^
( )
Now:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
if (0 == flags & 0xdd)
^
( )
llvm-svn: 157897
2012-06-03 07:07:00 +00:00
Argyrios Kyrtzidis
ea173ffe42
Follow-up on the test of r157892
...
llvm-svn: 157893
2012-06-02 18:20:16 +00:00
Argyrios Kyrtzidis
3c9aaf1ab8
Initialize the non-target-dependent fields of the Preprocessor in its constructor
...
so we can destroy it even if it was constructed with "DelayInitialization = true",
and we didn't end up calling Preprocessor::Initialize.
Fixes crashes in rdar://11558355
llvm-svn: 157892
2012-06-02 18:08:09 +00:00
NAKAMURA Takumi
5c76f83106
Revert r157819, "#ifdef out a broken test on win32"
...
FYI, LLVM_ON_WIN32 is useless.
llvm-svn: 157890
2012-06-02 15:34:26 +00:00
NAKAMURA Takumi
4de31654bb
ToolInvocation::mapVirtualFile(): Tweak for Win32. Handle the key as native path.
...
llvm-svn: 157889
2012-06-02 15:34:21 +00:00
Simon Atanasyan
590ad8f515
MIPS: Factor out code selects the float ABI as determined by -msoft-float,
...
-mhard-float, and -mfloat-abi= to the new function getMipsFloatABI. That
simplifies reuse of this code.
llvm-svn: 157888
2012-06-02 15:06:29 +00:00
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