Commit Graph

4033 Commits

Author SHA1 Message Date
John McCall 1c456c89dc Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.

llvm-svn: 111772
2010-08-22 06:43:33 +00:00
John McCall 84fa510aa9 Abstract more member-pointerness out.
llvm-svn: 111771
2010-08-22 04:16:24 +00:00
John McCall a8bbb82c55 Abstract out member-pointer conversions.
Pretty much everything having to do with member pointers is ABI-specific.

llvm-svn: 111770
2010-08-22 03:04:22 +00:00
Eli Friedman 04831926ec Detabify.
llvm-svn: 111768
2010-08-22 01:00:03 +00:00
John McCall d9c6c0b583 Implement the call parts of the member-function-pointer ARM C++ ABI.
llvm-svn: 111766
2010-08-22 00:59:17 +00:00
John McCall 475999dcf9 Extract calls to method pointers out as an ABI routine.
No functionality change.

llvm-svn: 111752
2010-08-22 00:05:51 +00:00
John McCall 86353416a7 The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator.  Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.

llvm-svn: 111749
2010-08-21 22:46:04 +00:00
Daniel Dunbar 5c816378f8 IRgen: Set the alignment correctly when creating LValue for a decls.
- Fixes PR5598.
 - Review appreciated.

llvm-svn: 111726
2010-08-21 04:20:22 +00:00
Daniel Dunbar 49e5d12e59 CodeGenFunction: Eliminate unused MakeQualifiers() function.
llvm-svn: 111725
2010-08-21 04:13:07 +00:00
Daniel Dunbar 26d2c39b95 Simplify.
llvm-svn: 111724
2010-08-21 04:05:54 +00:00
Daniel Dunbar 226bddaff1 IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate old form of MakeAddr().
llvm-svn: 111723
2010-08-21 03:58:45 +00:00
Daniel Dunbar 4bb04cee6a IRgen: Move remaining LValue::Set... methods to LValue::set... (non-static) methods.
llvm-svn: 111722
2010-08-21 03:51:29 +00:00
Daniel Dunbar f166a523f1 IRgen: Move remaining MakeAddr() calls to MakeAddrLValue().
llvm-svn: 111721
2010-08-21 03:44:13 +00:00
Daniel Dunbar e8b6cda15a IRgen: The CVR qualifiers in a subobject adjustment should just come from the
field (I think).
 - Doug, please check.

llvm-svn: 111720
2010-08-21 03:37:02 +00:00
Daniel Dunbar b657ac51cf IRgen/CGValue: Add getQuals(), so qualifiers can be modified on an LValue.
llvm-svn: 111719
2010-08-21 03:29:54 +00:00
Daniel Dunbar e50dda95ee IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency with isNonGC().
llvm-svn: 111718
2010-08-21 03:22:38 +00:00
Daniel Dunbar 2e442a00b3 IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.
llvm-svn: 111717
2010-08-21 03:15:20 +00:00
Daniel Dunbar f6fb7e2b53 IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.
llvm-svn: 111716
2010-08-21 03:08:16 +00:00
Daniel Dunbar b1d94a98dd IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be factored out.
llvm-svn: 111715
2010-08-21 03:01:12 +00:00
Daniel Dunbar 93b00a98a3 IRgen: Add an LValue::MakeAddr variant which takes a type and uses that to build
the qualifiers.

Also, add CodeGenFunction::MakeAddrLValue() helper function which passes in the
ASTContext.

llvm-svn: 111714
2010-08-21 02:53:44 +00:00
Dan Gohman 25f9aaedc6 Delete an obsolete comment.
llvm-svn: 111711
2010-08-21 02:41:29 +00:00
Daniel Dunbar e3b8dd433c IRgen/CGValue: Add alignment to LValue, and use that alignment when generating lvalue load/stores.
llvm-svn: 111710
2010-08-21 02:39:23 +00:00
Daniel Dunbar ab4dbea096 IRgen/LValue: Rename SetQualifiers() to Initialize().
llvm-svn: 111708
2010-08-21 02:31:58 +00:00
Daniel Dunbar 0381634a61 IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
update callers as best I can.
 - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement.
 - Serious review appreciated.

llvm-svn: 111707
2010-08-21 02:24:36 +00:00
Daniel Dunbar a94e3d1124 IRgen: Use Ty consistently in this function.
llvm-svn: 111705
2010-08-21 02:17:08 +00:00
Dan Gohman b1aac3362c CreateTemporaryType doesn't needs its Context argument.
llvm-svn: 111688
2010-08-20 22:39:57 +00:00
Dan Gohman 196f71006e Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.

llvm-svn: 111682
2010-08-20 22:02:57 +00:00
Fariborz Jahanian a50b3a20f1 objective-c ivar refactoring patch. Iterations
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars. 

llvm-svn: 111679
2010-08-20 21:21:08 +00:00
Douglas Gregor e3b3464d4e Fix a major regression with value-initialization of class types with
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.

llvm-svn: 111650
2010-08-20 16:57:37 +00:00
Bob Wilson b02244969d Translate NEON vmovl intrinsics to zero/sign-extend operations.
llvm-svn: 111612
2010-08-20 03:36:08 +00:00
John McCall f834bcd659 Mangle explicit template arguments in dependent or overloaded names.
llvm-svn: 111591
2010-08-20 00:17:19 +00:00
Charles Davis 6bcb07ad71 Add some enum goodness as requested by Chris. Now instead of storing the
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.

And yes, this time, I started from a clean build directory, and
all the tests passed. :)

llvm-svn: 111507
2010-08-19 02:18:14 +00:00
Alexis Hunt dcfba7b35b Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

 - The constructor arguments are a SourceLocation and a Context&,
   followed by the attributes arguments in the order that they were
   defined in Attr.td

 - Every argument in Attr.td has an appropriate accessor named getFoo,
   and there are sometimes a few extra ones (such as to get the length
   of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

llvm-svn: 111455
2010-08-18 23:23:40 +00:00
John McCall 78fbb61ed7 Contextual arity is a feature of mangling expressions; kill off
mangleCallExpression.  Also, operator names with unknown arity should
be mangled as binary operators;  this is actually covered by an oddly-
positioned sentence in the ABI document.  Fixes PR7891.

llvm-svn: 111395
2010-08-18 19:18:59 +00:00
Chris Lattner 396639db95 zap dead code.
llvm-svn: 111365
2010-08-18 16:09:06 +00:00
Chris Lattner aa94cc3fcd fix typo
llvm-svn: 111334
2010-08-18 00:13:52 +00:00
Chris Lattner b1995dffaf Fix PR7889 by generalizing some over specialized code. There is no
reason that this should be limited to simple lvalues.

llvm-svn: 111331
2010-08-18 00:08:27 +00:00
Chris Lattner 00d5141aef fix PR7892, a crash on valid in c++ codegen of __PRETTY_FUNCTION__
llvm-svn: 111330
2010-08-17 23:58:10 +00:00
Daniel Dunbar 56df97761d StringRef'ication of lots stuff, patch by Peter Davies!
llvm-svn: 111314
2010-08-17 22:39:59 +00:00
John McCall 6d86202fa7 Whoops. Don't fall through into the overload case when mangling a
dependent call expression.

llvm-svn: 111300
2010-08-17 21:51:21 +00:00
Benjamin Kramer 35b077e674 Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData().  Patch by Peter Davies (with some tweaks).

llvm-svn: 111229
2010-08-17 12:54:38 +00:00
Charles Davis 53c59df2f7 Implement support for member pointers under the Microsoft C++ ABI in the
AST library.

This also adds infrastructure for supporting multiple C++ ABIs in the AST.

llvm-svn: 111117
2010-08-16 03:33:14 +00:00
Argyrios Kyrtzidis 1cec2cc798 Remove dead code, caught by unused function warnings.
llvm-svn: 111091
2010-08-15 01:15:58 +00:00
Eli Friedman 1bb53d9cd6 Explicitly handle every case in the switch in RTTIBuilder::BuildTypeInfo.
llvm-svn: 111085
2010-08-15 00:24:31 +00:00
John McCall 32427785c0 More cleanup enabling.
llvm-svn: 111070
2010-08-14 07:46:19 +00:00
John McCall 612942d65f Sketch out a framework for delaying the activation of a cleanup.
Not yet complete or used.

llvm-svn: 111044
2010-08-13 21:20:51 +00:00
Eli Friedman a2622dd266 Zap unused UnaryOperator::OffsetOf.
llvm-svn: 110996
2010-08-13 01:36:11 +00:00
Fariborz Jahanian f7f020bb2a Make use of __func__ in a block actually refer to
block's helper function. Fixes radar 7860965.

llvm-svn: 110988
2010-08-13 00:19:55 +00:00
John McCall b3732bb3b7 Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option.  The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable.  Platforms with less ornery linkers can feel free to enable this.

llvm-svn: 110979
2010-08-12 23:36:15 +00:00
John McCall 398dc37d1f Implement RTTI generation for Objective C types. Fixes PR7864.
llvm-svn: 110900
2010-08-12 02:17:33 +00:00