Граф коммитов

2240 Коммитов

Автор SHA1 Сообщение Дата
Mike Stump 9c21289a86 Refine codegen for covariant thunks that return references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:03:17 +00:00
Mike Stump c902d22129 Refine return value adjustments for thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 16:59:27 +00:00
Mike Stump 519202d315 Fix documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 16:11:57 +00:00
Mike Stump 4387cd9697 Refine codegen for non-virtual this adjustments for thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 03:16:46 +00:00
Mike Stump 736529e7b6 Add virtual adjustments for this for thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 02:12:59 +00:00
Mike Stump f49ed94751 Add basic codegen for thunks that return values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 23:47:45 +00:00
Mike Stump c5dac4e235 Refine codegen for thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 23:22:01 +00:00
Mike Stump 6a9612f384 Refine vcall/vbase ordering with vtable construction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 20:06:59 +00:00
Anders Carlsson d3379292f9 Get throws limping along, still a bunch of FIXMEs. Too bad we don't support catching anything yet :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 02:27:02 +00:00
Anders Carlsson d313e40ff8 Fix thinko, mangleCXXRtti should obviously take a QualType!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:52:02 +00:00
Anders Carlsson 756b5c4f9d Add CGException.cpp, to be used for exception related code generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:42:31 +00:00
Anders Carlsson 731f7f9583 mangleCXXRtti obviously needs to take a type, what was I thinking...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:26:12 +00:00
Fariborz Jahanian 6fba746486 Patch for destruction of array of objects on block exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 16:22:54 +00:00
Nuno Lopes c6eb131a83 make clang emit undefs for padding of structs and unions instead of zeros. this enables constant compaction optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 11:27:06 +00:00
Chris Lattner d8ee95fd4f optimize out some ifdefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:22:00 +00:00
Chris Lattner d9becd1846 Implement clang support for indirect branch and address of label
using the new LLVM support for this.  This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so).  Until then, lets make it "opt in" :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 23:59:40 +00:00
Fariborz Jahanian d7a4a436ef Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 21:07:28 +00:00
Fariborz Jahanian ae013b9da6 Code gen for array construction - WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:55:41 +00:00
Mike Stump 7d0f5c9ca1 Refactor a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:44:03 +00:00
Chris Lattner 85e74acfcf factor a creation of Int32Ty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:36:47 +00:00
Chris Lattner eb99b01897 random tidying
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 17:39:19 +00:00
Douglas Gregor 457e2815d4 Mangle based on the declaration we're given, not the canonical
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 16:31:34 +00:00
Chris Lattner 67665869cc adjust for a pending LLVM change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:12:07 +00:00
Mike Stump 88e9171fc7 Add mangling for VTTs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:51:46 +00:00
Mike Stump 7809e0d165 Finish off pure virtual function handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 00:35:46 +00:00
Mike Stump 94aff9341e Prep work for putting ___cxa_pure_virtual in the vtables for pure functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 23:46:47 +00:00
Mike Stump 1ae3178842 Refactor code a little.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 23:36:26 +00:00
Douglas Gregor 7d9c3c92c9 Implement proper linkage for explicit instantiation declarations of
inlined functions. For example, given

  template<typename T>
  class string {
    unsigned Len;

  public:
    unsigned size() const { return Len; }
  };

  extern template class string<char>;

we now give the instantiation of string<char>::size
available_externally linkage (if it is ever instantiated!), as
permitted by the C++0x standard.
      



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 23:26:40 +00:00
Mike Stump c4c9045dab __builtin_object_size refinements. Ensure we handle expressions with
side-effects up front, as when we switch to the llvm intrinsic call
for __builtin_object_size later, it will have two evaluations.

We also finish off the intrinsic version of the code so we can just
turn it on once llvm has the intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 22:09:17 +00:00
Douglas Gregor 7ced9c8529 Introduce FunctionDecl::isInlined() to tell whether a function should
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 21:11:48 +00:00
Douglas Gregor 0130f3cc4c Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 21:01:01 +00:00
Daniel Dunbar 7ab1c3ebd0 Set OptimizeForSize LLVM function attribute with -Os.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 19:48:08 +00:00
Daniel Dunbar 45e8423d7d Fix crash when synthesizing property setters when the property type and ivar
type have mismatched Objective-C types.
  - <rdar://problem/7336352> [irgen] crash in synthesized property construction

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 19:21:30 +00:00
Anders Carlsson 8e2efcc267 Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 14:32:27 +00:00
Mike Stump b16d32f74f Prep for future __builtin_object_size refinements. The theory is that
someone will add an llvm intrinsic for us to use, so the optimizer can
figure out the hard cases.  WIP.

For those that want to help, double check with Eric before starting.
He has a bit of code this will plug into.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:39:48 +00:00
Fariborz Jahanian 52f08bcbb8 Add Code gen support for '->*' operator which fell
through the crack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 21:58:25 +00:00
Chandler Carruth 6ade621a6e Switch vtable to linkeonce_odr. Patch by nlewycky.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 17:14:14 +00:00
Douglas Gregor 9f0306d969 assert -> llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 16:27:58 +00:00
Chandler Carruth 9f8eb20320 Update location of DataTypes.h to reflect move in LLVM with r85086.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:37:10 +00:00
Nate Begeman a99f08351b Fix a bug in calculating shufflevector indices when constructing vectors from other vectors.
If I can find it again, I will check in a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 02:26:01 +00:00
John McCall e27ec8ad56 Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 23:03:21 +00:00
Douglas Gregor a2813cec26 Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g., 

  namespace N { int i; }
  int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 18:54:35 +00:00
John McCall 00a1ad9a34 Emit calls using the canonical prototype of the called function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 08:22:42 +00:00
Mike Stump 91cc815ffd Fixup the return type of functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 01:52:13 +00:00
Fariborz Jahanian 8bfd31f9da Complete code gen for '.*' binary expression for
both scalar and aggregates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:57:31 +00:00
John McCall 54e14c4db7 When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
  reference type.  Also, preserve the original spelling of the reference type.
  Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
  the various ObjC TypeLocs.  Preserve the spelling of protocol lists except in
  the canonical form.
* Preserve some level of source type structure on parameter types, but
  canonicalize on the canonical function type.  This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:37:11 +00:00
John McCall 467b27b9a2 Canonicality is a property of qualified types, not unqualified types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 20:10:53 +00:00
Mike Stump d3dd0aeb14 Remove some misguided code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 01:31:24 +00:00
Mike Stump 083c25eea1 Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:49:09 +00:00
Fariborz Jahanian f51dc64f90 Code gen for '.*' binary expressions - WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:45:42 +00:00