Граф коммитов

1078 Коммитов

Автор SHA1 Сообщение Дата
Charles Davis ee743f9038 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 18:04:24 +00:00
John McCall 4e3b17c9ce 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 01:18:05 +00:00
NAKAMURA Takumi fd4524b445 test/CodeGenCXX/rtti-linkage.cpp: Get rid of sort(1) to remove XFAIL: win32.
On the certain system, bogus SORT.EXE is picked up. Its sort-order is incompatible to POSIX.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 01:05:10 +00:00
John McCall 3030eb8259 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 09:44:32 +00:00
Anders Carlsson c9d557301c Pass a -I flag when compiling nullptr.cpp so the typeinfo header can be found. This should fix the errors seen on the bot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 12:18:32 +00:00
Anders Carlsson 2bd6250f8e std::nullptr_t is a fundamental type for RTTI purposes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 05:28:09 +00:00
Anders Carlsson e292368afa Mangle std::nullptr_t as specified by the Itanium C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 04:31:32 +00:00
Argyrios Kyrtzidis bb5e431bf1 Don't instantiate members not belonging in the semantic context of the template.
e.g. for:

    template <int i> class A {
      class B *g;
    };

'class B' has the template as lexical context but semantically it is
introduced in namespace scope.

Fixes rdar://8611125 & http://llvm.org/PR8505

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 03:18:57 +00:00
Fariborz Jahanian b8e39236f0 Fixes an assertion violation when bind to temporary
expression is a dependent expression. 
// rdar: // 8620524 and PR7851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 21:05:53 +00:00
John McCall 112c967bd5 Ensure that static local variables in function templates inherit the
visibility of their function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 21:04:24 +00:00
Fariborz Jahanian 7281d1fbea Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 16:54:00 +00:00
Argyrios Kyrtzidis bf8cafadb9 Properly handle temporaries that are created in a AsmStmt.
Previously the temporaries would get destroyed before the asm call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 02:33:08 +00:00
John McCall 3698748400 Ignore attributes on classes when calculating visibility for members
with their own explicit visibility attributes.  Basically we only want to
apply a single visibility attribute from any particular ancestry.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 01:45:15 +00:00
John McCall 66cbcf3f15 Only apply -fvisibility-inlines-hidden to definitions. Apparently
isInlined() just gives meaningless results for non-definitions.

Fixes rdar://problem/8614470



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 01:29:57 +00:00
Anders Carlsson 5c5a764fcd Teach the constant expr evaluator about derived-to-base casts when no virtual bases are involved. Fixes PR5974.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31 20:41:46 +00:00
Anders Carlsson 96e9366012 Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31 01:21:47 +00:00
John McCall af14603ca6 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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 11:50:40 +00:00
John McCall ee30102a9e GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given.  It's not totally clear
how that should be mapped into a sane system, but make an effort.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 09:18:49 +00:00
John McCall 110e8e56af 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 22:22:43 +00:00
Rafael Espindola 1af67f33f3 Update tests to not search of as.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 21:18:11 +00:00
Daniel Dunbar 034f55c1eb Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 15:19:36 +00:00
John McCall 14e1bc9201 Don't assert on attempts to throw 'bool'. I wonder if in the history of C++
anyone has ever intentionally done this outside of a compiler test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 08:14:02 +00:00
John McCall 87a4ed905e 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 07:49:41 +00:00
John McCall 0df9587ab0 When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 00:29:13 +00:00
John McCall 479edbc8d0 Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 18:10:36 +00:00
John McCall 67fa6d5ea6 Abandon the type-visibility optimization for functions. GCC doesn't do it,
and it's too much trouble to push for.  Fixes PR8478.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:07:52 +00:00
Stuart Hastings 76be2a2cab Test passes on Darwin; try to XFAIL on freebsd, linux, xp/msvc9.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 00:47:58 +00:00
Devang Patel 4bc48877db Fix context info for enums.
Radar 8595129


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 23:23:58 +00:00
Fariborz Jahanian 500b782d51 patch to do array-to-pointer conversion in a
statement-expression. // rdar: //8600553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 20:10:28 +00:00
Anders Carlsson d66f428565 Also devirtualize calls to a member functions where the containing class has been marked final.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 13:34:43 +00:00
Anders Carlsson bd2bfae2a6 If a virtual member function has the 'final' attribute, we can devirtualize calls to it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 13:28:46 +00:00
Fariborz Jahanian 92d835a86a Patch to provide guard when initializing instances
of static data member of a class template.
Fixes //rdar :// 8562966 and pr8409.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:47:47 +00:00
John McCall ac65c6208d A couple of tweaks to the visibility rules:
- tags with C linkage should ignore visibility=hidden
  - functions and variables with explicit visibility attributes should
    ignore the linkage of their types
Either of these should be sufficient to fix PR8457.

Also, FileCheck-ize a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 04:59:26 +00:00
Fariborz Jahanian e946fc833d Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 23:27:26 +00:00
Fariborz Jahanian bd6b04c1ac Test emoved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 22:05:40 +00:00
Fariborz Jahanian 8a97005f97 After discussion with Doug and John, I am reverting
the patch. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 22:05:03 +00:00
John McCall 1fb0caaa7b Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage.  This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 21:05:15 +00:00
Fariborz Jahanian 07ed93f378 Patch fixes miscompile with non-trivial copy constructors and
statement expressions, //rdar: //8540501


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 21:01:02 +00:00
John McCall 82b7d7bc72 Fix some bugs in local class mangling brought up in PR8355.
Patch by Richard Smith!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 21:28:44 +00:00
John McCall 6102ca1d49 White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't.  Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 06:59:13 +00:00
Chandler Carruth 716e45460e Not really sure how this worked, but it seems like a clear typo. =]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 00:24:52 +00:00
Argyrios Kyrtzidis 3bd5b6c3c2 Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 02:39:41 +00:00
Argyrios Kyrtzidis d2c47bde3b Make sure the VTables for template instantiations are emitted even if the key function doesn't have a body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 03:25:57 +00:00
Argyrios Kyrtzidis 6d576051b9 Don't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
with similarly named classes in anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 03:25:53 +00:00
John McCall 90fb58e9f5 Secure this test against slightly different number formatters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 02:28:39 +00:00
John McCall 189d6ef40e Permit constant evaluation of const floating-point variables with
constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 01:34:31 +00:00
John McCall 63d5fb3a14 When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments.  This is
important if the default arguments refer to a declaration or create a
temporary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:36:42 +00:00
John McCall 23c51b5b10 ...without leaving a temporary file behind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:53:58 +00:00
John McCall 1eeaacdbd5 Er, this test should actually run IR generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:53:00 +00:00
John McCall e71d60d2c9 Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through.  That this happens
for this test case is actually a separate bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:48:15 +00:00