Commit Graph

59695 Commits

Author SHA1 Message Date
Daniel Dunbar ffe4e63b40 Note that clang follows the MSVC definition for #pragma pack.
llvm-svn: 71725
2009-05-13 21:40:49 +00:00
Evan Cheng ca528538a9 Indentation.
llvm-svn: 71724
2009-05-13 21:39:20 +00:00
Daniel Dunbar 0aef72c697 Add a test case to showcase a difference in #pragma pack handling
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.

llvm-svn: 71723
2009-05-13 21:34:08 +00:00
Bill Wendling f7b83c7ae7 Change MachineInstrBuilder::addReg() to take a flag instead of a list of
booleans. This gives a better indication of what the "addReg()" is
doing. Remembering what all of those booleans mean isn't easy, especially if you
aren't spending all of your time in that code.

I took Jakob's suggestion and made it illegal to pass in "true" for the
flag. This should hopefully prevent any unintended misuse of this (by reverting
to the old way of using addReg()).

llvm-svn: 71722
2009-05-13 21:33:08 +00:00
Anders Carlsson e39935527e Use an iterator type for found_decls_begin/found_decls_end.
llvm-svn: 71721
2009-05-13 21:22:06 +00:00
Anders Carlsson 49d216db15 Add a new, more advanced CheckDerivedToBaseConversion that takes custom diagnostic IDs.
llvm-svn: 71720
2009-05-13 21:11:42 +00:00
Ted Kremenek 3b204e4c2e Add some basic type checking for attributes ns_returns_retained and
cf_returns_retained. Currently this attribute can now be applied to any
Objective-C method or C function that returns a pointer or Objective-C object
type.

Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to
expect that the diagnostics infrastructure will add quotes around the attribute
name when appropriate. Alonq with this change, I modified the places where this
warning is issued to passed the attribute's IdentifierInfo* instead of having a
hard-coded C constant string.

llvm-svn: 71718
2009-05-13 21:07:32 +00:00
Dale Johannesen 3181652363 Handle some additonal cases of external weak globals.
llvm-svn: 71717
2009-05-13 20:55:30 +00:00
Ted Kremenek 2b77677322 Update checker build.
llvm-svn: 71716
2009-05-13 20:49:00 +00:00
Bill Wendling 1d601cdaf4 Move the bookkeeping of the debug scopes back to the place where it
belonged. The variable declaration stuff wasn't happy with it where it
was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it
successfully.

llvm-svn: 71714
2009-05-13 20:33:33 +00:00
Douglas Gregor bbbb02d463 Explicit instantiations of templates now instantiate the definitions
of class members (recursively). Only member classes are actually
instantiated; the instantiation logic for member functions and
variables are just stubs.

llvm-svn: 71713
2009-05-13 20:28:22 +00:00
Anders Carlsson 5879fbd933 Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.
llvm-svn: 71706
2009-05-13 19:49:53 +00:00
Ted Kremenek 4060be74d9 Add PostStmt::getStmtAs(). This unbreaks the build.
llvm-svn: 71701
2009-05-13 19:23:41 +00:00
Ted Kremenek bae777254a Enhance diagnostics value tracking logic for null dereferences and uninitialized values.
llvm-svn: 71700
2009-05-13 19:16:35 +00:00
Ted Kremenek a2d3093da7 Add ExplodedNode utility methods 'getLocationAs()' and 'getFirstPred()'
llvm-svn: 71699
2009-05-13 19:14:06 +00:00
Daniel Dunbar 8a35ef85d8 Driver: Emit an unsupported error on -iframework.
llvm-svn: 71698
2009-05-13 19:05:04 +00:00
Daniel Dunbar ffdb8439d7 ABI handling: Fix invalid assertion, it is possible for a valid
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.

llvm-svn: 71695
2009-05-13 18:54:26 +00:00
Dale Johannesen 9e26d3708a Testcase for 71688.
llvm-svn: 71691
2009-05-13 18:33:24 +00:00
Douglas Gregor f61eca93c0 Improve the semantic checking for explicit instantiations of
templates. In particular:
  - An explicit instantiation can follow an implicit instantiation (we
  were improperly diagnosing this as an error, previously).
  - In C++0x, an explicit instantiation that follows an explicit
  specialization of the same template specialization is ignored. In
  C++98, we just emit an extension warning.
  - In C++0x, an explicit instantiation must be in a namespace
  enclosing the original template. C++98 has no such requirement.

Also, fixed a longstanding FIXME regarding the integral type that is
used for the size of a constant array type when it is being instantiated.

llvm-svn: 71689
2009-05-13 18:28:20 +00:00
Dale Johannesen 69921959b4 Don't generate a select whose operand is load of a weak
external.  These may have address 0 and are not safe
to execute unconditionally.

llvm-svn: 71688
2009-05-13 18:25:07 +00:00
Ted Kremenek 5801f65a52 Fix crasher reported in PR 4209 caused by an invalid summary
generation when EvalObjCMessageExpr() did not resolve the
ObjCInterfaceDecl* for a receiver when the receiver's symbolic value
wasn't being explicitly tracked.

llvm-svn: 71685
2009-05-13 18:16:01 +00:00
Fariborz Jahanian 027b886a99 Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.

llvm-svn: 71683
2009-05-13 18:09:35 +00:00
Chris Lattner 784ae669ab garbage allocation is not a good idea :)
llvm-svn: 71680
2009-05-13 18:02:09 +00:00
John Mosby ce06bb8a53 PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standard
llvm-svn: 71678
2009-05-13 17:52:11 +00:00
Chris Lattner 149546a6a0 calls in nothrow functions can be marked nothrow even if the callee
is not known to be nothrow.  This allows readnone/readonly functions
to be deleted even if we don't know whether the callee can throw.

llvm-svn: 71676
2009-05-13 17:39:14 +00:00
Chris Lattner 939952c19c remove the obsolete -fprint-source-range-info option
llvm-svn: 71675
2009-05-13 17:08:18 +00:00
Fariborz Jahanian 1880136520 Removed 4-letter :) word in comment.
Used simple array for Selector build.

llvm-svn: 71674
2009-05-13 16:19:02 +00:00
Ted Kremenek 4554f9b134 Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs && "Arg access out of range!").
For format string checking, only check the type of the format
specifier for non-vararg functions.

llvm-svn: 71672
2009-05-13 16:06:05 +00:00
Sanjiv Gupta 4a71ae268b Run through the list of globals once and sectionize all types of globlas includeing declarations. Later emit them from their section lists.
llvm-svn: 71661
2009-05-13 15:13:17 +00:00
Duncan Sands ef8c8ec457 Fix typo.
llvm-svn: 71656
2009-05-13 13:13:18 +00:00
Duncan Sands 7e3c9e1bd9 Avoid getting a compiler warning
IVUsers.cpp: In member function ‘bool llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*)’:
 IVUsers.cpp:221: warning: ‘isSigned’ may be used uninitialized in this function
with gcc-4.3.

llvm-svn: 71654
2009-05-13 12:52:44 +00:00
Ted Kremenek 051a03d698 Fix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added autorelease tracking.
llvm-svn: 71647
2009-05-13 07:12:33 +00:00
Chris Lattner fce7bc924e add IVUsers.cpp
llvm-svn: 71646
2009-05-13 06:28:04 +00:00
Chris Lattner 1bc26286ef add ShrinkWrapping.cpp
llvm-svn: 71645
2009-05-13 06:27:38 +00:00
Chris Lattner 7e335a763a Fix PR4206 - crash in simplify lib calls
llvm-svn: 71644
2009-05-13 06:26:11 +00:00
Chris Lattner ff96dd0301 Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
llvm-svn: 71643
2009-05-13 06:10:29 +00:00
Chris Lattner c898a68998 convert test to use -verify
llvm-svn: 71642
2009-05-13 06:07:25 +00:00
Chris Lattner cfd0fadc75 rename test
llvm-svn: 71641
2009-05-13 06:07:04 +00:00
Chris Lattner b70f3de625 Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers.  This should 
probably be rethought, I'll file a bugzilla.

llvm-svn: 71640
2009-05-13 05:13:44 +00:00
Chris Lattner df24298b40 reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
rdar://6880104

llvm-svn: 71639
2009-05-13 05:02:08 +00:00
Chris Lattner 5868c03191 eli correctly points out that this code is dead, just rip it out for
now until someone does it right

llvm-svn: 71638
2009-05-13 04:52:12 +00:00
Chris Lattner afde259240 implement __sync_synchronize and __sync_lock_release,
rdar://6880573

llvm-svn: 71637
2009-05-13 04:46:13 +00:00
Chris Lattner 94578cba76 add support for __sync_nand_and_fetch and __sync_fetch_and_nand,
rdar://6880573

llvm-svn: 71636
2009-05-13 04:37:52 +00:00
Lang Hames 8d4636d516 Fix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regB
operand was killed, the kill needs to be removed from regB's VarInfo.

llvm-svn: 71635
2009-05-13 04:18:47 +00:00
Chris Lattner e2df3f9fe5 Fix rdar://6880874 - [sema] crash on array types with different index sizes
llvm-svn: 71634
2009-05-13 04:12:56 +00:00
Chris Lattner 851eb927d7 Fix rdar://6881069, a crash on a form of vector_size that we
don't support.  While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.

llvm-svn: 71633
2009-05-13 04:00:12 +00:00
Dan Gohman e712a2f663 Add three new helper routines, getNoopOrZeroExtend,
getNoopOrSignExtend, and getTruncateOrNoop. These are similar
to getTruncateOrZeroExtend etc., except that they assert that
the conversion is either not widening or narrowing, as
appropriate. These will be used in some upcoming fixes.

llvm-svn: 71632
2009-05-13 03:46:30 +00:00
Chris Lattner 46813bbfa2 Fix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
by using the appropriate CGM interface instead of directly creating a global.

llvm-svn: 71617
2009-05-13 02:50:56 +00:00
Chris Lattner f160b5f9e1 When we expect two arguments but have zero, make sure to add
two empty arguments.  Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.

This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion

llvm-svn: 71616
2009-05-13 00:55:26 +00:00
Fariborz Jahanian d9d6e6e039 Changed wording of warning when attribute is on
method definition.

llvm-svn: 71615
2009-05-13 00:47:33 +00:00