Commit Graph

1245 Commits

Author SHA1 Message Date
Anders Carlsson 617482c666 Actually generate code for the simple constructors we know we can generate code for.
llvm-svn: 69222
2009-04-15 21:02:13 +00:00
Daniel Dunbar 4b68d26a93 Don't use \01 in symbol name if unnecessary.
- This was particularly bad since I fixed one instance of this name
   and not another, meaning we got an LLVM module with the same
   effective name in two different globals!

llvm-svn: 69205
2009-04-15 19:52:32 +00:00
Daniel Dunbar 24645c9ff4 Fix alignment on obj_msgrefs to match llvm-gcc.
llvm-svn: 69199
2009-04-15 19:04:46 +00:00
Daniel Dunbar e60aa05d34 Add test case for superrefs section (and make spacing consistent).
llvm-svn: 69198
2009-04-15 19:03:14 +00:00
Fariborz Jahanian f5e8ddd550 __objc_superrefs belongs to __DATA segment.
llvm-svn: 69170
2009-04-15 16:31:36 +00:00
Anders Carlsson f747524819 Start attempting to generate code for C++ ctors.
llvm-svn: 69168
2009-04-15 15:55:24 +00:00
Anders Carlsson e4c40c8baf Add support for mangling C++ constructors. Review appreciated (I'm looking at you, Doug)
llvm-svn: 69150
2009-04-15 05:36:58 +00:00
Anders Carlsson 375d6beb6c Add CGCXX.h with ctor/dtor type enumerations. No functionality change.
llvm-svn: 69137
2009-04-15 04:36:55 +00:00
Anders Carlsson c483bd0724 Simplify CodeGenFunction::GenerateCode.
llvm-svn: 69134
2009-04-15 04:10:19 +00:00
Daniel Dunbar b25452a98e Tweaks to Objective-C metadata (32 & 64-bit) to match llvm-gcc.
- Set alignment on property lists.
 - 32-bit:
   o Set section on property lists.
   o Fix section name for category class methods.
   o Fix symbol name for property lists.
   o Fix section name for class method.
   o Set alignment and section on class extension structure.
   o Set alignment on a number of things: instance variables, methods,
   method descriptions, the symbols structure.
 - 64-bit:
   o Fix section flags for protocol list.

I doubt most of these were problems in practice, but it is nice to
match llvm-gcc.

llvm-svn: 69132
2009-04-15 02:56:18 +00:00
Daniel Dunbar 3241fae46c Set alignment on __cstring metadata variables to 1 (matching
llvm-gcc).

llvm-svn: 69097
2009-04-14 23:14:47 +00:00
Daniel Dunbar 729df96bf5 Avoid use of magic \01 prefix when unneeded.
llvm-svn: 69093
2009-04-14 22:44:26 +00:00
Daniel Dunbar 346892aafc Comment fix.
llvm-svn: 69091
2009-04-14 22:41:13 +00:00
Chris Lattner 28549de12c remove dead enum
llvm-svn: 69070
2009-04-14 20:30:29 +00:00
Chris Lattner bae0e68930 Fix PR3988: extern inline functions get strong symbol definitions in
C99 mode.  This is a regression from an earlier patch of mine.

This also simplifies the linkage enums a bit.

llvm-svn: 69069
2009-04-14 20:25:53 +00:00
Fariborz Jahanian 899e7eb6c7 Do not dead code strip global meta-data objects.
This will match gcc's behavior in the arena.

llvm-svn: 69061
2009-04-14 18:41:56 +00:00
Mike Stump d73e4419f5 Fixup whitespacing.
llvm-svn: 69055
2009-04-14 18:24:37 +00:00
Daniel Dunbar 4527d30c3d Fix comment.
llvm-svn: 69053
2009-04-14 17:42:51 +00:00
Anders Carlsson a5d077df73 Support code generation of 'this' exprs
llvm-svn: 69050
2009-04-14 16:58:56 +00:00
Chris Lattner 02e987f3e8 implement codegen support for __attribute((__gnuc_inline__)),
pulling some attribute munging stuff into GetLinkageForFunction.

This should fix PR3986

llvm-svn: 69045
2009-04-14 16:44:36 +00:00
Daniel Dunbar 389325715b Refactor how attributes are set on values.
- Pull out SetCommonAttributes, which handles the things common to
   aliases, methods, functions, and variables.

 - Pull out SetLLVMFunctionAttributesForDefinition, which handles the
   LLVM attributes which we only want to apply to a definition (like
   noinline and alwaysinline).

 - Kill SetGVDeclarationAttributes (inlined into SetFunctionAttributes
   and specialized).

 - Kill SetFunctionAttributesForDefinition (inlined into sole caller).

 - Inline SetGVDefinitionAttributes into SetMethodAttributes and
   specialize.

 - Rename SetGVDefinitionAttributes to SetFunctionDefinitionAttributes.

This is supposed to be a no functionality change commit, but I may
have made a mistake.

llvm-svn: 69036
2009-04-14 08:05:55 +00:00
Daniel Dunbar 81a3f1bdf3 Split SetGlobalValueAttributes into definition/declaration halves.
- No functionality change.

llvm-svn: 69035
2009-04-14 07:19:20 +00:00
Daniel Dunbar aeddffc99d Rename (one) SetFunctionAttributes to SetLLVMFunctionAttributes to
disambiguate it.
 - No functionality change.

llvm-svn: 69034
2009-04-14 07:08:30 +00:00
Daniel Dunbar 64a41cb39e Reduce indentation, no functionality change.
llvm-svn: 69033
2009-04-14 07:02:17 +00:00
Chris Lattner 92028dad66 defer emission of always_inline, extern_inline, and inline functions (when
not in c89 mode).

llvm-svn: 69032
2009-04-14 06:44:48 +00:00
Chris Lattner 169a5c963f give always_inline functions internal linkage. If they cannot be
inlined for some reason, then we don't want a strong or even weak
definition.

llvm-svn: 69031
2009-04-14 06:32:05 +00:00
Chris Lattner 256c9507c8 set the linkage of an inline function according to its language rules.
llvm-svn: 69030
2009-04-14 06:27:57 +00:00
Daniel Dunbar 29eff88fc8 Add a comment on SetGlobalValueAttributes.
llvm-svn: 69029
2009-04-14 06:19:49 +00:00
Chris Lattner 3e031f4121 add a new enum type for linkage, no functionality change.
llvm-svn: 69028
2009-04-14 06:04:17 +00:00
Daniel Dunbar f5f359fb73 Clean up handling of visibility.
llvm-svn: 69027
2009-04-14 06:00:08 +00:00
Chris Lattner 73920ce565 reduce indentation, no functionality change.
llvm-svn: 69026
2009-04-14 05:33:52 +00:00
Chris Lattner 6a0f907a5e do not set visibility on "private" or "available externally" linkage objects.
llvm-svn: 69025
2009-04-14 05:27:13 +00:00
Mike Stump 4c0dc0e48a Use hasAttr instead of getAttr for conditionals.
llvm-svn: 69021
2009-04-14 02:45:29 +00:00
Daniel Dunbar 0ca1660129 Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

 - See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
  extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.

llvm-svn: 69020
2009-04-14 02:25:56 +00:00
Mike Stump ca5ae66122 Fixup CodeGen for __weak __block variables. Radar 6756266
llvm-svn: 69010
2009-04-14 00:57:29 +00:00
Eli Friedman 20bb5e02a5 Minor work related to removing the assumption that value initialization
implies an all-zero bit pattern.

llvm-svn: 68994
2009-04-13 21:47:26 +00:00
Eli Friedman c08711e840 Minor simplification.
llvm-svn: 68992
2009-04-13 21:41:57 +00:00
Daniel Dunbar 4184ac847f Update to use hasAttr() instead of getAttr().
- No functionality change.

llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Steve Naroff fb46e8658c Move/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).
llvm-svn: 68982
2009-04-13 20:26:29 +00:00
Steve Naroff 84073ec51f Fixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"), function GetAddrOfConstantCFString, file CodeGenModule.cpp, line 1063.
Still a diagnostic related FIXME (will discuss with Daniel/Fariborz offline).

llvm-svn: 68975
2009-04-13 19:08:08 +00:00
Anders Carlsson 1235bbce7e Use the new guard variable mangling function and get rid of the old code.
llvm-svn: 68971
2009-04-13 18:03:33 +00:00
Anders Carlsson 0c08f6fdde Add support for mangling guard variables.
llvm-svn: 68969
2009-04-13 18:02:10 +00:00
Fariborz Jahanian a4f6b6b180 Minor refactoring of my last patch.
llvm-svn: 68870
2009-04-11 18:54:57 +00:00
Fariborz Jahanian aae4349df9 Fixes a ir-gen crash for K&R style blocks.
llvm-svn: 68865
2009-04-11 17:55:15 +00:00
Anders Carlsson d8281f1589 Don't mangle variables that are at translation unit scope.
llvm-svn: 68853
2009-04-11 01:19:45 +00:00
Anders Carlsson d8e39bbb84 Add support for generating reference initialization code.
llvm-svn: 68852
2009-04-11 01:08:03 +00:00
Mike Stump d352fd3699 Fixup copy/dispose helpers for Objective-C. Radar 6756504
llvm-svn: 68837
2009-04-10 23:09:55 +00:00
Anders Carlsson 7f96b360f2 Remove asserts that weren't really useful, and that would fire in case the CleanupEntries vector needed to be reallocated.
llvm-svn: 68835
2009-04-10 22:49:13 +00:00
Daniel Dunbar 8c920c9220 Don't set both readnone and readonly.
llvm-svn: 68833
2009-04-10 22:14:52 +00:00
Daniel Dunbar d272cca527 Internal variables could mistakenly have "hidden" visibility when
their emission was deferred.
 - <rdar://problem/6775234> variables with internal linkage should not
   be exposed with -fvisibility=hidden.

llvm-svn: 68818
2009-04-10 20:26:50 +00:00