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

97 Коммитов

Автор SHA1 Сообщение Дата
Mike Stump 0892099dbc Codegen support for copy helpers for block literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 02:35:30 +00:00
Mike Stump a4f668f3b7 Framework for codegen for copy/dispose helpers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 01:33:24 +00:00
Mike Stump 797b632757 Add codegen support for __block variables to call _Block_object_dispose as necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05 01:23:13 +00:00
Mike Stump 3947de5edd Move some of the CodeGenFunction blocks code up and out. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 18:57:26 +00:00
Douglas Gregor 72564e7327 Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types. 

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved 
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

  TypeOfExpr -> TypeOfExprType
  FunctionTypeProto -> FunctionProtoType
  FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 23:50:07 +00:00
Daniel Dunbar 8958891f5f Add Type::hasPointerRepresentation predicate.
- For types whose native representation is a pointer.

 - Use to replace ExprConstant.cpp:HasPointerEvalType,
   CodeGenFunction::isObjCPointerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 20:52:22 +00:00
Daniel Dunbar 24a9f6e11d Drop uses of isPointerLikeType.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 19:03:24 +00:00
Mike Stump 8a2b4b1c5b CodeGen support for copied BlockDeclRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 23:33:13 +00:00
Daniel Dunbar 0096acf421 Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
global variable) out of GenerateStaticBlockVarDecl. 
 - No intended functionality change.
 - Prep for some mild cleanups and PR3662.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 19:24:29 +00:00
Daniel Dunbar 9834ffbe54 Add low level support for generating invoke instead of calls.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 17:26:39 +00:00
Mike Stump 4e7a1f7682 Add CodeGen support for the helper for BlockDeclRefExprs. The easier
stuff is mostly done.  Move BlockHasCopyDispose up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 20:00:35 +00:00
Douglas Gregor 6ec3668a26 Address Chris's comments regarding C++ name mangling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 23:53:56 +00:00
Anders Carlsson e896d98548 Add CodeGen support for the nodebug attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 08:11:52 +00:00
Douglas Gregor 5f2bfd4811 Add basic support for C++ name mangling according to the Itanium C++
ABI to the CodeGen library. Since C++ code-generation is so
incomplete, we can't exercise much of this mangling code. However, a
few smoke tests show that it's doing the same thing as GCC. When C++
codegen matures, we'll extend the ABI tester to verify name-mangling
as well, and complete the implementation here.

At this point, the major client of name mangling is in the uses of the
new "overloadable" attribute in C, which allows overloading. Any
"overloadable" function in C (or in an extern "C" block in C++) will
be mangled the same way that the corresponding C++ function would be
mangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 00:10:09 +00:00
Daniel Dunbar b4094ea09e Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 20:44:09 +00:00
Anders Carlsson fa1f756f88 Remove the last remnants of the Obj-C EH stack code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 06:07:49 +00:00
Anders Carlsson 4cc1a47033 Add DidCallStackSave variable to CodeGenFunction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 20:20:56 +00:00
Anders Carlsson cc8992021c Reuse case destinations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:46:50 +00:00
Anders Carlsson ad9d00e371 Always check if we can remove branch fixups, even if the cleanup stack is empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:45:15 +00:00
Anders Carlsson 46831a93e1 Misc fixes to the cleanup stack code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:13:37 +00:00
Anders Carlsson bb66f9f2e4 More cleanup stack work, PopCleanupBlock now returns a struct with the switch block and end block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 07:46:24 +00:00
Anders Carlsson d66a9f9019 Split some functions up
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 03:55:35 +00:00
Anders Carlsson 6fc559136b CleanupScope needs to push the cleanup block in its destructor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 03:22:36 +00:00
Anders Carlsson 1093c2c40a Implement support for branch fixups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 01:23:05 +00:00
Anders Carlsson 87eaf17cc8 More cleanup stack work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 00:50:42 +00:00
Anders Carlsson bd6fa3d032 When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 00:16:35 +00:00
Anders Carlsson c71c845fe7 Add support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup blocks if necessary
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 23:50:39 +00:00
Anders Carlsson 6ccc47698d Add plumbing for the cleanup stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:53:43 +00:00
Mike Stump 36a2ada69f Fixup goto codegen in and around VLAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 12:52:26 +00:00
Anders Carlsson 96f214776c Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63879 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 19:43:10 +00:00
Daniel Dunbar 8b1a343b6b Add CodeGenFunction::ConvertTypeForMem forwarding function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 23:03:55 +00:00
Daniel Dunbar 541b63b1a9 Thread CGFunctionInfo construction through CodeGenTypes.
- Inefficient & leaks memory currently, will be cleaned up subsequently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 23:23:47 +00:00
Daniel Dunbar 88b5396b08 More ABI API cleanup.
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and
   EmitFunction{Epi,Pro}log.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 22:03:45 +00:00
Daniel Dunbar 1c1d6074f5 Pull EmitReturnBlock out of FinishFunction and catch unified return
case correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 23:27:52 +00:00
Daniel Dunbar d7d6e6abff Skip emission of final return block if possible (e.g., functions with
a unified return).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:25:20 +00:00
Eli Friedman 4fd0aa5803 Slight cleanup, and fix for va_arg on architectures where va_list is a
struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 17:46:04 +00:00
Daniel Dunbar a782ca76cc Block pointer types are not aggregate types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 02:44:18 +00:00
Anders Carlsson fcdbb93749 Handle typedefs to VLAs (Emit the size expr when we encounter the typedef
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 21:51:53 +00:00
Anders Carlsson 751358ff73 Make sure to generate code for arguments that have a variably modified type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 21:28:43 +00:00
Anders Carlsson 60d3541366 Change EmitVLASize to take a QualType that must be a variably modified type.
Emit the size even if the declared type is a variably modified type. This lets us handle

void f(int n) {
  int (*a)[n];
  
  printf("size: %d\n", sizeof(*a));
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61285 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 20:46:34 +00:00
Anders Carlsson f666b7780d Split up emitting of VLA sizes and getting the size of a VLA.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 20:27:15 +00:00
Anders Carlsson dcc90d87e6 Add map of VLA types and their sizes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 07:19:02 +00:00
Anders Carlsson 64712f196b Change more code over to using the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:46:24 +00:00
Chris Lattner 8ec03f58c3 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:54:41 +00:00
Anders Carlsson ef5a66d817 An expression is not foldable if it can't be fully evaluated. Fixes PR3060
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:32:07 +00:00
Douglas Gregor 2e1cd4264d Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 14:58:09 +00:00
Chris Lattner 6ee7aa154e rename Expr::tryEvaluate to Expr::Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 21:24:15 +00:00
Daniel Dunbar 9615ecb44f Normalize many BasicBlock names.
- Use dotted notation for blocks related to a particular statement
   type.
 - Use .end for landing pads.

No functionality change in NDEBUG mode. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:38:36 +00:00
Daniel Dunbar 36bc14c3a1 Quick fix for crash in IRgen when we can tryEvaluate a condition to
something that is not an int.

 - Ignore these cases for now, added FIXME that we should also boolize
   them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 22:37:10 +00:00
Daniel Dunbar 09b1489903 Handle ?: in EmitBranchOnBoolExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 10:30:32 +00:00