Commit Graph

3292 Commits

Author SHA1 Message Date
Nuno Lopes 598afdcfe7 allow cast from array to int to be considered as constant
llvm-svn: 63519
2009-02-02 16:07:41 +00:00
Nuno Lopes 8877f99f9d fix PR3459: improve compatibility with gcc when checking for constant exprs
llvm-svn: 63517
2009-02-02 15:00:55 +00:00
Eli Friedman 1f90fe17f9 Fix for PR3447: use padded sizes for computations on struct/union
constants.

llvm-svn: 63491
2009-02-01 08:12:19 +00:00
Daniel Dunbar 5df2b0baaa Remove unused overload of GetFunctionType.
llvm-svn: 63472
2009-01-31 03:05:44 +00:00
Daniel Dunbar a8b7f6bb13 Initialize CGFunctionInfo isVariadic bit correctly.
llvm-svn: 63471
2009-01-31 02:54:56 +00:00
Fariborz Jahanian c22f236e81 Use target alignment API to set objc2's meta-data
alignment.

llvm-svn: 63470
2009-01-31 02:43:27 +00:00
Daniel Dunbar a37249c663 Err, unbreak my previous "no functionality change commit", will fix properly later.
llvm-svn: 63467
2009-01-31 02:20:43 +00:00
Daniel Dunbar 3cd20632ff Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
function/call info.

llvm-svn: 63466
2009-01-31 02:19:00 +00:00
Anders Carlsson d277d790e0 Add sema support for the cleanup attribute.
llvm-svn: 63462
2009-01-31 01:16:18 +00:00
Fariborz Jahanian 0408723269 class meta-data belong to __objc_data section (in objc2
nonfragile abi).

llvm-svn: 63461
2009-01-31 01:07:39 +00:00
Fariborz Jahanian 822082517f Recognize class's visibility attribute and set its linkage
to private extern (in objc2 nonfragile abi).

llvm-svn: 63460
2009-01-31 00:59:10 +00:00
Daniel Dunbar 34aa3ca8c4 x86_64 ABI: Retool classification to compute lo & hi classifications
in terms of where the type resides in the containing object. This is a
more clear embodiement of the spec & fixes a merging issue with
unions. Down to 3/1000 failures.

llvm-svn: 63455
2009-01-31 00:06:58 +00:00
Fariborz Jahanian 75e0351adb Missed another mis-alignment of an objc2 meta-data.
llvm-svn: 63453
2009-01-30 23:51:52 +00:00
Douglas Gregor 576e98cc1e Improve our handling of the second step in a user-defined conversion
sequence. Previously, we weren't permitting the second step to call
copy constructors, which left user-defined conversion sequences
surprisingly broken.

Now, we perform overload resolution among all of the constructors, but
only accept the result if it makes the conversion a standard
conversion. Note that this behavior is different from both GCC and EDG
(which don't agree with each other, either); I've submitted a core
issue on the matter.

llvm-svn: 63450
2009-01-30 23:27:23 +00:00
Anders Carlsson db5a9b675c Turn on -flax-vector-conversions by default, issue a warning whenever one is done. Add a -fnolax-vector-conversions option. Fixes PR2862.
llvm-svn: 63447
2009-01-30 23:17:46 +00:00
Fariborz Jahanian e46e284efd Setting correct alignent for objc2 meta-data.
llvm-svn: 63445
2009-01-30 23:15:42 +00:00
Daniel Dunbar 6a046c64d9 x86_64 ABI: Fix more thinkos, straddling computation for complex was
computing in bytes not bits. We are now down to 22/1000 failures on
the return types tests, and 18 of those are gcc bugs I believe.

llvm-svn: 63438
2009-01-30 22:40:15 +00:00
Douglas Gregor d42a0fb41b Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.

llvm-svn: 63435
2009-01-30 22:26:29 +00:00
Douglas Gregor d14247a9e5 Implement and test aggregate initialization in C++. Major changes:
- Support initialization of reference members; complain if any
  reference members are left uninitialized.
  - Use C++ copy-initialization for initializing each element (falls
  back to constraint checking in C)
  - Make sure we diagnose when one tries to provide an initializer
  list for a non-aggregate.
  - Don't complain about empty initializers in C++ (they are permitted)
  - Unrelated but necessary: don't bother trying to convert the
  decl-specifier-seq to a type when we're dealing with a C++
  constructor, destructor, or conversion operator; it results in
  spurious warnings.

llvm-svn: 63431
2009-01-30 22:09:00 +00:00
Fariborz Jahanian fa57e8e7ab add imag_info section and data (for objc2 nonfragile abi).
llvm-svn: 63430
2009-01-30 22:07:48 +00:00
Daniel Dunbar c35dca92f5 x86_64 ABI: Fix thinko in prev commit, 64-bit vectors should have SSE
class, not integer.

llvm-svn: 63426
2009-01-30 21:50:20 +00:00
Ted Kremenek 378e7fd330 Fix horrible non-termination bug in LiveVariables. The issue was that
the liveness state of block-level expressions could oscillate because
of two issues:
- The initial value before a merge was not always set to "Top"
- The set of live block-level expressions is a union, not an intersection

This fixes <rdar://problem/650084>.

llvm-svn: 63421
2009-01-30 21:35:30 +00:00
Fariborz Jahanian 279abd31a9 Generate list of implemented classes and categories in their
own sections (related to objc2 nonfragile abi).

llvm-svn: 63418
2009-01-30 20:55:31 +00:00
Daniel Dunbar 4d22eaeb44 x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
matches gcc 4.2 (not llvm-gcc).

llvm-svn: 63413
2009-01-30 19:38:39 +00:00
Ted Kremenek 0b0a64830a Move method out-of-line.
llvm-svn: 63412
2009-01-30 19:27:39 +00:00
Fariborz Jahanian 097feda5e0 Code gen. for @protocol expression in the new nonfragile abi.
llvm-svn: 63408
2009-01-30 18:58:59 +00:00
Daniel Dunbar 7da8d0b321 Remove testing -use-x86_64-abi option; current implementation is
robust enough for general use.

llvm-svn: 63406
2009-01-30 18:47:53 +00:00
Daniel Dunbar 890c6b5520 x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.
llvm-svn: 63404
2009-01-30 18:40:10 +00:00
Chris Lattner 1958677ccf " Attached is a patch for TextDiagnosticPrinter that adds an optional
parameter that allows users to omit the printing of the source
location on a diagnostic. So basically it would omit the "abc.c:5:1: "
at the beginning of the line."

Patch by Alexei Svitkine!

llvm-svn: 63396
2009-01-30 17:41:53 +00:00
Douglas Gregor ddb2485eb6 Switch Type::isAggregateType to use the C++ definition of "aggregate
type" rather than the C definition. We do this because both C99 and
Clang always use "aggregate type" as "aggregate or union type", and
the C++ definition includes union types.

llvm-svn: 63395
2009-01-30 17:31:00 +00:00
Anders Carlsson 221483dd4e Make sure to cast the VLA size of array to the type of size_t. Fixes PR3442.
llvm-svn: 63394
2009-01-30 16:41:04 +00:00
Steve Naroff 3b6a4bd891 Simplify/cleanup r63219 (based on Chris review).
llvm-svn: 63393
2009-01-30 14:23:32 +00:00
Daniel Dunbar f5222fa0ad x86_64 ABI: Implement classification for arrays.
- This brings us down to an 8% failure rate on the first 500 return
   types tests (from 12%).

llvm-svn: 63383
2009-01-30 08:09:32 +00:00
Anders Carlsson 02714ed353 Implement constant generation of ImplicitValueInitExprs.
llvm-svn: 63379
2009-01-30 06:13:25 +00:00
Chris Lattner 34beb046ea update for change in API.
llvm-svn: 63363
2009-01-30 01:58:33 +00:00
Douglas Gregor ed8f288708 Eliminated LookupCriteria, whose creation was causing a bottleneck for
LookupName et al. Instead, use an enum and a bool to describe its
contents.

Optimized the C/Objective-C path through LookupName, eliminating any
unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing
some code and arguments that are no longer used.

Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers
over to LookupName, LookupQualifiedName, or LookupParsedName, as
appropriate.

All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and
-disable-free. Plus, we're down to three name-lookup routines.

llvm-svn: 63354
2009-01-30 01:04:22 +00:00
Daniel Dunbar 62dc51c395 Use uint64_t not unsigned for type sizes/offsets.
llvm-svn: 63352
2009-01-30 00:47:38 +00:00
Fariborz Jahanian d9c28b808b Bug fixing involving method-list in protocol meta-data
(objc2 nonfragile-abi).

llvm-svn: 63351
2009-01-30 00:46:37 +00:00
Ted Kremenek 7594e2a59a Fix a couple bugs:
- NonLoc::MakeVal() would use sizeof(unsigned) (literally) instead of consulting
  ASTContext for the size (in bits) of 'int'. While it worked, it was a
  conflation of concepts and using ASTContext.IntTy is 100% correct.
- RegionStore::getSizeInElements() no longer assumes that a VarRegion has the
  type "ConstantArray", and handles the case when uses use ordinary variables
  as if they were arrays.
- Fixed ElementRegion::getRValueType() to just return the rvalue type of its
  "array region" in the case the array didn't have ArrayType.
- All of this fixes <rdar://problem/6541136>

llvm-svn: 63347
2009-01-30 00:08:43 +00:00
Fariborz Jahanian 34fe880648 Random bug fix related to protocl metadata in categories in
non-fragile abi.

llvm-svn: 63343
2009-01-29 23:23:06 +00:00
Ted Kremenek ed90de4caa retain/release checker: When generating summaries for CF/CG functions, allow arguments to "escape" if they are passed to a function containing the terms "InsertValue", "SetValue", or "AddValue". This fixes <rdar://problem/6539791>.
llvm-svn: 63341
2009-01-29 22:45:13 +00:00
Fariborz Jahanian 61cd4b56c3 Set protocol linkage and visibility correctly and
build protocol translation table meta-data (objc2
non-fragile abi).

llvm-svn: 63329
2009-01-29 20:10:59 +00:00
Douglas Gregor bf7207a11f Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension
llvm-svn: 63327
2009-01-29 19:42:23 +00:00
Fariborz Jahanian 56b3b77c7d Protocol meta-data for objc2's non-fragile abi.
Lot more to do in this area.

llvm-svn: 63326
2009-01-29 19:24:30 +00:00
Chris Lattner 409f555400 diags moved, so these casts are no longer needed.
llvm-svn: 63324
2009-01-29 18:49:48 +00:00
Steve Naroff d25adc945e Hack Sema::LookupDeclInScope() to avoid calling Sema::LookupName() when parsing C/ObjC.
This results in a 1.7% improvement for "Cocoa.h". If we can figure out how to return a "Decl *", rather than a Sema::LookupResult(), we will likely bump the speedup from 1.7%->2.5%. I verified this, however couldn't get it to work without breaking a fair number of C++ test cases. Will discuss with Doug offline.

llvm-svn: 63320
2009-01-29 18:09:31 +00:00
Chris Lattner 4b6713ef20 next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc.  Patch by
Anders Johnsen!

llvm-svn: 63318
2009-01-29 17:46:13 +00:00
Douglas Gregor 0202cb406e Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.

llvm-svn: 63317
2009-01-29 17:44:32 +00:00
Douglas Gregor 5169570e28 Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.

llvm-svn: 63315
2009-01-29 16:53:55 +00:00
Douglas Gregor 4f5a889dc6 Suppress a warning
llvm-svn: 63310
2009-01-29 16:09:46 +00:00