Commit Graph

2094 Commits

Author SHA1 Message Date
Anders Carlsson d5931cd2b7 Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
llvm-svn: 83272
2009-10-03 19:56:56 +00:00
Anders Carlsson 2ee3c011d9 Implement code generation of member function pointer calls. Fixes PR5121.
llvm-svn: 83271
2009-10-03 19:43:08 +00:00
Anders Carlsson c46bf276e1 Teach AggExprEmitter about pointers to member functions.
llvm-svn: 83266
2009-10-03 15:43:24 +00:00
Anders Carlsson 3162e4945a Handle base-to-derived casts of member function pointers in CGExprConstant.cpp
llvm-svn: 83265
2009-10-03 15:13:22 +00:00
Anders Carlsson 128a5d5147 Handle members to function pointers in CGExprConstant.
llvm-svn: 83264
2009-10-03 15:02:02 +00:00
Anders Carlsson 32bfb1ce8f Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.
llvm-svn: 83263
2009-10-03 14:56:57 +00:00
Anders Carlsson 8a744ad8a6 Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
llvm-svn: 83235
2009-10-02 04:52:12 +00:00
Mike Stump 581b9ad124 More magic pixie dust.
llvm-svn: 83232
2009-10-02 02:30:50 +00:00
Mike Stump 440af3d903 Fix up debug information for block pointers a bit more.
llvm-svn: 83231
2009-10-02 02:23:37 +00:00
Anders Carlsson 39e3eb12ae When building constant structs, check if the resulting LLVM struct will be bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108.
llvm-svn: 83230
2009-10-02 02:15:20 +00:00
Mike Stump 017460ab6c Implement a FIXME. This improves codegen just a tad.
llvm-svn: 83221
2009-10-01 22:29:41 +00:00
Douglas Gregor 369acf9304 CodeGen may see out-of-line declarations of the various special member
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.

llvm-svn: 83212
2009-10-01 20:44:19 +00:00
Douglas Gregor e364e7bc2b Fix a lame regression in IR gen for C++ delete expressions. PR5102
llvm-svn: 83195
2009-10-01 05:49:51 +00:00
Mike Stump 7d69911a1f A couple of refinements for laying out debug information for
BlockDeclRefDecls.

llvm-svn: 83185
2009-10-01 00:27:30 +00:00
John McCall 4fa5342758 Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.

llvm-svn: 83184
2009-10-01 00:25:31 +00:00
Fariborz Jahanian e01e434aef <rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
llvm-svn: 83150
2009-09-30 17:10:29 +00:00
Mike Stump 2e722b915c Improve debugging information for BlockDeclRefExpr. WIP. Given this
scheme, we can switch the previous scheme over to using this code
path.  There's a bit of simplifications yet to do as well.

llvm-svn: 83138
2009-09-30 02:43:10 +00:00
Douglas Gregor bb3e12fc0b Handle C++ delete expressions when the overloaded delete operator is a
"usual deallocation function" with two arguments. CodeGen will have to
handle this case specifically, since the value for the second argument
(the size of the allocated object) may have to be computed at run
time.

Fixes the Sema part of PR4782.

llvm-svn: 83080
2009-09-29 18:16:17 +00:00
Anders Carlsson 8f4fd60c47 Handle CXXMemberCallExprs that point to a static method. Fixes PR5093.
llvm-svn: 83045
2009-09-29 03:54:11 +00:00
Anders Carlsson 9150a2a8c0 Handle CK_BaseToDerivedMemberPointer for member function pointers. Fixes PR5091.
llvm-svn: 83041
2009-09-29 03:13:20 +00:00
Anders Carlsson b05a3e551b Improve support for member function pointers.
llvm-svn: 83039
2009-09-29 02:09:01 +00:00
Anders Carlsson 1fb7ae9e3c Use a switch statement in VisitCastExpr.
llvm-svn: 83038
2009-09-29 01:23:39 +00:00
Anders Carlsson d30d820dc4 Make hasAggregateLLVMType use positive checks.
llvm-svn: 83037
2009-09-29 01:15:29 +00:00
Mike Stump e7a2b48572 Fix http://llvm.org/PR5090.
llvm-svn: 83035
2009-09-29 00:50:50 +00:00
Anders Carlsson 02bca738b4 Mangle dependent name expressions. Fixes PR5063.
llvm-svn: 82915
2009-09-27 20:11:34 +00:00
Anders Carlsson d122de5f32 Use mangleTemplatePrefix when we know that we're mangling a nested template name.
llvm-svn: 82912
2009-09-27 19:53:49 +00:00
Anders Carlsson 52d78a518a CodeGen for try statements. (We just emit the body for now).
llvm-svn: 82910
2009-09-27 18:58:34 +00:00
Anders Carlsson 9bf787ad1f Look for substitutions when mangling TypenameTypes.
llvm-svn: 82885
2009-09-27 01:06:07 +00:00
Anders Carlsson e00745b285 Better template parameter type mangling.
llvm-svn: 82883
2009-09-27 00:38:53 +00:00
Anders Carlsson 2e5935241a Mangle std::basic_string<char, std::char_traits<char>, std::allocator<char> > as Ss.
llvm-svn: 82882
2009-09-27 00:12:57 +00:00
Anders Carlsson 853bb50382 Mangle ::std::basic_string as Sb.
llvm-svn: 82881
2009-09-26 23:14:39 +00:00
Anders Carlsson 872ce0dc31 Mangle ::std::allocator as Sa.
llvm-svn: 82880
2009-09-26 23:10:05 +00:00
Anders Carlsson 3e83c30c4c Handle substitutions in mangleTemplatePrefix.
llvm-svn: 82879
2009-09-26 22:18:22 +00:00
Anders Carlsson aa9e3c8793 Substitute "::std::" as "St".
llvm-svn: 82874
2009-09-26 20:53:44 +00:00
Anders Carlsson 49232b9f42 Don't crash when trying to mangle function templates.
llvm-svn: 82872
2009-09-26 20:13:56 +00:00
Anders Carlsson 26e67afd1e mangleTemplatePrefix and mangleUnscopedTemplateName should take a TemplateDecl.
llvm-svn: 82871
2009-09-26 19:45:45 +00:00
Anders Carlsson 677475206c Use the qualified name for tag types.
llvm-svn: 82870
2009-09-26 19:03:24 +00:00
Anders Carlsson e33eed5c1e Set alignment on static function level decls and VLAs. Fixes PR5060.
llvm-svn: 82868
2009-09-26 18:16:06 +00:00
Anders Carlsson 0374742326 Use ABIArgInfo::getDirect() for all types that have a pointer representation.
llvm-svn: 82845
2009-09-26 03:56:53 +00:00
Anders Carlsson 296f8dc52f Mangle record types as decls.
llvm-svn: 82843
2009-09-26 03:55:37 +00:00
Anders Carlsson 9f8e3d1929 Change isTemplate to return the actual template declaration.
llvm-svn: 82839
2009-09-26 03:24:57 +00:00
Anders Carlsson bdaaab4671 Improve mangling of typename types.
llvm-svn: 82833
2009-09-26 02:26:02 +00:00
Mike Stump 1dbb8f78a3 Fix 80-col violation.
llvm-svn: 82782
2009-09-25 18:11:00 +00:00
John McCall 0cf155174e Fix an infinite loop arising when trying to generate debug information
for a ObjC class with an ivar of weak self type.

llvm-svn: 82745
2009-09-25 01:40:47 +00:00
Fariborz Jahanian 1f9ed58277 Fixed another code gen bug in objc's new write-barrier API.
llvm-svn: 82735
2009-09-25 00:00:20 +00:00
Mike Stump d2a3e61798 Fix 80-col violation.
llvm-svn: 82725
2009-09-24 22:31:14 +00:00
Fariborz Jahanian 7a95d72b10 Patch fixes a code gen. bug in generation of objc_assign_ivar
(objc GC's API).

llvm-svn: 82724
2009-09-24 22:25:38 +00:00
John McCall 8ccfcb51ee Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy.  Demote 'volatile' to extended-qualifier status.  Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right;  many more remain.

llvm-svn: 82705
2009-09-24 19:53:00 +00:00
Daniel Dunbar b3b1e53d33 Darwin/x86-32: Enumerated types and block pointer types in structures were not
handled correctly.
 - <rdar://problem/7247671> Function arguments incorrect when function returns a
   struct on i386 w/ llvm-g++ and clang

llvm-svn: 82681
2009-09-24 05:12:36 +00:00
Anders Carlsson 649a17e861 Handle namespace aliases.
llvm-svn: 82644
2009-09-23 19:19:16 +00:00