Commit Graph

63894 Commits

Author SHA1 Message Date
Anders Carlsson f814ee6003 Handle zero width bit fields in unions correctly (by ignoring them).
llvm-svn: 76847
2009-07-23 04:00:39 +00:00
Anders Carlsson 697f65943d Implement union layout support.
llvm-svn: 76846
2009-07-23 03:43:54 +00:00
Anders Carlsson 307846fe67 Check in CGRecordLayoutBuilder which is a reimplementation of the record layout code. (Yay, no more packed structs unless absolutely necessary). We currently don't use the layouts being built but that will change when the new code is mature enough :)
llvm-svn: 76845
2009-07-23 03:17:50 +00:00
Daniel Dunbar a244814e6f These IRgen improvements have been done.
Technically we could still do a bit more to avoid deferred generation of statics
which we know are used, but I seriously doubt this is important.

llvm-svn: 76844
2009-07-23 03:03:07 +00:00
Eric Christopher b1b77ca862 Support insertps via the intrinsic and add a couple of simple
testcases to make sure it's being generated.

llvm-svn: 76843
2009-07-23 02:22:41 +00:00
Sanjiv Gupta 56df1e7969 Do not call getMangledName on Intrinsics.
llvm-svn: 76842
2009-07-23 02:11:04 +00:00
Devang Patel 6292003492 MDString
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.

llvm-svn: 76841
2009-07-23 02:00:51 +00:00
Eric Christopher 327cb795a1 Add test for pinsrd and pinsrb instructions.
llvm-svn: 76840
2009-07-23 01:58:04 +00:00
Andreas Bolka 897e68c660 Minor cosmetics: indentation, formatting, naming.
llvm-svn: 76839
2009-07-23 01:57:06 +00:00
Reid Kleckner 921673225c Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Zhongxing Xu 57421f3e0f add header for 'memset'.
llvm-svn: 76837
2009-07-23 01:38:47 +00:00
Devang Patel c698122d34 Silence "uninitialized use" warning.
llvm-svn: 76836
2009-07-23 01:36:16 +00:00
Devang Patel 8392e3ba37 Hide constructors.
llvm-svn: 76835
2009-07-23 01:19:53 +00:00
Devang Patel e059ba6ed2 Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Ted Kremenek c5b4c0ec64 Add initial implementation of checking for uses of floating point as a loop counter.
llvm-svn: 76833
2009-07-23 01:07:19 +00:00
Ted Kremenek 4cd5577cdf Add instance predicate method to match static method.
llvm-svn: 76832
2009-07-23 01:06:10 +00:00
Ted Kremenek 5939402e2c Add 'previsit' Checker pass for ObjCMessageExprs.
llvm-svn: 76831
2009-07-23 01:05:31 +00:00
Steve Naroff 8e6aee5821 Remove a bunch of FIXME's related to ObjC type checking.
- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible(). 
- Tweak several test cases to accommodate the new/improved type checking.

llvm-svn: 76830
2009-07-23 01:01:38 +00:00
Eric Christopher fef8db605d Fix error message for correct opcode.
llvm-svn: 76829
2009-07-23 01:01:32 +00:00
Reid Kleckner 1a722d9b73 Make the JIT code emitter properly retry and ask for more memory when it runs
out of memory, and also make the default memory manager allocate more memory
when it runs out.

Also, switch function stubs and global data over to using the BumpPtrAllocator.

This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs.  I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.

llvm-svn: 76828
2009-07-23 00:49:59 +00:00
Fariborz Jahanian 0228bc1a41 Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.

llvm-svn: 76826
2009-07-23 00:42:24 +00:00
Reid Kleckner 5bd6105d65 Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
malloc, so there should be no functional changes to other code.

These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.

I also added some tests which helped me pinpoint some bugs.

llvm-svn: 76825
2009-07-23 00:30:41 +00:00
Mike Stump 671cc00ce1 Fix case, apparently some people still build on case sensitive
filesystems.

llvm-svn: 76824
2009-07-23 00:20:25 +00:00
Dan Gohman b215100c7c Revert r75663 (and r76805), as it is causing regressions on powerpc.
llvm-svn: 76823
2009-07-23 00:09:46 +00:00
Mike Stump 33979f75a0 Add warning for falling off the end of a function that should return a
value.  This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall).  I believe there should be very few false positives, though
the most interesting case would be:

  int() { bar(); }

when bar does:

  bar() { while (1) ; }

Here, we assume functions return, unless they are marked with the
noreturn attribute.  I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.

If anyone spots other false positives, let me know!

llvm-svn: 76821
2009-07-22 23:56:57 +00:00
Douglas Gregor e93e46c690 Implement support for out-of-line definitions of the class members of class
templates, e.g.,

  template<typename T>
  struct Outer {
    struct Inner;
  };

  template<typename T>
  struct Outer<T>::Inner {
    // ...
  };

Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.

There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.

llvm-svn: 76820
2009-07-22 23:48:44 +00:00
Chris Lattner d2aeef0703 remove SectionFlags::Small: it is only used on Xcore, and we'll find
a better solution for it in the future.

llvm-svn: 76818
2009-07-22 23:27:22 +00:00
Dan Gohman 824ab40381 x86 isel tweak: use lea (%reg,%reg) instead of lea (,%reg,2).
llvm-svn: 76817
2009-07-22 23:26:55 +00:00
Eli Friedman f32f0a7146 Fix test breakage.
llvm-svn: 76816
2009-07-22 23:24:42 +00:00
Argyrios Kyrtzidis 3a24c4aa00 Change Preprocessor to keep a copy of LangOptions instead of reference, like ASTContext.
Now when creating a Preprocessor we can pass it a temporary LangOptions object instead of having to remember to keep it around.

llvm-svn: 76815
2009-07-22 23:13:42 +00:00
Mike Stump 8dd1b6bd10 Improve CFG support for C++ throw expressions.
llvm-svn: 76814
2009-07-22 22:56:04 +00:00
Mike Stump 24cbfc370b Prep for new warning.
llvm-svn: 76813
2009-07-22 22:55:09 +00:00
Dan Gohman cc1cd6f484 Add new keywords to the vim syntax highlighting.
llvm-svn: 76812
2009-07-22 22:45:50 +00:00
Dan Gohman 3a353a61fc Add new optimization keywords to the polygen grammar.
llvm-svn: 76811
2009-07-22 22:45:30 +00:00
Dan Gohman 902dfff8b6 Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.

llvm-svn: 76810
2009-07-22 22:44:56 +00:00
Ted Kremenek bfd28fd596 Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.
Educate GRExprEngine::VisitGraph() about 'PreStmt'.

Mark the constructor of 'PostStmt' to be explicit, preventing implicit
conversions and the selection of the wrong 'generateNode' method in
GRStmtNodeBuilder.

Constify a bunch of arguments, which falls out of the changes to ProgramPoint.

llvm-svn: 76809
2009-07-22 22:35:28 +00:00
David Greene 1164d1f283 Reorder if-else branches as suggested by Bill.
llvm-svn: 76808
2009-07-22 22:32:19 +00:00
Eli Friedman 6aea57560f Slight code reorganization to allow instantiating post-inc/dec.
llvm-svn: 76807
2009-07-22 22:25:00 +00:00
David Goodwin a0b2dc93b5 Fix typo in addrmode definition.
llvm-svn: 76806
2009-07-22 22:24:31 +00:00
Dan Gohman cdbef5f2c0 Add -march=ppc32 lines so that this test doesn't ever default to ppc64.
llvm-svn: 76805
2009-07-22 22:08:31 +00:00
Douglas Gregor 1a7ba62e3a Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order of evaluation of their arguments to be correct.
llvm-svn: 76804
2009-07-22 22:05:02 +00:00
Evan Cheng e270d4a4dd Use getTargetConstant instead of getConstant since it's meant as an constant operand.
llvm-svn: 76803
2009-07-22 22:03:29 +00:00
Dan Gohman c510293251 Make the grep line in this test more specific, to avoid
unintended matches.

llvm-svn: 76802
2009-07-22 22:02:42 +00:00
David Greene e88680e33e Constify the key in Mi2IndexMap.
llvm-svn: 76801
2009-07-22 21:56:14 +00:00
Ted Kremenek b8725e2099 Use SaveAndRestore in 'clang/Analysis/Support/SaveAndRestore.h'
llvm-svn: 76800
2009-07-22 21:52:10 +00:00
Evan Cheng d2d52d1906 Ignore undef uses.
llvm-svn: 76799
2009-07-22 21:51:42 +00:00
Ted Kremenek 5b9b066aeb Add AssumeDual method.
llvm-svn: 76798
2009-07-22 21:51:00 +00:00
Ted Kremenek 915c351496 Migrate the path-sensitive checking of 'nonnull' arguments over to the new
'Checker' interface. An updated test case illustrates that after calling a
function with the 'nonnull' attribute we now register the fact that the passed
pointer must be non-null. This retention of information was not possible with
the previously used GRSimpleAPICheck interface.

llvm-svn: 76797
2009-07-22 21:46:56 +00:00
Eli Friedman 3af2a77717 Fix the parsing of default arguments for inline member function
definitions.

I'm not very familiar with this code, so please review.

llvm-svn: 76796
2009-07-22 21:45:50 +00:00
Ted Kremenek b1c170e64b Make 'SaveAndRestore' and friends reusable classes in libAnalysis.
llvm-svn: 76795
2009-07-22 21:45:16 +00:00