]> granicus.if.org Git - clang/log
clang
10 years agoUse ArrayRef in some function parameters instead of a pointer and count. No functiona...
Craig Topper [Thu, 12 Jun 2014 05:32:27 +0000 (05:32 +0000)]
Use ArrayRef in some function parameters instead of a pointer and count. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210750 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a std:: prefix in cases where ADL would have failed on windows.
Rafael Espindola [Thu, 12 Jun 2014 03:53:36 +0000 (03:53 +0000)]
Add a std:: prefix in cases where ADL would have failed on windows.

This is in preparation for removing make_error_code from the llvm namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210745 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix typo.
Rafael Espindola [Thu, 12 Jun 2014 03:31:26 +0000 (03:31 +0000)]
Fix typo.

Thanks to Alp Toker for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210744 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGive clang-format its own error category.
Rafael Espindola [Thu, 12 Jun 2014 02:50:04 +0000 (02:50 +0000)]
Give clang-format its own error category.

The posix errno values are probably to the best thing to use for
describing parse errors.

This should also fix the mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210739 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDriver: use more range-based for loops
Saleem Abdulrasool [Thu, 12 Jun 2014 02:08:04 +0000 (02:08 +0000)]
Driver: use more range-based for loops

Mechanical change converting some of the simpler for loops into range-based for
loops.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210738 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse generic_category from the std namespace.
Rafael Espindola [Thu, 12 Jun 2014 01:59:06 +0000 (01:59 +0000)]
Use generic_category from the std namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210736 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoErrno should use generic_category.
Rafael Espindola [Thu, 12 Jun 2014 00:57:40 +0000 (00:57 +0000)]
Errno should use generic_category.

Sorry, no testcase, just noticed while trying to remove llvm's system_error.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210727 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[modules] Add first-draft module maps for Clang. These don't cover everything
Richard Smith [Thu, 12 Jun 2014 00:32:32 +0000 (00:32 +0000)]
[modules] Add first-draft module maps for Clang. These don't cover everything
yet, but they're enough for a clean bootstrap (with a few local patches that
are yet to be committed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210726 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR19966: don't crash/assert when __underlying_type is applied to an incomplete
Richard Smith [Thu, 12 Jun 2014 00:01:45 +0000 (00:01 +0000)]
PR19966: don't crash/assert when __underlying_type is applied to an incomplete
enumeration type. I've also filed a LWG issue pointing out that this should be
ill-formed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210723 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAccomodate for message differences on windows.
Rafael Espindola [Wed, 11 Jun 2014 23:53:06 +0000 (23:53 +0000)]
Accomodate for message differences on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210722 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't inherit dllimport to inline move assignment operators
Hans Wennborg [Wed, 11 Jun 2014 22:44:39 +0000 (22:44 +0000)]
Don't inherit dllimport to inline move assignment operators

Current MSVC versions don't have move assignment operators, so we
can't rely on them being available in the dll. If we have the
definition, we can just use that directly. This breaks pointer
equality, but should work fine otherwise.

When there is an MSVC version that supports move assignment,
we can key this off the -fmsc-ver option.

http://reviews.llvm.org/D4105

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210715 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't slice SemaDiagnosticBuilder
Reid Kleckner [Wed, 11 Jun 2014 21:57:15 +0000 (21:57 +0000)]
Don't slice SemaDiagnosticBuilder

I wasn't able to figure out how to emit this diagnostic from a SFINAE
context, so I don't have a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210713 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the VS2012 build.
Hans Wennborg [Wed, 11 Jun 2014 21:24:13 +0000 (21:24 +0000)]
Fix the VS2012 build.

It didn't handle the in-class member initializer and compound literal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210707 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Accept '__attribute__((__ns_returns_retained__))'
Fariborz Jahanian [Wed, 11 Jun 2014 21:22:53 +0000 (21:22 +0000)]
Objective-C. Accept '__attribute__((__ns_returns_retained__))'
for function/methods returning block in MRR mode as well.
// rdar://17259812

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210706 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove dev/null redirect and x86 backend requirement from new test.
Bob Wilson [Wed, 11 Jun 2014 20:19:07 +0000 (20:19 +0000)]
Remove dev/null redirect and x86 backend requirement from new test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210699 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd missing "non-constant" diagnostic for a member call on a temporary of
Richard Smith [Wed, 11 Jun 2014 19:53:12 +0000 (19:53 +0000)]
Add missing "non-constant" diagnostic for a member call on a temporary of
non-literal class type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210696 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-cl: accept the /C option with /P (PR19978)
Hans Wennborg [Wed, 11 Jun 2014 19:44:53 +0000 (19:44 +0000)]
clang-cl: accept the /C option with /P (PR19978)

(It's also allowed with /EP, but we haven't implemented that option yet.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210695 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRun new test with -fsyntax-only.
Bob Wilson [Wed, 11 Jun 2014 19:34:14 +0000 (19:34 +0000)]
Run new test with -fsyntax-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210693 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThe automated server-side process isn't quite right yet, so this is a newly-generated...
Aaron Ballman [Wed, 11 Jun 2014 19:11:24 +0000 (19:11 +0000)]
The automated server-side process isn't quite right yet, so this is a newly-generated attribute reference. Tanya is looking into the server process when she gets the chance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210691 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. More tests for both bridging attributes and
Fariborz Jahanian [Wed, 11 Jun 2014 19:10:46 +0000 (19:10 +0000)]
Objective-C. More tests for both bridging attributes and
a fix to make it work when CFStructs have no definition.
// rdar://17238954.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210690 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse std::error_code instead of llvm::error_code.
Rafael Espindola [Wed, 11 Jun 2014 19:05:55 +0000 (19:05 +0000)]
Use std::error_code instead of llvm::error_code.

This is an update for a llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210688 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some comments to TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:33:46 +0000 (18:33 +0000)]
Add some comments to TypoCorrectionConsumer.

Also move the constructor for NamespaceSpecifierSet out of line to
improve the class' readability. I meant to do these two things while
cleaning up the previous TypoCorrectionConsumer changes and have them
folded into those changes.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210686 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSink SpecifierInfo into the only class that uses it.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:08 +0000 (18:07 +0000)]
Sink SpecifierInfo into the only class that uses it.

SpecifierInfo is not used outside of NamespaceSpecifierSet except
indirectly through NamespaceSpecifierSet's iterator, so clean up the
code a bit by moving SpecifierInfo into NamespaceSpecifierSet. Also drop
SpecifierInfo's trivial yet verbose constructor since brace
initiialization is sufficient in the only two places the constructor was
being explicitly called.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210672 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake a couple of helper classes private to TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:05 +0000 (18:07 +0000)]
Make a couple of helper classes private to TypoCorrectionConsumer.

The SpecifierInfo and NamespaceSpecifierSet are now only used by
TypoCorrectionConsumer, so treat them as the implementation details of
TypoCorrectionConsumer that they are. Also make NamespaceSpecifierSet's
method names more style guide compliant.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210671 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoClean up the TypoCorrectionConsumer's interface a bit.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:03 +0000 (18:07 +0000)]
Clean up the TypoCorrectionConsumer's interface a bit.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210670 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove TypoCorrection filtering into the TypoCorrectionConsumer and make it incremental.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:01 +0000 (18:07 +0000)]
Move TypoCorrection filtering into the TypoCorrectionConsumer and make it incremental.

The only external/visible functional change that fell out of this
refactoring is that there was one less case where the typo caching
and/or counting didn't work properly. The result is that a test case
had to be moved from typo-correction.cpp to typo-correction-pt2.cpp
to avoid the hard-coded limit on per file/TU typo correction attempts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210669 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove a few classes to be before TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:06:56 +0000 (18:06 +0000)]
Move a few classes to be before TypoCorrectionConsumer.

This is in preparation for moving TypoCorrection filtering
into the TypoCorrectionConsumer, to separate out some of the purely
mechanical churn. It also makes some of the method names in
NamespaceSpecifierSet be more style guide compliant.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210668 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd loop unroll pragma support
Eli Bendersky [Wed, 11 Jun 2014 17:56:26 +0000 (17:56 +0000)]
Add loop unroll pragma support

http://reviews.llvm.org/D4089

Patch by Mark Heffernan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210667 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Patch to handle bridge attribute warnings
Fariborz Jahanian [Wed, 11 Jun 2014 16:52:44 +0000 (16:52 +0000)]
Objective-C. Patch to handle bridge attribute warnings
correctly when both NSAttributedString and
NSMutableAttributedString are specified on the same
CFStruct via different typedefs. // rdar://17238954

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210660 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PPC64LE] Fix vec_sld and vec_vsldoi for little endian
Bill Schmidt [Wed, 11 Jun 2014 15:48:46 +0000 (15:48 +0000)]
[PPC64LE] Fix vec_sld and vec_vsldoi for little endian

The vec_sld and vec_vsldoi interfaces perform a left-shift on vector
arguments for both big and little endian.  However, because they rely
on the vec_perm interface which is endian-dependent, the permutation
vector needs to be reversed for LE to get the proper shift direction.

I've added some extra testing for these interfaces for LE in the
builtins-ppc-altivec.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210657 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix pointer/reference detection after decltype.
Daniel Jasper [Wed, 11 Jun 2014 07:35:16 +0000 (07:35 +0000)]
clang-format: Fix pointer/reference detection after decltype.

Before:
  [](const decltype(*a) & value) {}

After:
  [](const decltype(*a)& value) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210643 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Only class templates get complex nullptr pointer-to-member-functions
David Majnemer [Wed, 11 Jun 2014 07:08:37 +0000 (07:08 +0000)]
MS ABI: Only class templates get complex nullptr pointer-to-member-functions

r210637 regressed CodeGenCXX/mangle-ms-templates-memptrs.cpp because it
did not believe that there is a distinction between class templates and
function templates.

Sadly, there is.  Function templates should behave in a compatible
manner with MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210642 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Mangle null pointer-to-member-functions compatibly
David Majnemer [Wed, 11 Jun 2014 04:55:08 +0000 (04:55 +0000)]
MS ABI: Mangle null pointer-to-member-functions compatibly

Summary:
Previously, we would mangle nullptr pointer-to-member-functions in class
templates with a mangling we invented because contemporary versions of
MSVC would crash when trying to compile such code.

However, VS "14" can successfully compile these sorts of template
instantiations.  This commit updates our mangling to be compatible with
theirs.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4059

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210637 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: Correct linkage of thread_local for OS X
David Majnemer [Wed, 11 Jun 2014 04:08:55 +0000 (04:08 +0000)]
CodeGen: Correct linkage of thread_local for OS X

The backing store of thread local variables is internal for OS X and all
accesses must go through the thread wrapper.

However, individual TUs may have inlined through the thread wrapper.
To fix this, give the thread wrapper functions WeakAnyLinkage.  This
prevents them from getting inlined into call-sites.

This fixes PR19989.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210632 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64] Add default features for CPUs on AArch64 target.
Kevin Qin [Wed, 11 Jun 2014 01:42:16 +0000 (01:42 +0000)]
[AArch64] Add default features for CPUs on AArch64 target.

For ARM target, we can use CRYPTO and CRC features if we select
cortex-a57 by '-mcpu', but for AArch64 target, it doesn't work
unless adding with '-mfpu=crypto-neon-fp-armv8'. To keep consistency
between front-end and back-end and get end-users more easier to use,
we'd better add default feature for CPUs on AArch64 target as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210625 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEnsure test/Misc/win32-macho.c doesn't try to write to the source tree
David Blaikie [Wed, 11 Jun 2014 00:50:07 +0000 (00:50 +0000)]
Ensure test/Misc/win32-macho.c doesn't try to write to the source tree

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210618 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR19993: don't assert/crash if a static data member is initialized by '= delete;'.
Richard Smith [Wed, 11 Jun 2014 00:49:52 +0000 (00:49 +0000)]
PR19993: don't assert/crash if a static data member is initialized by '= delete;'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210617 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR19996: don't crash if -Wuninitialized sees a c++1y lambda init-capture.
Richard Smith [Wed, 11 Jun 2014 00:31:00 +0000 (00:31 +0000)]
PR19996: don't crash if -Wuninitialized sees a c++1y lambda init-capture.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210615 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAllow lookup into dependent bases in more places under -fms-compatibility
Reid Kleckner [Wed, 11 Jun 2014 00:01:28 +0000 (00:01 +0000)]
Allow lookup into dependent bases in more places under -fms-compatibility

We currently allow unqualified lookup for instance methods but not
static methods because we can't recover with a semantic 'this->'
insertion.

ATL headers have static methods that do unqualified lookup into
dependent base classes.  The pattern looks like:

  template <typename T> struct Foo : T {
    static int *getBarFromT() { return Bar; }
  };

Now we recover as if the user had written:

  template <typename T> struct Foo : T {
    static int *getBarFromT() { return Foo::Bar; }
  };

... which will eventually look up Bar in T at instantiation time.

Now we emit a diagnostic in both cases, and delay lookup in other
contexts where 'this' is available and refers to a class with dependent
bases.

Reviewed by: rsmith

Differential Revision: http://reviews.llvm.org/D4079

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210611 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach __alignof__ to look through arrays before performing the
Richard Smith [Tue, 10 Jun 2014 23:43:44 +0000 (23:43 +0000)]
Teach __alignof__ to look through arrays before performing the
preferred-alignment transformations. Corrects alignof(T[]) to return
alignof(T) in all cases, as required by relevant standards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210609 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRelated to PR19992: when the GNU alignof-expression extension is applied to an
Richard Smith [Tue, 10 Jun 2014 23:34:28 +0000 (23:34 +0000)]
Related to PR19992: when the GNU alignof-expression extension is applied to an
expression of array-of-unknown-bound type, don't try to complete the array
bound, and return the alignment of the element type rather than 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210608 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRecover from missing typenames on template args for MSVC compatibility
Reid Kleckner [Tue, 10 Jun 2014 23:29:48 +0000 (23:29 +0000)]
Recover from missing typenames on template args for MSVC compatibility

While matching a non-type template argument against a known template
type parameter we now modify the AST's TemplateArgumentLoc to assume the
user wrote typename.  Under -fms-compatibility, we downgrade our
diagnostic from an error to an extwarn.

Reviewed by: rsmith

Differential Revision: http://reviews.llvm.org/D4049

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210607 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Clang changes to support LLVM removal of runtime multithreading"
Zachary Turner [Tue, 10 Jun 2014 23:17:11 +0000 (23:17 +0000)]
Revert "Clang changes to support LLVM removal of runtime multithreading"

This reverts r210601.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210604 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoClang changes to support LLVM removal of runtime multithreading
Zachary Turner [Tue, 10 Jun 2014 23:02:10 +0000 (23:02 +0000)]
Clang changes to support LLVM removal of runtime multithreading
support (llvm revision r210600).

Reviewers: rnk

Differential Revision: http://reviews.llvm.org/D4077

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210601 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago*Really* fix DOS newlines introduced in r210330
Reid Kleckner [Tue, 10 Jun 2014 21:35:24 +0000 (21:35 +0000)]
*Really* fix DOS newlines introduced in r210330

r210369 didn't quite catch all of them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210593 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry to fix clang-hexagon-elf failure by requiring x86 support for this test.
Bob Wilson [Tue, 10 Jun 2014 21:15:17 +0000 (21:15 +0000)]
Try to fix clang-hexagon-elf failure by requiring x86 support for this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210586 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR19992: alignof is permitted on an array of unknown bound.
Richard Smith [Tue, 10 Jun 2014 21:11:26 +0000 (21:11 +0000)]
PR19992: alignof is permitted on an array of unknown bound.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210585 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix crash with x86_64-pc-win32-macho target. <rdar://problem/17235840>
Bob Wilson [Tue, 10 Jun 2014 21:07:12 +0000 (21:07 +0000)]
Fix crash with x86_64-pc-win32-macho target. <rdar://problem/17235840>

The changes in r204978 broke win32-macho targets. There were checks added for
MSVC and Itanium environments as special cases, and win32-macho needs to be
treated the same way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210584 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove a redundant conditional when caching typo failures.
Kaelyn Takata [Tue, 10 Jun 2014 21:03:49 +0000 (21:03 +0000)]
Remove a redundant conditional when caching typo failures.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210583 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDo not predefine __EXCEPTIONS in clang-cl (PR19977)
Hans Wennborg [Tue, 10 Jun 2014 20:46:38 +0000 (20:46 +0000)]
Do not predefine __EXCEPTIONS in clang-cl (PR19977)

Patch by Ehsan Akhgari! (Test tweak by me.)

Differential Revision: http://reviews.llvm.org/D4065

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210582 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix mangling of __uuidof after two levels of template instantiation
Reid Kleckner [Tue, 10 Jun 2014 20:06:25 +0000 (20:06 +0000)]
Fix mangling of __uuidof after two levels of template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210570 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Don't ignore availability attribute when
Fariborz Jahanian [Tue, 10 Jun 2014 19:02:48 +0000 (19:02 +0000)]
Objective-C. Don't ignore availability attribute when
doing Objective-C subscript access. // rdar://16842487
PR19682.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210565 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't inherit dll attributes to deleted methods (PR19988)
Hans Wennborg [Tue, 10 Jun 2014 17:53:23 +0000 (17:53 +0000)]
Don't inherit dll attributes to deleted methods (PR19988)

We would previously end up with an error when instantiating the
following template:

  template <typename> struct __declspec(dllimport) S {
    void foo() = delete;
  };
  S<int> s;

error: attribute 'dllimport' cannot be applied to a deleted function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210550 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C IRGen. Patch to generate a weak symbol reference when
Fariborz Jahanian [Tue, 10 Jun 2014 17:08:04 +0000 (17:08 +0000)]
Objective-C IRGen. Patch to generate a weak symbol reference when
'super' dispatches a class method in category for OBJC_METACLASS.
This is when class is a weak_import class.
// rdar://16529125

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210547 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [JS] Treat dict literals similar to objc method exprs.
Daniel Jasper [Tue, 10 Jun 2014 14:44:02 +0000 (14:44 +0000)]
clang-format: [JS] Treat dict literals similar to objc method exprs.

Before:
  return {
    link:
        function() {
          f();  //
        }
        };
  return {
    a: a,
    link: function() {
      f();  //
    }
  }

After:
  return {
    link: function() {
      f();  //
    }
  };
  return {
    a: a,
    link: function() {
      f();  //
    }
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210537 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd detection of OS X relocatable SDK to compiler-rt as a lit.util function
Alexander Potapenko [Tue, 10 Jun 2014 14:22:00 +0000 (14:22 +0000)]
Add detection of OS X relocatable SDK to compiler-rt as a lit.util function

Clang's lit cfg already detects the currently selected SDK via
"xcrun --show-sdk-path". The same thing should be done for compiler-rt tests,
to make them work on recent OS X versions. Instead of duplicating the detection
code, this patch extracts the detection function into a lit.util method.

Patch by Kuba Brecka (kuba.brecka@gmail.com),
reviewed at http://reviews.llvm.org/D4072

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210534 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Increase penalty for wrapping array subscript expressions
Daniel Jasper [Tue, 10 Jun 2014 13:27:57 +0000 (13:27 +0000)]
clang-format: Increase penalty for wrapping array subscript expressions

Before:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0].aaaaaaa
                                    [0].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0]
                                    .aaaaaaa[0]
                                    .aaaaaaaaaaaaaaaaaaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210529 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix enum formatting with specific comment.
Daniel Jasper [Tue, 10 Jun 2014 10:42:26 +0000 (10:42 +0000)]
clang-format: Fix enum formatting with specific comment.

Before:
  enum Fruit {  //
    APPLE,
    PEAR };

After:
  enum Fruit {  //
    APPLE,
    PEAR
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210522 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImprove diagnostic mapping terminology
Alp Toker [Tue, 10 Jun 2014 09:31:37 +0000 (09:31 +0000)]
Improve diagnostic mapping terminology

Diagnostic mappings are used to calculate the final severity of diagnostic
instances.

Detangle the implementation to reflect the terminology used in documentation
and bindings.

No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210518 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't suppress backend diagnostics in system headers
Alp Toker [Tue, 10 Jun 2014 07:03:25 +0000 (07:03 +0000)]
Don't suppress backend diagnostics in system headers

Doing so would be inconsistent with the common fallback case where backend
diagnostics without source locations are emitted unconditionally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210515 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Support variadic lambda captures.
Daniel Jasper [Tue, 10 Jun 2014 06:39:03 +0000 (06:39 +0000)]
clang-format: Support variadic lambda captures.

Before:
  return [ i, args... ]{};

After:
  return [i, args...] {};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210514 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Handle multiline strings inside ternary expressions.
Daniel Jasper [Tue, 10 Jun 2014 06:27:23 +0000 (06:27 +0000)]
clang-format: Handle multiline strings inside ternary expressions.

With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210513 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoShow -Wdate-time in system headers
Alp Toker [Tue, 10 Jun 2014 06:09:00 +0000 (06:09 +0000)]
Show -Wdate-time in system headers

Anyone enabling this warning would expect to hear about all occurrences
including those in system headers that can cause non-reproducible builds.

To achieve this, rework ShowInSystemHeader to remove broken unused mapping code
that didn't make sense with a simpler and correct scheme.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210512 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImplement -Wdate-time preprocessor warning
Alp Toker [Tue, 10 Jun 2014 06:08:51 +0000 (06:08 +0000)]
Implement -Wdate-time preprocessor warning

This GCC warning is useful for validating reproducible builds
and might help when tracking down issues with modules too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210511 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImprove specificity in the diag-mapping2.c test
Alp Toker [Tue, 10 Jun 2014 06:08:41 +0000 (06:08 +0000)]
Improve specificity in the diag-mapping2.c test

Make sure grep catches the correct diagnostic, otherwise this test fails to
detect broken functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210510 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImprove checking for dynamic initializers of dllimport fields in template instantiation
Hans Wennborg [Tue, 10 Jun 2014 00:55:51 +0000 (00:55 +0000)]
Improve checking for dynamic initializers of dllimport fields in template instantiation

We would previously assert if the initializer was dependent. I also think that
checking isConstantInitializer is more correct here than checkInitIsICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210505 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible
Alp Toker [Mon, 9 Jun 2014 23:59:38 +0000 (23:59 +0000)]
Make '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible

It turns out the trailing '=' really is part of the option name spelling and
treating it as such gets us compatible with GCC's -Werror= and pragmas.

(GCC doesn't appear to support any -Wno- form for this diagnostic but we do.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210503 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReduce indentation in ActOnIdExpression, NFC
Reid Kleckner [Mon, 9 Jun 2014 23:16:24 +0000 (23:16 +0000)]
Reduce indentation in ActOnIdExpression, NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210499 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoving an "if (this == nullptr)" check from two print methods. The condition
Richard Trieu [Mon, 9 Jun 2014 22:53:25 +0000 (22:53 +0000)]
Removing an "if (this == nullptr)" check from two print methods.  The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210498 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Consider block pointer as NSObject as well as conforming to
Fariborz Jahanian [Mon, 9 Jun 2014 21:42:01 +0000 (21:42 +0000)]
Objective-C. Consider block pointer as NSObject as well as conforming to
'NSCopying' protocol when diagnosing block to ObjC pointer conversion.
// rdar://16739120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210491 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDisallow multiple inclusion of clang/Config/config.h
Alp Toker [Mon, 9 Jun 2014 19:09:28 +0000 (19:09 +0000)]
Disallow multiple inclusion of clang/Config/config.h

Internal config.h headers are only meant to be included from the main file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210487 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAllow definition of dllimport static fields in partial specializations (PR19956)
Hans Wennborg [Mon, 9 Jun 2014 18:30:28 +0000 (18:30 +0000)]
Allow definition of dllimport static fields in partial specializations (PR19956)

This expands the logic from r210141 to cover partial specializations too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210484 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix line numbers for code inlined from __nodebug__ functions.
Evgeniy Stepanov [Mon, 9 Jun 2014 09:09:19 +0000 (09:09 +0000)]
Fix line numbers for code inlined from __nodebug__ functions.

Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210459 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PPC64LE] Implement little-endian semantics for vec_sums
Bill Schmidt [Mon, 9 Jun 2014 03:31:47 +0000 (03:31 +0000)]
[PPC64LE] Implement little-endian semantics for vec_sums

The PowerPC vsumsws instruction, accessed via vec_sums, is defined
architecturally with a big-endian bias, in that the second input vector
and the result always reference big-endian element 3 (little-endian
element 0).  For ease of porting, the programmer wants elements 3 in
both cases.

To provide this semantics, for little endian we generate a permute for
the second input vector prior to the vsumsws instruction, and generate
a permute for the result vector following the vsumsws instruction.

The correctness of this code is tested by the new sums.c test added in
a previous patch, as well as the modifications to
builtins-ppc-altivec.c in the present patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210449 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Mon, 9 Jun 2014 02:04:02 +0000 (02:04 +0000)]
[C++11] Use 'nullptr'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210448 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert tests I recently add to use -verify instead of FileCheck.
Joey Gouly [Sun, 8 Jun 2014 21:28:54 +0000 (21:28 +0000)]
Convert tests I recently add to use -verify instead of FileCheck.

This uncovered something strange. Diagnostics for InlineAsm have source locations
that don't really map to where they are within the .c source file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210440 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Use 'nullptr'. Unittests edition.
Craig Topper [Sun, 8 Jun 2014 08:38:12 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Unittests edition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210423 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Use 'nullptr'. Tools edition.
Craig Topper [Sun, 8 Jun 2014 08:38:04 +0000 (08:38 +0000)]
[C++11] Use 'nullptr'. Tools edition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210422 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSplit out inline asm parsing into ParseStmtAsm.cpp
Alp Toker [Sun, 8 Jun 2014 05:40:04 +0000 (05:40 +0000)]
Split out inline asm parsing into ParseStmtAsm.cpp

This change isolates various llvm/MC headers from the rest of the parser and
better aligns with the existing SemaStmtAsm.cpp.

No change in functionality, code move only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210420 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't include llvm/MC/MCParser throughout all of Sema
Alp Toker [Sun, 8 Jun 2014 05:11:37 +0000 (05:11 +0000)]
Don't include llvm/MC/MCParser throughout all of Sema

Requires LLVM r210417.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210418 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Simplify microsoft mangling of template instantiations
David Majnemer [Sun, 8 Jun 2014 04:51:13 +0000 (04:51 +0000)]
MS ABI: Simplify microsoft mangling of template instantiations

Use mangled template instantiation name as key for back references.
Templates have their own context for back references, so their mangling
is always the same regardless of context. This avoids mangling template
instantiations twice.

Patch by Agustín Bergé!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210416 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDeclObjC: Fix comments about bad API
Alp Toker [Sat, 7 Jun 2014 23:31:01 +0000 (23:31 +0000)]
DeclObjC: Fix comments about bad API

What's going on here isn't overriding but rather the sketchy practice of member
hiding (shadowing of base members).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210404 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAvoid dubious IdentifierInfo::getNameStart() uses
Alp Toker [Sat, 7 Jun 2014 23:30:53 +0000 (23:30 +0000)]
Avoid dubious IdentifierInfo::getNameStart() uses

These cases in particular were incurring an extra strlen() when we already knew
the length. They appear to be leftovers from when the interfaces worked with C
strings that have continued to compile due to the implicit StringRef ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210403 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoStringRefize TargetInfo::getABI()
Alp Toker [Sat, 7 Jun 2014 23:30:42 +0000 (23:30 +0000)]
StringRefize TargetInfo::getABI()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210402 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDriver: add -m{,no-}long-calls support
Saleem Abdulrasool [Sat, 7 Jun 2014 19:32:38 +0000 (19:32 +0000)]
Driver: add -m{,no-}long-calls support

This mirrors the GCC option for the ARM backend.  This option enables the
backend option "-enable-arm-long-calls".  The default behaviour is that this is
disabled due to the slight overhead of the generated calls.

If the target of jumps are greater than 64M range of offset-based jumps, then
the target address must be loaded into a register to make an indirect jump.  The
backend support for this has been present, but was not previously controllable
by the proper flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210398 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUnbreak release builds.
Arnold Schwaighofer [Sat, 7 Jun 2014 02:30:08 +0000 (02:30 +0000)]
Unbreak release builds.

This test case relies on basic block labels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210392 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PPC64LE] Implement little-endian semantics for vec_unpack[hl]
Bill Schmidt [Sat, 7 Jun 2014 02:20:52 +0000 (02:20 +0000)]
[PPC64LE] Implement little-endian semantics for vec_unpack[hl]

The PowerPC vector-unpack-high and vector-unpack-low instructions
are defined architecturally with a big-endian bias, in that the vector
element numbering is assumed to be "left to right" regardless of
whether the processor is in big-endian or little-endian mode.  This
effectively reverses the meaning of "high" and "low."  Such a
definition is unnatural for little-endian code generation.

To facilitate ease of porting, the vec_unpackh and vec_unpackl
interfaces are designed to use natural element ordering, so that
elements are numbered according to little-endian design principles
when code is generated for a little-endian target.  The desired
semantics can be achieved by using the opposite instruction for
little-endian mode.  That is, when a call to vec_unpackh appears in
the code, a vector-unpack-low is generated, and when a call to
vec_unpackl appears in the code, a vector-unpack-high is generated.

The correctness of this code is tested by the new unpack.c test
added in a previous patch, as well as the modifications to
builtins-ppc-altivec.c in the present patch.

Note that these interfaces were originally incorrectly implemented
when they take a vector pixel argument.  This patch corrects this
implementation for both big- and little-endian code generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210391 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PPC64LE] Update test for vec_sum2s interface
Bill Schmidt [Sat, 7 Jun 2014 01:47:42 +0000 (01:47 +0000)]
[PPC64LE] Update test for vec_sum2s interface

Commit r210384 prematurely included changes to the little-endian
implementation of the vec_sum2s interface.  This patch modifies
test/CodeGen/builtins-ppc-altivec.c to test those changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210389 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix crash declaring global allocation function with zero parameters. Fixes PR19968!
Nick Lewycky [Sat, 7 Jun 2014 00:43:57 +0000 (00:43 +0000)]
Fix crash declaring global allocation function with zero parameters. Fixes PR19968!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210388 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix my poor grammar from r210372
Richard Trieu [Fri, 6 Jun 2014 23:56:22 +0000 (23:56 +0000)]
Fix my poor grammar from r210372

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210387 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PPC64LE] Update builtins-ppc-altivec.c for PPC64 and PPC64LE
Bill Schmidt [Fri, 6 Jun 2014 23:12:00 +0000 (23:12 +0000)]
[PPC64LE] Update builtins-ppc-altivec.c for PPC64 and PPC64LE

The Altivec builtin test case test/CodeGen/builtins-ppc-altivec.c has
always been executed only for 32-bit PowerPC.  These tests are equally
valid for 64-bit PowerPC.  This patch updates the test to be run for
three targets:  powerpc-unknown-unknown, powerpc64-unknown-unknown,
and powerpc64le-unknown-unknown.  The expected code generation changes
for some of the Altivec builtins for little endian, so this patch adds
new CHECK-LE variants to the test for the powerpc64le target.

These tests satisfy the testing requirements for some previous patches
committed over the last couple of days for lib/Headers/altivec.h:
r210279 for vec_perm, r210337 for vec_mul[eo], and r210340 for
vec_pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210384 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDelay lookup of simple default template arguments under -fms-compatibility
Reid Kleckner [Fri, 6 Jun 2014 22:36:36 +0000 (22:36 +0000)]
Delay lookup of simple default template arguments under -fms-compatibility

MSVC delays parsing of default arguments until instantiation.  If the
default argument is never used, it is never parsed.  We don't model
this.

Instead, if lookup of a type name fails in a template argument context,
we form a DependentNameType, which will be looked up at instantiation
time.

This fixes errors about 'CControlWinTraits' in atlwin.h.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D3995

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210382 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[MS-ABI] Implement dynamic_cast
Warren Hunt [Fri, 6 Jun 2014 22:12:37 +0000 (22:12 +0000)]
[MS-ABI] Implement dynamic_cast
This patch implements call lower from dynamic_cast to __RTDynamicCast
and __RTCastToVoid.  Test cases are included.  A feature of note is that
helper function getPolymorphicOffset is placed in such a way that it can
be used by EmitTypeid (to be implemented in a later patch) without being
moved.  Details are included as comments directly in the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210377 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd -Wtautological-undefined-compare and -Wundefined-bool-conversion warnings
Richard Trieu [Fri, 6 Jun 2014 21:39:26 +0000 (21:39 +0000)]
Add -Wtautological-undefined-compare and -Wundefined-bool-conversion warnings
to detect underfined behavior involving pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210372 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix DOS-style newlines.
Eli Bendersky [Fri, 6 Jun 2014 20:31:48 +0000 (20:31 +0000)]
Fix DOS-style newlines.

A previous patch r210330 (and possibly another) introduced DOS-style newlines
into a UNIX newline formatted file.

Patch by Mark Heffernan (http://reviews.llvm.org/D4046)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210369 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Update the thunk linkage computation
Hans Wennborg [Fri, 6 Jun 2014 20:04:01 +0000 (20:04 +0000)]
MS ABI: Update the thunk linkage computation

As suggested by Reid:

 - class has GVA_Internal linkage -> internal
 - thunk has return adjustment -> weak_odr, to handle evil corner case [1]
 - all other normal methods -> linkonce_odr

 1. Evil corner case:

  struct Incomplete;
  struct A { int a; virtual A *bar(); };
  struct B { int b; virtual B *foo(Incomplete); };
  struct C : A, B { int c; virtual C *foo(Incomplete); };
  C c;

Here, the thunk for C::foo() will be emitted when C::foo() is defined, which
might be in a different translation unit, so it needs to be weak_odr.

Differential Revision: http://reviews.llvm.org/D3992

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210368 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotest/SemaCXX/undefined-internal.cpp: Remove target triple.
Hans Wennborg [Fri, 6 Jun 2014 17:51:25 +0000 (17:51 +0000)]
test/SemaCXX/undefined-internal.cpp: Remove target triple.

This test seems to run fine in both MS and Itanium C++ ABI mode these days.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210357 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDefer codegen of inline method definitions to the end of current top level declaration
Hans Wennborg [Fri, 6 Jun 2014 17:36:17 +0000 (17:36 +0000)]
Defer codegen of inline method definitions to the end of current top level declaration

We would previously fail to emit a definition of bar() for the following code:

  struct __declspec(dllexport) S {
    void foo() {
      t->bar();
    }
    struct T {
      void bar() {}
    };
    T *t;
  };

Note that foo() is an exported method, but bar() is not. However, foo() refers
to bar() so we need to emit its definition. We would previously fail to
realise that bar() is used.

By deferring the method definitions until the end of the top level declaration,
we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms
to decide whether the method should be emitted or not.

Differential Revision: http://reviews.llvm.org/D4038

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210356 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRetain an expression pack expansion when the parameter pack expansion code asks
Richard Smith [Fri, 6 Jun 2014 17:33:35 +0000 (17:33 +0000)]
Retain an expression pack expansion when the parameter pack expansion code asks
us to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210355 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR14841: If partial substitution of explicitly-specified template arguments
Richard Smith [Fri, 6 Jun 2014 16:00:50 +0000 (16:00 +0000)]
PR14841: If partial substitution of explicitly-specified template arguments
results in a template having too many arguments, but all the trailing arguments
are packs, that's OK if we have a partial pack substitution: the trailing pack
expansions may end up empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210350 91177308-0d34-0410-b5e6-96231b3b80d8