Commit Graph

136856 Commits

Author SHA1 Message Date
Jordan Rose 520a30fd05 [analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h
As Anna pointed out, ProgramStateTrait.h is a relatively obscure header,
and checker writers may not know to look there to add their own custom
state.

The base macro that specializes the template remains in ProgramStateTrait.h
(REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep
using it.

llvm-svn: 167385
2012-11-05 16:58:00 +00:00
Rafael Espindola 6cc02e0026 Add missing this->. Fixes pr14238.
llvm-svn: 167383
2012-11-05 14:57:21 +00:00
Richard Osborne a1fffcf73a Don't infer whether a value is captured in the current function from the
'nocapture' attribute.

The nocapture attribute only specifies that no copies are made that
outlive the function. This isn't the same as there being no copies at all.
This fixes PR14045.

llvm-svn: 167381
2012-11-05 10:48:24 +00:00
Chandler Carruth 89ad975c68 Add a couple of stubs to the release notes for things I noticed while
clearing out my backlog of commit mail.

llvm-svn: 167380
2012-11-05 10:17:00 +00:00
Matt Beaumont-Gay 825b9ad2fb Our style for diagnostic messages is to not include a trailing dot.
llvm-svn: 167379
2012-11-05 05:32:00 +00:00
Eli Bendersky 6f6f55ee61 PR14256: SelectionDAGLowering was renamed to SelectionDAGBuilder a long time ago. Fix references to it in documentation and comments.
llvm-svn: 167378
2012-11-05 02:59:23 +00:00
NAKAMURA Takumi dce899962b ConstantFolding.cpp: Whitespace.
llvm-svn: 167377
2012-11-05 00:11:11 +00:00
Nick Lewycky 3811582038 Put the usage-directive inside the nearest namespace or TU decl. We don't want
to have UsingDirectiveDecl inside anything other than those two.

No user-visible functionality change.

llvm-svn: 167376
2012-11-04 20:21:54 +00:00
Fariborz Jahanian 2c96d30dd8 Fixes liftime of captured block variables in mrr mode, per John's feedback, as
well as couple of tests which were not being excercised because of TYPOs.

llvm-svn: 167374
2012-11-04 18:19:40 +00:00
Tobias Grosser 38ea9cd721 Tests: Pipe test files into 'opt'
Use 'opt < %s' instead of just 'opt %s' to ensure that no temporary files are
created.

llvm-svn: 167372
2012-11-04 16:56:20 +00:00
Duncan Sands 71c2070e2d Apply the patch from PR14160. I failed to construct a testcase for this, but
I'm applying it anyway since it seems to be obviously correct.

llvm-svn: 167370
2012-11-04 09:02:45 +00:00
Lang Hames 080b01e622 Test case for r167363.
llvm-svn: 167369
2012-11-04 05:08:08 +00:00
Craig Topper 3b530ea605 Remove alignments from folding tables for scalar FMA4 instructions.
llvm-svn: 167366
2012-11-04 04:40:08 +00:00
Jason Molenda ba813dc03c Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
The operator== method is a synonym for IsExactMatch().  

The essential difference between these two is that IsCompatibleMatch()
will say that armv7 and armv7s are compatible and return true.
IsExactMatch() will say that armv7 and armv7s are not a match.

An armv7s cpu can run either generic armv7 binaries or armv7s binaries
(the latter being tuned for it).  When we're picking the slice of a 
universal Mach-O file to load in an armv7s Target, we need to be able to
first look for an exact cpu subtype match (armv7s == armv7s) and failing
that, looking for a slice with a compatible architecture.

Update ObjectContainerUniversalMachO::GetObjectFile to prefer an exact
match of the cpu type, falling back to a compatible match if necessary.

<rdar://problem/12593515>

llvm-svn: 167365
2012-11-04 03:20:05 +00:00
Seth Cantrell 40f87b1d53 only truncate source lines in text diagnostics when
the ellipsis is shorter than the text it replaces

llvm-svn: 167364
2012-11-03 23:56:43 +00:00
Lang Hames 2954ceab82 Support interleaving of other pragmas with FP_CONTRACT at the beginning of a
compound statement.

llvm-svn: 167363
2012-11-03 22:29:05 +00:00
Dmitri Gribenko f21203b17c Address review comments for r167358: explicitly check for CK_BitCast instead of
checking against a blacklist.

llvm-svn: 167362
2012-11-03 22:10:18 +00:00
Seth Cantrell 6292e5b8e5 don't step into the middle of multibyte sequences
llvm-svn: 167361
2012-11-03 21:21:17 +00:00
Seth Cantrell d38c708dc1 fix bug in SourceColumnMap::startOfPreviousColumn
llvm-svn: 167360
2012-11-03 21:21:14 +00:00
Benjamin Kramer f9db130715 Escape trigraphs in unittest.
llvm-svn: 167359
2012-11-03 20:58:26 +00:00
Dmitri Gribenko 5ac744e006 Handle CK_NullToPointer casts in -Wtype-safety properly. Fixes PR14249.
llvm-svn: 167358
2012-11-03 16:07:49 +00:00
Dmitri Gribenko 941ab0fb6f Remove a const_cast by propagating constness to the member function.
llvm-svn: 167357
2012-11-03 14:24:57 +00:00
Duncan Sands 4698cb339f Fix the IntegersSubsetTest unit test when compiled with gcc-4.7. The issue here
is that the unit test doesn't have IntTy equal to APInt, instead it uses a class
derived from APInt.  When, as in these lines, an IntTy& reference is returned
but is assigned to an APInt&, the compiler destroys the temporary the IntTy& was
referring to, leaving the APInt& referring to garbage.  This causes the unittest
to fail systematically on my machine; it can also be caught by running the test
under valgrind.

llvm-svn: 167356
2012-11-03 14:04:04 +00:00
NAKAMURA Takumi ba15a7974a StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp: Appease msvc.
0 (as nullptr) is incompatible to pointer in type matching on msvc.

llvm-svn: 167355
2012-11-03 13:59:36 +00:00
Duncan Sands a318ef6fa6 Generalize the transform that boosts GEP indices to the size of a pointer to
also do it for vectors of pointers.

llvm-svn: 167354
2012-11-03 11:44:17 +00:00
Eli Friedman 34ff0ea522 Add a proper algorithm to compute accurate source ranges for diagnostics with
caret locations and source ranges in macros.  Makes ranges more accurate
in some cases, and fixes an assertion failure.

Fixes <rdar://problem/12472249>.

llvm-svn: 167353
2012-11-03 03:36:51 +00:00
Anna Zaks 8d1f6ed9a8 [analyzer] Run remove dead on end of path.
This will simplify checkers that need to register for leaks. Currently,
they have to register for both: check dead and check end of path.

I've modified the SymbolReaper to consider everything on the stack dead
if the input StackLocationContext is 0.

(This is a bit disruptive, so I'd like to flash out all the issues
asap.)

llvm-svn: 167352
2012-11-03 02:54:20 +00:00
Anna Zaks 44dc91b4df [analyzer] add LocationContext::inTopFrame() helper.
llvm-svn: 167351
2012-11-03 02:54:16 +00:00
Anna Zaks 2510608e81 [analyzer] Refactor: Remove Pred from NodeBuilderContext.
Node builders should manage the nodes, not the context.

llvm-svn: 167350
2012-11-03 02:54:11 +00:00
Jim Ingham a537f6ce37 Fix a little think-o. In FileSpec::operator== we were trying to figure out whether the rhs file was resolved or not by comparing
the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name.  We really meant to compare it
with the rhs FileSpec's directory name...

<rdar://problem/12438838>

llvm-svn: 167349
2012-11-03 02:12:46 +00:00
Akira Hatanaka da1980f697 [mips] Set flag neverHasSideEffects flag on floating point conversion
instructions.

llvm-svn: 167348
2012-11-03 00:53:12 +00:00
Nadav Rotem c2345cbe73 X86 CostModel: Add support for a some of the common arithmetic instructions for SSE4, AVX and AVX2.
llvm-svn: 167347
2012-11-03 00:39:56 +00:00
David Blaikie c59571878c Simplify these tests again, now that we're past the version skew.
llvm-svn: 167346
2012-11-03 00:27:14 +00:00
Akira Hatanaka 7828331329 [mips] Set flag isAsCheapAsAMove flag on instruction LUi.
llvm-svn: 167345
2012-11-03 00:26:02 +00:00
Owen Anderson 15fd6ac4ba Be careful not to optimize a SELECT_CC into a SETCC post-legalization if the SETCC node would be illegal.
llvm-svn: 167344
2012-11-03 00:17:26 +00:00
Greg Clayton dfdd1eb65e Make sure users know that "target variable" can read variables while running a process by changing the documentation string.
llvm-svn: 167343
2012-11-03 00:10:22 +00:00
Enrico Granata 80fcdd429f Caught two cases where we were passing a Stream* without checking for NULL
llvm-svn: 167342
2012-11-03 00:09:46 +00:00
Akira Hatanaka 5852e3b800 [mips] Stop reserving register AT and use register scavenger when a scratch
register is needed.

llvm-svn: 167341
2012-11-03 00:05:43 +00:00
Jordan Rose 58e8293467 [analyzer] Convert SimpleStreamChecker over to CallEvent.
llvm-svn: 167340
2012-11-02 23:49:35 +00:00
Jordan Rose 4080b0cceb [analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.
llvm-svn: 167339
2012-11-02 23:49:33 +00:00
Jordan Rose 829c383114 [analyzer] Add some convenience accessors to CallEvent, and use them.
These are CallEvent-equivalents of helpers already accessible in
CheckerContext, as part of making it easier for new checkers to be written
using CallEvent rather than raw CallExprs.

llvm-svn: 167338
2012-11-02 23:49:29 +00:00
Jordan Rose 0da6747901 [analyzer] isCLibraryFunction: check that the function is at TU-scope.
Also, Decls already carry a pointer to the ASTContext, so there's no need
to pass an extra argument to the predicate.

llvm-svn: 167337
2012-11-02 23:49:24 +00:00
David Blaikie 8ed46b9935 Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class_type).
llvm-svn: 167336
2012-11-02 23:40:00 +00:00
Akira Hatanaka 654e3b40f5 [mips] Do not reserve all 64-bit registers, but only the ones which need to be
reserved. Without this fix, RegScavenger::getRegsAvailable incorrectly
returns an empty set of integer registers.

llvm-svn: 167335
2012-11-02 23:36:01 +00:00
David Blaikie bc1b4e73e6 Include all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.
llvm-svn: 167334
2012-11-02 23:33:23 +00:00
Nadav Rotem 23848f8f1d Add a stub for the x86 cost model impl. Implement a basic cost rule for inserting/extracting from XMM registers.
llvm-svn: 167333
2012-11-02 23:27:16 +00:00
David Blaikie 263f6a0ffa Avoid version skew by making ObjC strict metadata tests resilient to new field.
llvm-svn: 167332
2012-11-02 23:07:41 +00:00
Fariborz Jahanian 2dd7819267 objective-C mrr block. Block variable layout metadata in
mrr mode.

llvm-svn: 167331
2012-11-02 22:51:18 +00:00
Nadav Rotem 3b0af848d3 Remove empty directory
llvm-svn: 167330
2012-11-02 22:35:50 +00:00
Nadav Rotem 13da94734c CostModel: add support for Vector Insert and Extract.
llvm-svn: 167329
2012-11-02 22:31:56 +00:00