Commit Graph

4309 Commits

Author SHA1 Message Date
John McCall 5b26f65b3d Reset the lifetime-managed flag between emission of the agg conditional
branches.  Fixes PR8623.

llvm-svn: 119408
2010-11-17 00:07:33 +00:00
John McCall 4f29b49de1 Support compound complex operations as l-values in C++. Add a test
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.

llvm-svn: 119402
2010-11-16 23:07:28 +00:00
Fariborz Jahanian a3e54bd33e Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).

llvm-svn: 119368
2010-11-16 19:29:39 +00:00
John McCall 07bb19667a Simplify some complex emission and implement correct semantics for
assignment to volatiles in C.  This in effect reverts some of mjs's
work in and around r72572.  Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.

llvm-svn: 119344
2010-11-16 10:08:07 +00:00
John McCall 3eba6e67ec Now that we have reliable cast kinds, simplify scalar cast IR gen.
llvm-svn: 119332
2010-11-16 06:21:14 +00:00
John McCall d50a27111c Kill CK_Unknown and flesh out the documentation for the existing CastKinds.
llvm-svn: 119331
2010-11-16 05:46:29 +00:00
John McCall fa8edb11e1 Teach complex compound assignment IR-generation that the RHS of
a compound assignment is always already in the computation type.

llvm-svn: 119330
2010-11-16 05:45:35 +00:00
Bob Wilson e4652b1f22 Change CXXNameMangler::mangleNeonVectorType to require the vector type to be
one of the special Neon types.  We'll check for invalid Neon vectors when
they are created, so there's no point in handling them when mangling.

llvm-svn: 119299
2010-11-16 00:32:18 +00:00
Bob Wilson 59f9dec8cd Use getTypeSize() method.
llvm-svn: 119297
2010-11-16 00:32:12 +00:00
John McCall 8d69a2160e Add a new expression kind, OpaqueValueExpr, which is useful for
certain internal type-checking procedures as well as for representing
certain implicitly-generated operations.  Uses to follow.

llvm-svn: 119289
2010-11-15 23:31:06 +00:00
Fariborz Jahanian 9db7b8b1ef Some cleanup of block API code.
llvm-svn: 119174
2010-11-15 19:19:38 +00:00
Chandler Carruth 99da11cf04 Silence an unused variable warning during release builds by folding the
expression into the assert.

llvm-svn: 119143
2010-11-15 13:54:43 +00:00
John McCall 8cb679e4e1 Assorted work leading towards the elimination of CK_Unknown.
llvm-svn: 119138
2010-11-15 09:13:47 +00:00
John McCall 83fe49d1e1 Always emit full loads from volatile complex l-values.
Return the result of a complex assignment with the original values,
not by performing a load from the l-value;  this is the correct
semantics in C, although not in C++.

llvm-svn: 119037
2010-11-14 09:40:28 +00:00
John McCall d764625448 Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions;  the last batch was specific to promotions.
I think this is the full set we need.  I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.

llvm-svn: 119036
2010-11-14 08:17:51 +00:00
Fariborz Jahanian 574940e16f Removed unnecessary initialization of a flag which
somehow got several block tests fail with a linux built
compiler.

llvm-svn: 119027
2010-11-14 05:25:15 +00:00
Fariborz Jahanian 9ffe24f186 Initialize couple of fields.
llvm-svn: 119014
2010-11-13 23:48:30 +00:00
Fariborz Jahanian e988bdac44 Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.

llvm-svn: 119011
2010-11-13 21:53:34 +00:00
John McCall c5e62b47af Introduce five new cast kinds for various conversions into and
between complex types.

llvm-svn: 118994
2010-11-13 09:02:35 +00:00
John McCall e84af4e486 Introduce a null-to-pointer implicit cast kind.
llvm-svn: 118966
2010-11-13 01:35:44 +00:00
Benjamin Kramer c78d86a2af Reduce string thrashing.
llvm-svn: 118915
2010-11-12 18:45:23 +00:00
Bob Wilson f58e8a4db7 Use ASTContext::getTypeInfo to find the vector element size.
llvm-svn: 118899
2010-11-12 17:24:49 +00:00
Bob Wilson 8470b33762 Add a separate NeonPolyVector kind to distinguish polynomial vector types.
Add support for mangling those types according to ARM's ABI.

llvm-svn: 118898
2010-11-12 17:24:46 +00:00
Bob Wilson c155521a96 Add special-case mangling for Neon vector types.
llvm-svn: 118897
2010-11-12 17:24:43 +00:00
Benjamin Kramer 8c173cc364 Use a twine.
llvm-svn: 118892
2010-11-12 15:42:18 +00:00
Douglas Gregor ad3832e213 Teach debug-info generation that SourceManager::getPresumedLoc() can
produce an invalid location even when given a valid location, if the
file system has changed underneath us. Recovery more gracefully.

llvm-svn: 118834
2010-11-11 20:45:16 +00:00
Fariborz Jahanian 2a5deb56a4 Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.

llvm-svn: 118745
2010-11-11 00:11:38 +00:00
Bob Wilson aeb56444f9 Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI,
similar to some of the AltiVec-specific vector types.  This patch is mostly
just renaming a bunch of "AltiVecSpecific" things, since they will no longer
be specific to AltiVec.  Besides that, it just adds the new "NeonVector" enum.

llvm-svn: 118724
2010-11-10 21:56:12 +00:00
Charles Davis 99202b358f Use the right calling convention when mangling names in the Microsoft C++
mangler. Now member functions and pointers thereof have their calling
convention mangled as __thiscall if they have the default CC (even though,
they technically still have the __cdecl CC).

llvm-svn: 118598
2010-11-09 18:04:24 +00:00
David Chisnall 82f755c58d Remove the use of aliases in outputted code from ObjC (GNU runtime).
llvm-svn: 118498
2010-11-09 11:21:43 +00:00
Nick Lewycky 30d939681c Remove debugging printf.
Fix linux build.

llvm-svn: 118497
2010-11-09 09:53:02 +00:00
Anders Carlsson c1351cac17 Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.
llvm-svn: 118491
2010-11-09 05:25:47 +00:00
Argyrios Kyrtzidis 8909686b22 Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.
Fixes rdar://8644873 & http://llvm.org/PR8567.

llvm-svn: 118468
2010-11-09 01:30:48 +00:00
John McCall 478382521e When re-using a vtable slot for the nearest overridden method, just because
there's no return adjustment from the overridden to the overrider doesn't
mean there isn't a return adjustment from the overrider to the final
overrider.  This matters if we're emitting a virtual this-adjustment thunk
because the overrider virtually inherits from the class providing the
nearest overridden method.  Do the appropriate return adjustment in this case.

Fixes PR7611.

llvm-svn: 118466
2010-11-09 01:18:05 +00:00
Douglas Gregor 1ccc8416a0 Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.

llvm-svn: 118385
2010-11-07 23:05:16 +00:00
John McCall 2faab302e0 ARM EH uses a different personality function in C.
llvm-svn: 118366
2010-11-07 02:35:25 +00:00
John McCall cdf7ef5437 Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after
linkage and visibility have been set on the global.  Also, don't
emit a guard unless the variable actually ends up with vague linkage,
and don't use thread-safe statics in any case.

llvm-svn: 118336
2010-11-06 09:44:32 +00:00
Anders Carlsson ba37e1eb49 std::nullptr_t is a fundamental type for RTTI purposes.
llvm-svn: 118238
2010-11-04 05:28:09 +00:00
Anders Carlsson 2683fd6f8c Mangle std::nullptr_t as specified by the Itanium C++ ABI.
llvm-svn: 118236
2010-11-04 04:31:32 +00:00
David Chisnall e8431a7766 Some fixes for synthesized ivar metadata (GNU runtime).
llvm-svn: 118172
2010-11-03 16:12:44 +00:00
John McCall 8e7cb6dcfa Ensure that static local variables in function templates inherit the
visibility of their function.

llvm-svn: 118065
2010-11-02 21:04:24 +00:00
Fariborz Jahanian dc9bc5aeb8 Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666

llvm-svn: 118019
2010-11-02 16:54:00 +00:00
Devang Patel 86f30f5a1d Simplify. Builtin types' context is always implied.
llvm-svn: 117928
2010-11-01 16:52:40 +00:00
Anders Carlsson fd88a6160d Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.
llvm-svn: 117881
2010-10-31 23:22:37 +00:00
John McCall c273f24196 Better solution: calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations.  Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093

llvm-svn: 117781
2010-10-30 11:50:40 +00:00
Dale Johannesen 7d3dfc0622 Generate bitcasts going in and out of MMX parameters
in asm's.  PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?

llvm-svn: 117736
2010-10-29 23:12:32 +00:00
Dan Gohman e9e32dcb48 Use CodeGenFunction's getContext(), for consistency.
llvm-svn: 117734
2010-10-29 22:47:07 +00:00
John McCall 37bb6c9832 Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

llvm-svn: 117729
2010-10-29 22:22:43 +00:00
Devang Patel 31d1e2153f After processing named unions do not fall through to handle anonymous unions.
This is tested by funcargs.exp in gdb testsuite.

llvm-svn: 117659
2010-10-29 16:21:19 +00:00
Daniel Dunbar df8792128f Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

llvm-svn: 117653
2010-10-29 15:19:36 +00:00