Commit Graph

45315 Commits

Author SHA1 Message Date
Devang Patel f94b9826b5 Preserve dom info.
llvm-svn: 53089
2008-07-03 07:04:22 +00:00
Devang Patel 874a3a0b0d Keep track of inherited analysis (e.g. dominator tree).
llvm-svn: 53088
2008-07-03 07:02:30 +00:00
Devang Patel 226edd1826 Remove extra FIXME
llvm-svn: 53087
2008-07-03 06:50:04 +00:00
Devang Patel c4dcf82a16 Reconstruct dom info, if loop is unswitched.
llvm-svn: 53086
2008-07-03 06:48:21 +00:00
Devang Patel e491bb8845 LoopUnswitch does not preserve dominator info in all cases.
llvm-svn: 53085
2008-07-03 05:55:03 +00:00
Ted Kremenek f39614bfd0 Updated latest checker build.
llvm-svn: 53084
2008-07-03 05:33:14 +00:00
Ted Kremenek 1d3c797c90 Have BugReporter::getCFG and BugReporter::getLiveVariables returns pointers instead of references, because they can both fail
on functions we cannot construct full CFGs for yet.

llvm-svn: 53081
2008-07-03 05:26:14 +00:00
Ted Kremenek 590afde872 Updated latest checker build.
llvm-svn: 53080
2008-07-03 04:47:54 +00:00
Ted Kremenek ff7f2e76bf Update Xcode project.
llvm-svn: 53076
2008-07-03 04:30:48 +00:00
Ted Kremenek 0e7d25233e Added static analysis check to see if a subclass of NSObject implements -dealloc, and whether or not that implementation calls [super dealloc].
llvm-svn: 53075
2008-07-03 04:29:21 +00:00
Anders Carlsson 7a241baf2f Shuffle things around in preparation for integrating Eli's constant evaluator.
llvm-svn: 53074
2008-07-03 04:20:39 +00:00
Anders Carlsson ac1d1d1c34 Make APValue an APSInt.
llvm-svn: 53072
2008-07-03 04:00:59 +00:00
Chris Lattner 3f26dc0bf6 new testcase
llvm-svn: 53071
2008-07-03 03:53:40 +00:00
Chris Lattner 1cb0e61e98 Fix PR2252: don't warn on negating an unsigned value ever, and don't emit
'integer constant is so large that it is unsigned' warning for hex literals.

llvm-svn: 53070
2008-07-03 03:47:30 +00:00
Chris Lattner 9ff58d7caf Fix PR2020 by recovering by defining an anonymous enum, instead of recovering
by filling in the body of a union with enum constants.

llvm-svn: 53069
2008-07-03 03:30:58 +00:00
Dan Gohman b261292917 Reapply r52988, "Simplify addRegisterKilled and addRegisterDead." The
254.gap failure was not due to this mod.

llvm-svn: 53068
2008-07-03 01:18:51 +00:00
Dan Gohman 99e6237ba7 Use operator new instead of new char[].
llvm-svn: 53067
2008-07-03 00:59:36 +00:00
Dan Gohman 7722f791f6 Use operator new instead of new char[].
llvm-svn: 53066
2008-07-03 00:53:09 +00:00
Dan Gohman f3c4d7f877 Avoid unnecessarily copying APInt objects.
llvm-svn: 53065
2008-07-03 00:52:03 +00:00
Dan Gohman 4c6db53a36 Correct a comment.
llvm-svn: 53064
2008-07-03 00:51:05 +00:00
Evan Cheng 9f8b66f3f1 Use std::replace instead of std::find and push_back.
llvm-svn: 53063
2008-07-03 00:28:27 +00:00
Devang Patel 7dcfff392a Undo previous patch. It is not that simple to fix dom info here.
llvm-svn: 53062
2008-07-03 00:08:13 +00:00
Evan Cheng 7a265d83bf - Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.

llvm-svn: 53061
2008-07-03 00:07:19 +00:00
Evan Cheng c939f45fe7 commuteInstruction should preserve dead markers.
llvm-svn: 53060
2008-07-03 00:04:51 +00:00
Owen Anderson 30cc028e4a Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.

llvm-svn: 53058
2008-07-02 23:41:07 +00:00
Dan Gohman 22e9707480 Replace a few uses of SelectionDAG::getTargetNode with
SelectionDAG::SelectNodeTo in the instruction selector. This
updates existing nodes in place instead of creating new ones.

Go back to selecting ISD::DBG_LABEL nodes into
TargetInstrInfo::DBG_LABEL nodes instead of leaving them
unselected, now that SelectNodeTo allows us to update them
in place.

llvm-svn: 53057
2008-07-02 23:23:19 +00:00
Ted Kremenek 80025c257f Update test case with new clang arguments.
llvm-svn: 53056
2008-07-02 23:18:57 +00:00
Ted Kremenek e6b2fa5029 Update test case: simply running "clang -checker-simple" doesn't invoke the dead store checker anymore. We need "-warn-dead-stores" as well.
llvm-svn: 53055
2008-07-02 23:18:22 +00:00
Ted Kremenek c7efb536d5 Unify the code path for the Dead Stores checker to always use the BugReporter interface.
llvm-svn: 53054
2008-07-02 23:16:33 +00:00
Ted Kremenek f1f17555bd ccc-analyzer now dispatches the options "-checker-cfref" and "-warn-dead-stores" to clang instead of just "-checker-cfref".
llvm-svn: 53053
2008-07-02 23:16:10 +00:00
Devang Patel 5adfcb5783 Preserve dom info while simplifing loop after the unswitch.
llvm-svn: 53052
2008-07-02 22:58:54 +00:00
Eric Christopher 30f1d3f0db Add a couple more helper functions to deal with
creating global constant strings and pointers
to global constant strings.

llvm-svn: 53051
2008-07-02 22:57:59 +00:00
Dan Gohman 1b46bfecfe Revert r52988. It broke 254.gap on x86-64.
llvm-svn: 53050
2008-07-02 22:12:55 +00:00
Owen Anderson 8c10c2482a TwoAddressInstructionPass doesn't really require LiveVariables, it just needs to update it if it's already around.
llvm-svn: 53049
2008-07-02 21:28:58 +00:00
Ted Kremenek b1d0118a1a Refactored some of the BugReporter interface so that data such as the ASTContext&, PathDiagnosticClient*, can be provided by an external source.
Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism.

llvm-svn: 53048
2008-07-02 21:24:01 +00:00
Chuck Rose III 6d161f1fd3 VStudio x64 build fixes. Looks like the x64 projects got out of date and this brings them up to code. I've built the project with these new vcproj files for win32 and x64 both debug and release.
llvm-svn: 53047
2008-07-02 21:02:51 +00:00
Ted Kremenek 125d4a3b2d GRExprEngine now expects the LiveVariables information to be provided by its creator.
This allows an optimization in AnalysisConsumer where the same LiveVariables information is used between multiple analyses.

llvm-svn: 53046
2008-07-02 20:13:38 +00:00
Owen Anderson abfd3a8162 Use ADCE instead of just DCE. ADCE will better clean up after jump threading,
for instance.

llvm-svn: 53045
2008-07-02 18:42:07 +00:00
Owen Anderson 488b89f608 Use df_ext_iterator to capture the reachable set without allocating an extra set.
Also, move large sets and vectors out of instance variables and onto the stack,
and give them more reasonable sizes.

llvm-svn: 53044
2008-07-02 18:41:09 +00:00
Ted Kremenek d8ca1f6dd9 Added version of CheckDeadStores that accepts a client-provided LiveVariables object.
Modified the DeadStores logic in AnalysisConsumer.cpp to use the LiveVariables object created by the AnalysisManager.

llvm-svn: 53043
2008-07-02 18:39:20 +00:00
Ted Kremenek c3b30340d9 Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST when all of the ASTs in a translation unit have been built.
llvm-svn: 53042
2008-07-02 18:32:45 +00:00
Ted Kremenek f992cfb4ab Moved logic for -dump-cfg and -view-cfg into AnalysisConsumer.
Renamed -dump-cfg to -cfg-dump, and -view-cfg to -cfg-view.  This naming better matches the same options for asts (e.g. -ast-dump).

llvm-svn: 53041
2008-07-02 18:23:21 +00:00
Owen Anderson 6acc782dad Avoid a redundant call.
llvm-svn: 53040
2008-07-02 18:15:31 +00:00
Ted Kremenek bdbe6130f4 Move -dump-live-variables logic to AnalysisConsumer.
llvm-svn: 53039
2008-07-02 18:11:29 +00:00
Owen Anderson 323b5755a6 Add support to ADCE for pruning unreachable blocks. This addresses the final
part of PR2509.

llvm-svn: 53038
2008-07-02 18:05:19 +00:00
Mon P Wang 2cf56ce269 Make the default min align of CreateStackTemporary to be 1
llvm-svn: 53036
2008-07-02 17:50:10 +00:00
Duncan Sands 739a0548c4 Add a new getMergeValues method that does not need
to be passed the list of value types, and use this
where appropriate.  Inappropriate places are where
the value type list is already known and may be
long, in which case the existing method is more
efficient.

llvm-svn: 53035
2008-07-02 17:40:58 +00:00
Owen Anderson 9edcf24da9 Use DenseSet rather than SmallPtrSet for the alive set. Using SmallPtrSet
with a huge "size" parameter is actually quite inefficient.

llvm-svn: 53034
2008-07-02 17:32:04 +00:00
Owen Anderson 286d0c40c3 Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
llvm-svn: 53033
2008-07-02 17:29:59 +00:00
Owen Anderson b22a640fe4 A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.
llvm-svn: 53032
2008-07-02 17:20:16 +00:00