Commit Graph

81 Commits

Author SHA1 Message Date
Daniel Dunbar 4184ac847f Update to use hasAttr() instead of getAttr().
- No functionality change.

llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Chris Lattner 6bc4aaa2eb Make messages consistent.
llvm-svn: 68756
2009-04-10 00:37:08 +00:00
Chris Lattner 5286e774ee reject codegen of __thread variables as unimplemented, rdar://6775265
llvm-svn: 68755
2009-04-10 00:35:59 +00:00
Anders Carlsson 80f97ab08f Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)
llvm-svn: 68593
2009-04-08 04:48:15 +00:00
Sanjiv Gupta 639f2d92f8 Don't use static globals for params as it confuses the optimzer that their values are never being used in the function.
llvm-svn: 68328
2009-04-02 17:51:27 +00:00
Anders Carlsson f7e01ffa4a When compiling C++ code, always mangle the names of static block var decls.
llvm-svn: 68280
2009-04-02 03:29:47 +00:00
Fariborz Jahanian ed308a94da Code gen does not yet supports __asm__ on a variable
declaration. Reject it.

llvm-svn: 68058
2009-03-30 20:32:06 +00:00
Chris Lattner e09ad90882 don't set the name of a call instruction to "call" in release-asserts
build.  This shaves another 3% off.

llvm-svn: 67460
2009-03-22 00:32:22 +00:00
Chris Lattner 47640221da fix CreateTempAlloca to not set a name on the alloca for temporaries
in release-assert builds.  For automatic variables, explicitly set
a name with setName that does not make a temporary std::string.

This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6%

llvm-svn: 67459
2009-03-22 00:24:14 +00:00
Mike Stump efd7caa825 Fixup codegen for nested block literals so that we generate
copy_helpers and dispose_helpers as necessary for them.

llvm-svn: 67453
2009-03-21 21:00:35 +00:00
Mike Stump 692c6e3729 Fix codegen for support for super inside block literal expressions.
llvm-svn: 67406
2009-03-20 21:53:12 +00:00
Sanjiv Gupta 06cc45ec85 Mangle param names with .arg. only.
llvm-svn: 66343
2009-03-07 18:09:52 +00:00
Mike Stump 90d8daf592 Remove some FIXMEs for block literals that should be close to working.
llvm-svn: 66322
2009-03-07 06:04:31 +00:00
Mike Stump f89230d93b Complete __Block_byref_id_object_copy cogegen for block literals.
llvm-svn: 66257
2009-03-06 06:12:24 +00:00
Mike Stump fbe25dd1e4 Finish off __Block_byref_id_object_dispose codegen for block literals.
llvm-svn: 66247
2009-03-06 04:53:30 +00:00
Mike Stump 846bf9a797 Remove extra arg.
llvm-svn: 66243
2009-03-06 02:45:21 +00:00
Mike Stump ee2a5ee5f7 More codegen support for the copy/dispose helpers for block literals.
llvm-svn: 66241
2009-03-06 02:29:21 +00:00
Mike Stump 0c74327715 Framework for codegen for copy/dispose helpers.
llvm-svn: 66231
2009-03-06 01:33:24 +00:00
Daniel Dunbar f804897ee9 Don't mangle names of local variables.
- For one thing, this adds unneeded overhead; for another, this
   routine can be used to emit unnamed decls which we shouldn't try to
   mangle.

llvm-svn: 66212
2009-03-05 22:59:19 +00:00
Mike Stump 4446dcf061 prep work for copy/destroy helpers for block literals.
llvm-svn: 66159
2009-03-05 08:32:30 +00:00
Mike Stump cd1280b405 Avoid dispose calls when only doing gc.
llvm-svn: 66126
2009-03-05 02:34:38 +00:00
Mike Stump 626aecc4be Add codegen support for __block variables to call _Block_object_dispose as necessary.
llvm-svn: 66117
2009-03-05 01:23:13 +00:00
Eli Friedman 3efa41a478 Continuation of PR3687: fix more places to use the right type for
booleans.

llvm-svn: 66012
2009-03-04 04:25:14 +00:00
Eli Friedman a1493b3b4d Comment fix: change a question to an answer.
llvm-svn: 66010
2009-03-04 04:22:58 +00:00
Mike Stump 97d01d50d9 Improved ABI compliance for __block variables. No testcases yet as we
still give an unsupported error for them due to the fact this is a
work in progress.

llvm-svn: 66007
2009-03-04 03:23:46 +00:00
Mike Stump 1db7d04b71 First cut CodeGen support for __block variables.
llvm-svn: 65688
2009-02-28 09:07:16 +00:00
Daniel Dunbar 1cdbc5404b Allow constant initializers to reference their defining decl.
- PR3662.

llvm-svn: 65472
2009-02-25 20:08:33 +00:00
Daniel Dunbar a374e60e57 Fold GeneraticStaticBlockVarDecl into callers.
- No functionality change.

llvm-svn: 65470
2009-02-25 19:45:19 +00:00
Daniel Dunbar 22a87f94a9 Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
global variable) out of GenerateStaticBlockVarDecl. 
 - No intended functionality change.
 - Prep for some mild cleanups and PR3662.

llvm-svn: 65466
2009-02-25 19:24:29 +00:00
Eli Friedman 34ef305759 Last part of PR3254: use the same alignment computation in Sema and
CodeGen.  I'm not sure whether this actually makes any visible 
difference, but it's better to be consistent anyway.

llvm-svn: 65259
2009-02-22 03:23:43 +00:00
Mike Stump f5a5c4fa11 Fix spacing.
llvm-svn: 65089
2009-02-20 00:19:45 +00:00
Douglas Gregor 5f361c9f1e Address Chris's comments regarding C++ name mangling.
llvm-svn: 64984
2009-02-18 23:53:56 +00:00
Daniel Dunbar 38ad1e6138 Change EmitConstantExpr to allow failure.
IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.

This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.

llvm-svn: 64780
2009-02-17 18:43:32 +00:00
Daniel Dunbar f9f039865f Set constant bit on static block vars as well. Patch by Anders Johnson!q
llvm-svn: 64502
2009-02-13 22:58:39 +00:00
Daniel Dunbar 128a138a57 IRgen support for attribute used.
- PR3566

llvm-svn: 64492
2009-02-13 22:08:43 +00:00
Anders Carlsson 63784f4e5e Add CodeGen support for the nodebug attribute.
llvm-svn: 64445
2009-02-13 08:11:52 +00:00
Douglas Gregor 5fec5b0495 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.

llvm-svn: 64413
2009-02-13 00:10:09 +00:00
Daniel Dunbar 53bf741208 Honor attribute section on static block var decls.
llvm-svn: 64411
2009-02-12 23:32:54 +00:00
Sanjiv Gupta e99ad00fd2 Function parameters for PIC16 are like local variables. So use the keyword ".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently.
llvm-svn: 64198
2009-02-10 04:17:25 +00:00
Anders Carlsson 15949b3a32 Use the new cleanup infrastructure for VLAs. The next iteration of patches will remove the old Obj-C EH cleanup code.
llvm-svn: 64161
2009-02-09 20:41:50 +00:00
Anders Carlsson cadb9a6a34 Emit a cleanup block for the cleanup attribute
llvm-svn: 64052
2009-02-07 23:51:38 +00:00
Mike Stump 1d91dd98ad Fixup goto codegen in and around VLAs.
llvm-svn: 64014
2009-02-07 12:52:26 +00:00
Anders Carlsson 31f8649f83 Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.
llvm-svn: 63879
2009-02-05 19:43:10 +00:00
Sanjiv Gupta c1b58d40e6 Targets that don't have stack use global address space for parameters.
Specify external linkage for such globals so that llvm optimizer do
not assume there values initialized as zero.

llvm-svn: 63636
2009-02-03 18:07:49 +00:00
Eli Friedman 7139af42ce Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is 
different from Expr::isEvaluatable.  Also get rid of a parameter that is both 
unused and inaccurate.

llvm-svn: 62951
2009-01-25 02:32:41 +00:00
Chris Lattner 8a42586c54 more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.

llvm-svn: 62316
2009-01-16 07:36:28 +00:00
Eli Friedman f4084708cd Make VLAs usable, and make basic usage work correctly. Also, add a
simple test that actually does VLA codegen.

Note that despite the fact that the alloca isn't in the entry block, it 
should dominate all uses; this is guaranteed by the restrictions on goto 
into VLA scope in C99.

llvm-svn: 61291
2008-12-20 23:11:59 +00:00
Anders Carlsson 5d985f5f16 Handle typedefs to VLAs (Emit the size expr when we encounter the typedef
llvm-svn: 61290
2008-12-20 21:51:53 +00:00
Anders Carlsson 8a01b79274 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));
}

llvm-svn: 61285
2008-12-20 20:46:34 +00:00
Anders Carlsson e388a5bf44 Split up emitting of VLA sizes and getting the size of a VLA.
llvm-svn: 61284
2008-12-20 20:27:15 +00:00