Commit Graph

55464 Commits

Author SHA1 Message Date
Gabor Greif d07987f5b6 add description how the ilist_traits<Instruction> works
llvm-svn: 65732
2009-02-28 22:46:37 +00:00
Chris Lattner faaa7ac1f2 the module is not required to exist, allow it to default, giving this
class a nice default ctor.

llvm-svn: 65731
2009-02-28 22:41:33 +00:00
Chris Lattner 3a5e4d7a2e disable copying and assignment.
llvm-svn: 65730
2009-02-28 22:35:24 +00:00
Chris Lattner 3ad4682b23 expose TypePrinting as a public API.
llvm-svn: 65729
2009-02-28 22:34:45 +00:00
Chris Lattner e2a87a98b3 one less space, fixes failure with rebuilt llvm-gcc.
llvm-svn: 65728
2009-02-28 22:20:02 +00:00
Bill Wendling 050ee8fb8d Fix grammaro.
llvm-svn: 65727
2009-02-28 22:12:54 +00:00
Anders Carlsson 6c885805cd Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like
int a[(int)(1.0 / 1.0) = { 1 } will work.

Eli, please review.
 

llvm-svn: 65725
2009-02-28 21:56:50 +00:00
Chris Lattner 06a2321051 rename 'Result' to 'OS' in CalcTypeName for consistency
llvm-svn: 65724
2009-02-28 21:27:31 +00:00
Chris Lattner e101c44d77 do not embed the raw_ostream into TypePrinting, pass it as an argument to print etc.
llvm-svn: 65723
2009-02-28 21:26:53 +00:00
Chris Lattner 68318b1535 stop calling Type::getDescription().
llvm-svn: 65722
2009-02-28 21:18:43 +00:00
Chris Lattner 2ee62d28c1 simplifications
llvm-svn: 65721
2009-02-28 21:11:05 +00:00
Chris Lattner 24025261d3 Change WriteTypeSymbolic to not put a space out before types, also, remove
the old std::ostream version.

llvm-svn: 65720
2009-02-28 21:05:51 +00:00
Steve Naroff 4f96739122 Remove PrevFunctionScope slot (it isn't needed)...use getParent() instead.
llvm-svn: 65718
2009-02-28 21:01:15 +00:00
Ted Kremenek 111a6bdbd3 Revert 65707 (causes stack memory to be referenced after it is released).
llvm-svn: 65717
2009-02-28 20:50:43 +00:00
Chris Lattner 40959d03cb make CalcTypeName take a stream instead of a string to concat onto,
eliminate redundant opaque handling code.

llvm-svn: 65716
2009-02-28 20:49:40 +00:00
Chris Lattner eb23f87289 remove a bunch of nearly-duplicated code.
llvm-svn: 65715
2009-02-28 20:40:29 +00:00
Chris Lattner 07d8829df9 fix indentation, remove dead integer case.
llvm-svn: 65714
2009-02-28 20:35:42 +00:00
Chris Lattner 765338decf pull calcTypeName into TypePrinting class, make its type stack
be a smallvector instead of vector.

llvm-svn: 65713
2009-02-28 20:34:19 +00:00
Chris Lattner 7b394e87ff inline method into its only use and simplify the result.
llvm-svn: 65712
2009-02-28 20:31:14 +00:00
Chris Lattner 1273471795 simplify condition
llvm-svn: 65711
2009-02-28 20:28:50 +00:00
Chris Lattner 0f57895708 start refactoring the .ll printer: introduce a new TypePrinting class
and move all related stuff to it.

llvm-svn: 65710
2009-02-28 20:25:14 +00:00
Fariborz Jahanian bac73acc24 Obscure code gen bug related to sending
message to 'super' in a class method declared in
cateogy (darwin specific).

llvm-svn: 65709
2009-02-28 20:07:56 +00:00
Chris Lattner 309e48695b Fix a crash in test/Parser/control-scope.c that testrunner didn't
notice because it was a negative test with a fix suggested by
Jean-Daniel Dupas.  Convert the test from a negative to a positive
test to catch stuff like this.

llvm-svn: 65708
2009-02-28 19:37:57 +00:00
Chris Lattner d4ed7e8bb9 remove static ctor.
llvm-svn: 65707
2009-02-28 19:37:06 +00:00
Chris Lattner 3385fe12ce improve compatibility with the VC++'08 C++ compiler. Patch by
Niklas Larsson!

llvm-svn: 65706
2009-02-28 19:01:03 +00:00
Chris Lattner fb23a968ad add a stub for Roadsend PHP
llvm-svn: 65705
2009-02-28 18:58:01 +00:00
Chris Lattner 5a5194fec3 fix inverted conditional, rdar://6633188
llvm-svn: 65704
2009-02-28 18:53:33 +00:00
Chris Lattner a9ca0529a1 "This patch addresses two FIXME on ObjCCategoryImplDecl:
/// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl!
/// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl

It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar).

And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class:  ObjCImplDecl"

Patch by Jean-Daniel Dupas!

llvm-svn: 65703
2009-02-28 18:42:10 +00:00
Chris Lattner 361bfcd932 don't use the word 'aggregate' with constants, it is confusing.
llvm-svn: 65702
2009-02-28 18:32:25 +00:00
Chris Lattner ca05dfef65 brain thinking memcpy, fingers thinking memset :)
llvm-svn: 65701
2009-02-28 18:31:01 +00:00
Chris Lattner 789dee38a5 don't redescribe bitcast constraints in two places. It is not valid to
bitcast from one aggregate to another.

llvm-svn: 65700
2009-02-28 18:27:03 +00:00
Chris Lattner 3ef668c27a after going around in circles a few times, finally cave and emit structure
copies with memcpy instead of memmove.  This matches what GCC does and if it
causes a problem with a particular libc we can always fix it with a target
hook.

llvm-svn: 65699
2009-02-28 18:18:58 +00:00
Chris Lattner bb1fe8abdd reject 0 element vectors with:
@a = internal constant void bitcast(<0 x i8> <> to void)
                                     ^

Fixes PR3685

llvm-svn: 65698
2009-02-28 18:12:41 +00:00
Nick Lewycky cd5b1443bb Update this text for first-class aggregates.
llvm-svn: 65697
2009-02-28 17:30:06 +00:00
Anders Carlsson 5843635b37 TargetInfo::validateAsmConstraint now takes a reference to the full constraints string. This will make it possible to support multi-character constraints. No functionality change (for now).
llvm-svn: 65696
2009-02-28 17:11:49 +00:00
Steve Naroff 70f41d6f07 Minor name change (move the ObjC prefix to a more appropriate place).
llvm-svn: 65695
2009-02-28 16:59:13 +00:00
Steve Naroff d123bd05ca Fix <rdar://problem/6451399> problems with labels and blocks.
- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).  

llvm-svn: 65694
2009-02-28 16:48:43 +00:00
Bill Wendling 638b836aab Fix typo. Found by William Moss.
llvm-svn: 65693
2009-02-28 12:26:34 +00:00
Bill Wendling 6311d06b2f There is a way to specify targets that should succeed. It's the "XTARGET"
keyword.

llvm-svn: 65692
2009-02-28 12:11:01 +00:00
Gabor Greif e57d407fc2 make traits more flexible by splitting out node-related fragment
llvm-svn: 65690
2009-02-28 10:17:32 +00:00
Gabor Greif fda885d048 Adapt help string to what the code is doing (default is lang_gnu99). Thanks rdivacky!
llvm-svn: 65689
2009-02-28 09:22:15 +00:00
Mike Stump 1db7d04b71 First cut CodeGen support for __block variables.
llvm-svn: 65688
2009-02-28 09:07:16 +00:00
Eli Friedman cba899ff7b Check a few more kinds of declarations that make a scope.
llvm-svn: 65680
2009-02-28 06:22:14 +00:00
Evan Cheng 398dee1c4a Last commit accidentially deleted this code.
llvm-svn: 65679
2009-02-28 06:02:14 +00:00
Eli Friedman f69d09bae5 Start of checking for gotos which jump to an illegal destination.
As far as I know, this catches all cases of jumping into the scope of a 
variable with a variably modified type (excluding statement 
expressions) in C.  This is missing some stuff we probably want to check
(other kinds of variably modified declarations, statement expressions, 
indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup 
attribute), the diagnostics aren't very good, and it's not particularly 
efficient, but it's a decent start.

This patch is a slightly modified version of the patch I attached to
PR3259, and it fixes that bug.  I was sort of planning on improving 
it, but I think it's okay as-is, especially since it looks like CodeGen 
doesn't have any use for this sort of data structure.  The only 
significant change I can think of from the version I attached to PR3259 
is that this version skips running the checking code when a function 
doesn't contain any labels.

This patch doesn't cover case statements, which also need similar 
checking; I'm not sure how we should deal with that. Extending the goto 
checking to also check case statements wouldn't be too hard; it's just a 
matter of keeping track of the scope of the closest switch and checking that
the scope of every case is the same as the scope of the switch.  That said, 
it would likely be a performance hit to run this check on every 
function (it's an extra pass over the entire function), so we probably want
some other solution.

llvm-svn: 65678
2009-02-28 05:41:13 +00:00
Eli Friedman a1c7b6c5f6 Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__.  Not sure how I missed this.

llvm-svn: 65677
2009-02-28 03:59:05 +00:00
Ted Kremenek 8a56e5c29b Update checker build.
llvm-svn: 65676
2009-02-28 02:04:49 +00:00
Douglas Gregor 89ee6822d8 Eliminate CXXRecordType
llvm-svn: 65671
2009-02-28 01:32:25 +00:00
Evan Cheng 2f235908ed Avoid unused parameter warning.
llvm-svn: 65670
2009-02-28 01:10:24 +00:00
Douglas Gregor 0ab407d57d Add a FIXME for something I can't look at just yet
llvm-svn: 65669
2009-02-28 01:09:26 +00:00