Commit Graph

78254 Commits

Author SHA1 Message Date
Chris Lattner b3d9942c51 remove the DisablePatternForFastISel predicate, which is a check
that predated -fast-isel which attempted to speed up the dag pattern
matchers at -O0.  Since fast-isel is around, this is basically 
obsolete and removing it shrinks the generated dag isels.

llvm-svn: 96188
2010-02-14 21:11:53 +00:00
Chris Lattner dd2ec58276 add an insertion operator.
llvm-svn: 96187
2010-02-14 21:10:33 +00:00
Chris Lattner 78291e3be8 tidy up
llvm-svn: 96186
2010-02-14 21:10:15 +00:00
Ted Kremenek 4853131459 Add LLVM conventions check that scans for AST elements (types, stmts, decls)
that allocate heap memory.

llvm-svn: 96184
2010-02-14 19:09:13 +00:00
Ted Kremenek 988805c81e Change LLVMConventionsChecker to accept an entire translation unit instead
of operating on each code decl.  This exposes two flaws in AnalysisConsumer
that should eventually be fixed:

(1) It is not possible to associate multiple "actions" with a single
    command line argument.  This will require the notion of an
	"analysis" group, and possibly tablegen support.  (although eventually
    we want to support dynamically loading analyses as well)

(2) AnalysisConsumer may not actually be scanning the declarations in namespaces.
    We'll experiment first in LLVMConventionsChecker before changing the
    behavior in AnalysisConsumer.

llvm-svn: 96183
2010-02-14 19:09:05 +00:00
Ted Kremenek 39df94b00d Rework translation unit actions to actually take an entire translation unit
as imput.

llvm-svn: 96182
2010-02-14 19:08:51 +00:00
Ted Kremenek c968e5e9b9 For the StringRef check, also visit the children of DeclStmts.
llvm-svn: 96181
2010-02-14 19:08:43 +00:00
Ted Kremenek 4806a833a7 Place type-checking static methods at type of file (where they will congregate).
No functionality change.

llvm-svn: 96180
2010-02-14 19:08:36 +00:00
Dan Gohman e4e51a63da Fix whitespace.
llvm-svn: 96179
2010-02-14 18:51:39 +00:00
Dan Gohman e7f74bb16c Fix a comment.
llvm-svn: 96178
2010-02-14 18:51:20 +00:00
Dan Gohman bb7d52213c When complicated expressions are broken down into subexpressions
with multiplication by constants distributed through, occasionally
those subexpressions can include both x and -x. For now, if this
condition is discovered within LSR, just prune such cases away,
as they won't be profitable. This fixes a "zero allocated in a
base register" assertion failure.

llvm-svn: 96177
2010-02-14 18:50:49 +00:00
Chris Lattner d0413848cc temporarily revert 96173, it is causing test failures.
llvm-svn: 96176
2010-02-14 18:38:38 +00:00
Sanjiv Gupta d6cbe9f23f fixes to pagesel/banksel inserter.
1. restore these across direct/indirect calls.
2. restore pagesel for any macros with gotos.

llvm-svn: 96175
2010-02-14 18:27:42 +00:00
Anton Korobeynikov 0a5e0371b0 Forgot to commit the header
llvm-svn: 96174
2010-02-14 18:25:41 +00:00
Sanjiv Gupta 1ef8cdd29b renamed pic16 specifiic macros.
llvm-svn: 96173
2010-02-14 18:20:18 +00:00
Chris Lattner 3b38fd6488 follow-on to PR6280
llvm-svn: 96172
2010-02-14 18:20:09 +00:00
Anders Carlsson 033d48697f Don't compute final overriders or build vtables for bases that don't need a vtable.
llvm-svn: 96171
2010-02-14 17:05:59 +00:00
Anton Korobeynikov ce77ce3072 Drop winmcasminfo and use normal AT&T COFF for all windows targets.
Otherwise AT&T asm printer is used with non-compatible MCAsmInfo and
there is no way to override this behaviour.

llvm-svn: 96165
2010-02-14 15:19:54 +00:00
Benjamin Kramer 88ab94e7a3 Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.
llvm-svn: 96164
2010-02-14 14:14:16 +00:00
Daniel Dunbar 02968e53cf CIndex: Switch CXSourceRange to proper half-open intervals.
- Doug, please review.

llvm-svn: 96162
2010-02-14 10:02:57 +00:00
Daniel Dunbar edeb9b87e6 CIndex: Avoid an unnecessary getLocForEndOfToken call, the region of interest
doesn't need to be a full token.
 - Doug, please review.

llvm-svn: 96161
2010-02-14 10:02:42 +00:00
Daniel Dunbar 6092d507f0 c-index-test: Unify and always print half-open extents.
llvm-svn: 96160
2010-02-14 08:32:51 +00:00
Daniel Dunbar eb27e7d999 c-index-test: Simplify file scanning code.
llvm-svn: 96159
2010-02-14 08:32:32 +00:00
Daniel Dunbar 98c07e0e23 c-index-test: Unify syntax for printing extents. Yes, there were 4.
llvm-svn: 96158
2010-02-14 08:32:24 +00:00
Daniel Dunbar 2049933196 CIndex: Simplify (remove provably dead code).
llvm-svn: 96157
2010-02-14 08:32:11 +00:00
Daniel Dunbar 2f4ba179f5 CIndex: Inline CompareRegionOfInterest(CXSourceRange) into sole caller.
llvm-svn: 96156
2010-02-14 08:32:05 +00:00
Daniel Dunbar 80daf53600 Rename translateSourceRange(CXSourceRange) translateCXSourceRange, instead of
having overloaded functions with inverse semantics.

llvm-svn: 96155
2010-02-14 08:31:57 +00:00
Zhongxing Xu be36ecbb60 Fix pr6293. If ptr is NULL, no operation is preformed.
llvm-svn: 96154
2010-02-14 06:49:48 +00:00
Johnny Chen c95a814ec3 Try to factorize the specification of saturating add/subtract operations a bit,
as suggested by Bob Wilson.

llvm-svn: 96153
2010-02-14 06:32:20 +00:00
Dan Gohman 2d0f96d49a Actually, this code doesn't have to be quite so conservative in
the no-TLI case. But it should still default to declining the
transformation.

llvm-svn: 96152
2010-02-14 03:21:49 +00:00
Dan Gohman 6b7517342e In rememberInstruction, if the value being remembered is the
current insertion point, advance the current insertion point.
This avoids a use-before-def situation in a testcase extracted
from clang which is difficult to reduce to a reasonable-sized
regression test.

llvm-svn: 96151
2010-02-14 03:12:47 +00:00
Dan Gohman f446713fd0 Simplify this code; no need for a custom subclass if it doesn't need
to override anything from the parent class.

llvm-svn: 96150
2010-02-14 02:48:58 +00:00
Dan Gohman 6fafffb635 Remove a 'protected' keyword, now that SCEVExpander is no longer
intended to be subclassed.

llvm-svn: 96149
2010-02-14 02:47:26 +00:00
Dan Gohman cb76a806f0 Don't attempt aggressive post-inc uses if TargetLowering is not available,
because profitability can't be sufficiently approximated.

llvm-svn: 96148
2010-02-14 02:45:21 +00:00
Ted Kremenek 184b3383bf Add new static analyzer for checking LLVM coding conventions: -analyzer-check-llvm-conventions
Currently these checks are intended to be largely syntactical, but may get more
sophisticated over time.

As an initial foray into this brave new world, emit a static analyzer warning
when binding a temporary 'std::string' to an 'llvm::StringRef' where the
lifetime of the 'std::string' does not outlive the 'llvm::StringRef'.

llvm-svn: 96147
2010-02-14 02:45:18 +00:00
Ted Kremenek eff72bb134 Two changes to AnalysisConsumer::HandleTopLevelSingleDecl():
(1) Since CXXMethodDecl subclasses FunctionDecl (and CXXDestructorDecl 
and CXXConversion subclass CXXMethodDecl), refactor switch statement 
to handle them all in one spot.

(2) Use 'DeclarationName::getAsString()' to handle all functions that
don't have simple identifiers (fixing a null dereference when scanning
for specific functions).

llvm-svn: 96146
2010-02-14 02:44:52 +00:00
Daniel Dunbar c4b4d3953c CIndex: Kill off CXSourceLocationPtr, and AtEnd arguments.
llvm-svn: 96145
2010-02-14 01:47:36 +00:00
Daniel Dunbar 474b207716 CIndex: Stop hiding magic end bit in CXSourceRange locations where clients can't
see it. Instead, translate the locations up-front when we create a
CXSourceRange.
 - This is part of a move to make CXSourceRange a pure half-open range, which is
   a more natural API for clients to deal with. More cleanups to follow.

llvm-svn: 96144
2010-02-14 01:47:29 +00:00
Daniel Dunbar 3e255dae88 2.7: Note that DataTypes.h moved.
llvm-svn: 96143
2010-02-14 01:47:19 +00:00
John McCall 38200b081a Improve the diagnostic given when referring to a tag type without a tag (in C)
or that's been hidden by a non-type (in C++).

The ideal C++ diagnostic here would note the hiding declaration, but this
is a good start.

llvm-svn: 96141
2010-02-14 01:03:10 +00:00
Anders Carlsson 073a0c88cc Build fix.
llvm-svn: 96140
2010-02-14 00:44:19 +00:00
Anders Carlsson 6a7e6a4c3c Baby steps towards teaching FinalOverriders about virtual bases.
llvm-svn: 96139
2010-02-14 00:37:35 +00:00
Anders Carlsson 1888b44988 Don't try to layout construction vtables for now.
llvm-svn: 96138
2010-02-14 00:22:59 +00:00
Anders Carlsson 258a1e35e8 Improve support for non-virtual 'this' pointer adjustments. With this, it should be possible to use the new vtable layout code for all class hierarchies that do not involve virtual bases.
llvm-svn: 96137
2010-02-14 00:16:19 +00:00
Anders Carlsson d3adb0ced9 Add basic support for simple non-virtual 'this' pointer adjustments.
llvm-svn: 96136
2010-02-13 23:40:17 +00:00
John McCall 0daaf13b97 Make LSR not crash if invoked without target lowering info, e.g. if invoked
from opt.

llvm-svn: 96135
2010-02-13 23:40:16 +00:00
Eric Christopher 843a4cc43c Fix a problem where we had bitcasted operands that gave us
odd offsets since the bitcasted pointer size and the offset pointer
size are going to be different types for the GEP vs base object.

llvm-svn: 96134
2010-02-13 23:38:01 +00:00
Anders Carlsson cce9ee8970 Add support for very simple non-virtual this adjustments in the FinalOverriders class.
llvm-svn: 96133
2010-02-13 23:17:31 +00:00
Anders Carlsson c809cbdc3f Cleanup; remove some duplicated code.
llvm-svn: 96131
2010-02-13 22:39:18 +00:00
Mikhail Glushenkov 32fa169648 Forward parameter options as '-option=parameter'.
Some tools do not like the '-option parameter' form. Should this be
configurable?

llvm-svn: 96130
2010-02-13 22:37:28 +00:00