Commit Graph

5427 Commits

Author SHA1 Message Date
Benjamin Kramer 9299637dc0 Pass llvm::Triple objects by const reference.
Copying isn't cheap as it contains a std::string.

llvm-svn: 202880
2014-03-04 19:31:42 +00:00
Timur Iskhodzhanov 3a9ac93478 First step towards fixing PR18967 - simplify the ComputeThisOffset interface
llvm-svn: 202870
2014-03-04 18:17:38 +00:00
Sean Callanan c94711c7e3 When deciding whether or not to resolve two
anonymous structs to the same Decl in the
ASTImporter, ensure that both are filled in
from their external sources (if present).
Otherwise two different structs may be 
identified erroneously.

llvm-svn: 202869
2014-03-04 18:11:50 +00:00
David Majnemer 8f77453f7c MS ABI: Mangle variable templates properly
We wouldn't recognize variable templates as being templates leading us
to leave the template arguments off of the mangled name.  This would
allow two unrelated templates to map to the same mangled name.

N.B.  While MSVC doesn't support variable templates as of this date,
this mangling is the most likely thing they will choose to use.  Their
demangler can successfully demangle our manglings with the template
arguments shown.

llvm-svn: 202789
2014-03-04 05:38:05 +00:00
Richard Smith 309271b0ad Fix typo that resulted in names at TU scope getting lost sometimes after a
module import.

llvm-svn: 202771
2014-03-04 00:21:14 +00:00
Benjamin Kramer a741b8c451 [C++11] Simplify compare operators with std::tie.
No functionality change.

llvm-svn: 202755
2014-03-03 20:26:46 +00:00
David Majnemer b100410365 Normalize line endings
Some files had CRLF line terminators, some only had a mixture of
CRLF and LF.  Switch to LF.

llvm-svn: 202659
2014-03-02 18:46:05 +00:00
Benjamin Kramer 867ea1d426 [C++11] Replace llvm::tie with std::tie.
llvm-svn: 202639
2014-03-02 13:01:17 +00:00
Benjamin Kramer bbdd7640e8 [C++11] Replace verbose functors with succinct lambdas
No functionality change.

llvm-svn: 202590
2014-03-01 14:48:57 +00:00
Reid Kleckner 3331128994 Fix leak in MicrosoftVTableContext
llvm-svn: 202558
2014-02-28 23:26:22 +00:00
Reid Kleckner 383c2f232e Attempt to fix non-MSVC build
llvm-svn: 202458
2014-02-28 01:12:55 +00:00
Reid Kleckner ad59deb436 -fdump-record-layouts: Sort nvbases by offset before printing them
It makes our -fdump-record-layouts a little more sane.

llvm-svn: 202457
2014-02-28 01:03:09 +00:00
Richard Trieu 86738692fd "&&&" != "&&"
llvm-svn: 202444
2014-02-27 23:59:14 +00:00
Reid Kleckner d6f9b83ae1 MS ABI: Attempt to fix DenseMap entry reference invalidation
llvm-svn: 202441
2014-02-27 22:51:43 +00:00
John McCall 95833f33bd Diagnose attempts to apply ms_struct to records with base classes
or virtual functions, but permit that error to be downgraded to
a warning (with -Wno-error=incompatible-ms-struct), and officially
support this kind of dual, ABI-mixing layout.

The basic problem here is that projects which use ms_struct are often
not very circumspect about what types they annotate; for example,
some projects enable the pragma in a prefix header and then only
selectively disable it around system header inclusions.  They may
only care about binary compatibility with MSVC for a subset of
those structs, but that doesn't mean they have no binary
compatibility concerns at all for the rest; thus we are essentially
forced into supporting this hybrid ABI.  But it's reasonable for
us to at least point out the places where we're not making
any guarantees.

The original diagnostic was for dynamic classes, i.e. those with
virtual functions or virtual bases; I've extended it to include
all classes with bases, because we are not actually making any
attempt to duplicate MSVC's base subobject layout in ms_struct
(and it is indeed quite different from Itanium, even for
non-virtual bases).

rdar://16178895

llvm-svn: 202427
2014-02-27 20:30:49 +00:00
Reid Kleckner 9c6e9e313d MS ABI: Fix vftable mangling by using the vbtable name algorithm
Summary:
This merges VFPtrInfo and VBTableInfo into VPtrInfo, since they hold
almost the same information.  With that change, the vbtable mangling
code can easily be applied to vftable data and we magically get the
correct, unambiguous vftable names.

Fixes PR17748.

Reviewers: timurrrr, majnemer

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2893

llvm-svn: 202425
2014-02-27 19:40:09 +00:00
Alexey Bataev 1b59ab5683 [OPENMP] First changes for Parsing and Sema for 'omp simd' directive support
llvm-svn: 202360
2014-02-27 08:29:12 +00:00
Argyrios Kyrtzidis 1b7ed91e44 [ASTUnit] Fix use-after-free bug in ASTUnit::getMainBufferWithPrecompiledPreamble().
With r197755 we started reading the contents of buffer file entries, but the
buffers may point to ASTReader blobs that have been disposed.

Fix this by having the CompilerInstance object keep a reference to the ASTReader
as well as having the ASTContext keep reference to the ExternalASTSource.

This was very difficult to construct a test case for.
rdar://16149782

llvm-svn: 202346
2014-02-27 04:11:59 +00:00
Hans Wennborg d7895aca99 [MS ABI] Error instead of generating bad vftables for certain virtual hierarchies (PR18967)
Erroring out until we fix the bug means we don't have to keep chasing down
this same miscompile in a bunch of different places.

Differential Revision: http://llvm-reviews.chandlerc.com/D2890

llvm-svn: 202331
2014-02-27 01:14:31 +00:00
NAKAMURA Takumi 9698686505 [CMake] Use LINK_LIBS instead of target_link_libraries().
llvm-svn: 202238
2014-02-26 06:41:29 +00:00
Benjamin Kramer 2907b08219 Pretty Printer: Print constexpr and ref qualifiers. Don't print return types on destructors.
llvm-svn: 202181
2014-02-25 18:49:49 +00:00
Reid Kleckner db673ca26a MS ABI: Just use getTypeInfoInChars to get the field size
This was changed to use manual desugaring and multiplication in r201832
and fixed for multi-dimensional arrays in r201917.  However, it breaks
down in the presence of typedefs.  Rather than attempting to handle all
the desugaring, just go back to calling the generic type info code.

This was discovered while compiling SIInstrWaits.cpp in the R600
backend.

llvm-svn: 202175
2014-02-25 18:08:48 +00:00
Benjamin Kramer 00e8a1915a Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."
There were many additional tests that had the bad behavior baked in.

llvm-svn: 202174
2014-02-25 18:03:55 +00:00
Rafael Espindola 8e38871865 Revert "Pretty Printer: Fix printing of conversion operator decls and calls."
This reverts commit r202167.

It broke Analysis/auto-obj-dtors-cfg-output.cpp

llvm-svn: 202173
2014-02-25 17:39:16 +00:00
Benjamin Kramer 48f52e926d Pretty Printer: Fix printing of conversion operator decls and calls.
- Don't emit anything when we encounter a call to a conversion operator.
    "bar(a & b)" instead of "bar(a & b.operator int())"
  This preserves the semantics and is still idempotent if we print the AST multiple times.

- Properly print declarations of conversion operators.
    "explicit operator bool();" instead of "bool operator _Bool();"

PR18776.

llvm-svn: 202167
2014-02-25 17:26:26 +00:00
Christian Pirker 9b019ae899 Add AArch64 big endian Target (aarch64_be)
llvm-svn: 202151
2014-02-25 13:51:00 +00:00
Benjamin Kramer cdac761475 Sema: When merging objc string literals, give the result a constant array type.
Also assert that we never create non-array string literals again.

PR18939.

llvm-svn: 202147
2014-02-25 12:26:20 +00:00
Alexey Bataev 1319381686 Fix for Bug 18536 - Bad alignment in clang/AST/StmpOpenMP.h
llvm-svn: 202141
2014-02-25 11:25:38 +00:00
David Majnemer 1d4db8f719 AST: Small code cleanup
Move the pointer to be adjacent to the variable instead of the type.

No functional change.

llvm-svn: 202089
2014-02-24 23:43:27 +00:00
David Majnemer 8b6bd571c8 Sema: Make getPreferredTypeAlign respect alignments specified with an aligned attribute on a typedef
When calculating the preferred alignment of a type, consider if a alignment
attribute came from a typedef declaration.  If one did, do not naturally align
the type.

Patch by Stephan Tolksdorf, with a little tweaking and an additional testcase by me.

llvm-svn: 202088
2014-02-24 23:34:17 +00:00
Kevin Qin ad64f6d4e5 [AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.
Most 64-bit targets define int64_t as long int, and AArch64 should
make same definition to follow LP64 model. In GNU tool chain, int64_t
is defined as long int for 64-bit target. So to get consistent with GNU,
it's better Changing int64_t from 'long long int' to 'long int',
otherwise clang will get different name mangling suffix compared with g++.

llvm-svn: 202004
2014-02-24 02:45:03 +00:00
Warren Hunt c85942038a [MS-ABI] Fix MSRecordLayout to handel MultiDimensionalArrays
A recent change caused multi-dimensional arrays not to be handled 
correctly, this patch fixes that.  Also, it adds a lit test for 
multi-dimensional arrays.

llvm-svn: 201917
2014-02-22 00:40:37 +00:00
NAKAMURA Takumi 7da9487dd4 [CMake] Get rid of explicit dependencies to include/clang/*.inc and introduce CLANG_TABLEGEN_TARGETS.
This does;
  - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list.
  - List of targets is added to LLVM_COMMON_DEPENDS.
  - all clang libraries and targets depend on generated headers.

You might wonder this would be regression, but in fact, this is little loss.
  - Almost all of clang libraries depend on tblgen'd files and clang-tblgen.
  - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild.
  - Each library's dependencies to tblgen'd files might vary along headers' structure.
    It made hard to track and update *really optimal* dependencies.

Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS.

llvm-svn: 201842
2014-02-21 07:59:59 +00:00
Warren Hunt f6ec74826e [MS-ABI] Update to zero-sized padding algorithm
Slight change to the way zero-sized sub-objects are tracked in the 
presence of virtual bases.
In addition we correctly distinguish between dsize and nvsize.
addresses http://llvm.org/bugs/show_bug.cgi?id=18826
Unit tests are included.

llvm-svn: 201832
2014-02-21 01:40:35 +00:00
Reid Kleckner af1465cef5 Revert "Enable MSRecordLayout in the presence of external sources."
This reverts commit r201810.

It was failing these tests on my workstation:
    Clang :: CodeGen/override-layout.c
    Clang :: CodeGenCXX/override-layout.cpp
    Clang :: PCH/check-deserializations.cpp

llvm-svn: 201823
2014-02-20 23:07:29 +00:00
Warren Hunt 2350c867cb Enable MSRecordLayout in the presence of external sources.
External sources shouldn't prevent the layout engine from using 
MSLayout.  If lldb were to support debugging in microsoft mode, some 
code will need to be added to MSRecordLayoutBuilder to handel external 
layouts.

llvm-svn: 201810
2014-02-20 20:14:29 +00:00
Argyrios Kyrtzidis 3d9e38273b [AST] Follow-up for r201468, move the check to the caller and add an assertion.
Suggested by Richard Smith.

llvm-svn: 201753
2014-02-20 04:00:01 +00:00
Reid Kleckner 588c937228 Use llvm::DeleteContainerSeconds when possible
llvm-svn: 201739
2014-02-19 23:44:52 +00:00
Reid Kleckner 6701de2abe MS ABI: Let non-virtual method overloads participate in vftable ordering
In the Microsoft ABI, the vftable is laid out as if all methods in every
overload set were declared in reverse order of declaration at the point
of declaration of the first overload in the set.

Previously we only considered virtual methods in an overload set, but
MSVC includes non-virtual methods for ordering purposes.

Fixes PR18902.

llvm-svn: 201722
2014-02-19 22:06:10 +00:00
David Majnemer 8eec58f35e MS ABI: Refactor extended qualifiers
Extended qualifiers can appear in many places, refactor the code so it's
more reusable.  Add tests in areas where we've increased compatibility.

llvm-svn: 201574
2014-02-18 14:20:10 +00:00
David Majnemer 0b6bf8a63a MS ABI: Add support for mangling __restrict
Pointer types in the MSVC ABI are a bit awkward, the width of the
pointer is considered a kind of CVR qualifier.

Restrict is handled similarly to const and volatile but is mangled after
the pointer width qualifier.

This fixes PR18880.

llvm-svn: 201569
2014-02-18 12:58:35 +00:00
Richard Smith 03c05038e0 PR18839: 'extern "C++"' also adds an implicit 'extern', not just 'extern "C"'.
llvm-svn: 201537
2014-02-17 23:34:47 +00:00
Argyrios Kyrtzidis 90181d6180 [Sema] Fix assertion hit while trying to do constant evaluation for a dependent expression
inside a GNU statement expression.

rdar://16064952

llvm-svn: 201468
2014-02-15 18:53:57 +00:00
David Blaikie 2e66bfc9a1 Print anonymous namespaces as <anonymous namespace> instead of <anonymous>
llvm-svn: 201436
2014-02-14 22:12:51 +00:00
Alexey Bataev aadd52e5cc [OPENMP] 'if' clause support (no CodeGen support)
llvm-svn: 201297
2014-02-13 05:29:23 +00:00
Yunzhong Gao 5fd0c9d032 Fixing a compiler assertion with zero-width bit-fields in packed structs.
According to the GNU docs, zero-sized bitfields should not be affected by the
packed attribute.

Differential Revision: http://llvm-reviews.chandlerc.com/D2693

llvm-svn: 201288
2014-02-13 02:45:10 +00:00
John McCall 76e1818a2b ms_struct layout replaces platform-specific behavior like
useBitFieldTypeAlignment() and appears to ignore the special
bit-packing semantics of __attribute__((packed)).

Further flesh out an already-extensive comment.

llvm-svn: 201282
2014-02-13 00:50:08 +00:00
Reid Kleckner c0dca6ded7 MS ABI: Implement #pragma vtordisp() and clang-cl /vdN
These features are new in VS 2013 and are necessary in order to layout
std::ostream correctly.  Currently we have an ABI incompatibility when
self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper
in gtest.

This change adds another implicit attribute, MSVtorDispAttr, because
implicit attributes are currently the best way to make sure the
information stays on class templates through instantiation.

Reviewers: majnemer

Differential Revision: http://llvm-reviews.chandlerc.com/D2746

llvm-svn: 201274
2014-02-12 23:50:26 +00:00
David Majnemer 79a1c89066 MS ABI: vptr injection should obey alignment requirements
vptr injection must inject padding equivalent to the alignment of the
most aligned non-virtual subobject, not the alignment of the enclosing
record.

To fascilitate this change, don't let record layout observe the
alignment of the record until we've injected our vptrs. Also, do not
allow the alignment of vbases to affect required alignment until just
before we insert the vtordisp field.

llvm-svn: 201199
2014-02-12 00:43:02 +00:00
Argyrios Kyrtzidis 77ed8972fa [Sema] Revert the change in r200622 that allowed integer casts to silence -Wnon-literal-null-conversion in C code.
It is actually useful to warn in such cases, thanks to Dmitri for pushing on this and making us see the light!

Related to rdar://15925483 and rdar://15922612. The latter radar is where the usefulness of the warning is most clear.

llvm-svn: 201165
2014-02-11 17:53:22 +00:00
David Majnemer 4bb0980d96 MS ABI: Add support for #pragma pointers_to_members
Introduce a notion of a 'current representation method' for
pointers-to-members.

When starting out, this is set to 'best case' (representation method is
chosen by examining the class, selecting the smallest representation
that would work given the class definition or lack thereof).

This pragma allows the translation unit to dictate exactly what
representation to use, similar to how the inheritance model keywords
operate.

N.B.  PCH support is forthcoming.

Differential Revision: http://llvm-reviews.chandlerc.com/D2723

llvm-svn: 201105
2014-02-10 19:50:15 +00:00
Reid Kleckner e253b098d3 MS ABI: Use the most recent decl to check the inheritance model
This was crashing compilation of DeclContext::buildLookupImpl<>.

llvm-svn: 201013
2014-02-08 01:15:37 +00:00
Richard Trieu 6d92e50263 Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing on
certain receiver types.

llvm-svn: 200953
2014-02-06 23:26:23 +00:00
David Majnemer 1e378e428b MS ABI: Handle indirect field decls in template args
Properly support fields that come from anonymous unions and structs
when used as template arguments for pointer to data member params.

llvm-svn: 200921
2014-02-06 12:46:52 +00:00
David Majnemer 763584dc64 MS ABI: Tweak pointer-to-member mangling/inheritance model selection
Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
  pointer-to-member parameter, nail down an inheritance model.
  N.B. We will chose an inheritance model even if we won't ultimately
  choose the template to instantiate!  Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
  not zero. Previously, we chose an offset of 0.

llvm-svn: 200920
2014-02-06 10:59:19 +00:00
Nick Lewycky 1f529663bb Fix -Wunused-variable 'FD' by using it instead of ND when they're equal but FD
has a more precise type.

llvm-svn: 200889
2014-02-05 23:53:29 +00:00
Benjamin Kramer c24767b4ad Clean up some particularly ugly casting.
No functionality change.

llvm-svn: 200877
2014-02-05 21:29:05 +00:00
Reid Kleckner 09b47d166b MS ABI: Fix mangling of static methods and function references
Function references always use $1? like function pointers and never $E?
like var decl references.  Static methods are mangled like function
pointers.

llvm-svn: 200869
2014-02-05 18:59:38 +00:00
Reid Kleckner 96f8f9339d MS ABI: Mangle member pointer template arguments
Member pointers are mangled as they would be represented at runtime.
They can be a single integer literal, single decl, or a tuple with some
more numbers tossed in.  With Clang today, most of those numbers will be
zero because we reject pointers to members of virtual bases.

This change required moving VTableContextBase ownership from
CodeGenVTables to ASTContext, because mangling now depends on vtable
layout.

I also hoisted the inheritance model helpers up to be inline static
methods of MSInheritanceAttr.  This makes the AST code that deals with
member pointers much more readable.

MSVC doesn't appear to have stable manglings of null member pointers:
- Null data memptrs in function templates have a mangling collision with
  the first field of a non-polymorphic single inheritance class.
- The mangling of null data memptrs changes if you add casts.
- Large null function memptrs in class templates crash MSVC.

Clang uses the class template mangling for null data memptrs and the
function template mangling for null function memptrs to deal with this.

Reviewers: majnemer

Differential Revision: http://llvm-reviews.chandlerc.com/D2695

llvm-svn: 200857
2014-02-05 17:27:08 +00:00
Jordan Rose 749b581272 Fix typo in CastExpr::getCastKindName.
Patch by Mathieu Baudet!

llvm-svn: 200817
2014-02-05 03:49:45 +00:00
Benjamin Kramer 3a7cc81d52 Report a correct end location for nameless parameters.
Ranges before:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~~ ~~~~~~

Ranges after:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~  ~~~~~

This does not change the actual location of the ParmVarDecl, it still
points to the location where the name would be. PR17970.

llvm-svn: 200640
2014-02-02 15:28:46 +00:00
Argyrios Kyrtzidis 3e3305daba [Sema] Follow-up on r200521 for the -Wnon-literal-null-conversion warning and revert its behavior for C++.
llvm-svn: 200622
2014-02-02 05:26:43 +00:00
Reid Kleckner bd63b33854 [ms-cxxabi] Raise aggregate memptr alignment to 8 for x86_32
With this change, we give different results for __alignof than MSVC, but
our record layout is compatible.

Some data member pointers also now have a size that is not a multiple of
their alignment.

Fixes PR18618.

Reviewers: majnemer

Differential Revision: http://llvm-reviews.chandlerc.com/D2669

llvm-svn: 200585
2014-01-31 22:28:50 +00:00
David Majnemer 2c4e00ac1c Sema: Diagnose improper application of inheritance keywords
We would previously allow inappropriate inheritance keywords to appear
on class declarations.  We would also allow inheritance keywords on
templates which were not fully specialized; this was divergent from
MSVC.

Differential Revision: http://llvm-reviews.chandlerc.com/D2585

llvm-svn: 200423
2014-01-29 22:07:36 +00:00
John McCall 30268ca2e0 Extensively comment bitfield layout, rearrange some
code for legibility, and fix a bug with bitfields in packed
ms_structs.

rdar://15926990

llvm-svn: 200379
2014-01-29 07:53:44 +00:00
Fariborz Jahanian 33fa962441 Objective-C. provide legacy encoding of *id and *Class types
instead of crashing.  // rdar://15824769.

llvm-svn: 200338
2014-01-28 20:41:15 +00:00
Dmitri Gribenko 6bf8f803f2 Comment parsing: don't crash while parsing \deprecated in a standalone comment
(comment without a decl).

I think this can not happen during normal compilation with -Wdocumentation,
only while using Clang APIs to parse comments outside of a source file.

Based on a patch by Olivier Goffart.

llvm-svn: 200230
2014-01-27 17:55:43 +00:00
Richard Smith 6a6a4bbdd4 PR17052 / DR1560 (+DR1550): In a conditional expression between a glvalue and a
throw-expression, the result is also a glvalue and isn't unnecessarily coerced
to a prvalue.

llvm-svn: 200189
2014-01-27 04:19:56 +00:00
Alp Toker 42a16a67f5 Rename getResultLoc() too
Follow up to r200082.

Spotted by Dmitri

llvm-svn: 200105
2014-01-25 23:51:36 +00:00
Richard Smith f137f9317b PR18283: If a const variable of integral or enumeration type is
initialized from a constant expression in C++98, it can be used in
constant expressions, even if it was brace-initialized. Patch by
Rahul Jain!

llvm-svn: 200098
2014-01-25 20:50:08 +00:00
Alp Toker 1f307f49ef Remove obsolete ObjCMethodDecl arg_type iterator functions
These were set into deprecation in r199773.

llvm-svn: 200086
2014-01-25 17:32:04 +00:00
Alp Toker 314cc81b8c Rename getResultType() on function and method declarations to getReturnType()
A return type is the declared or deduced part of the function type specified in
the declaration.

A result type is the (potentially adjusted) type of the value of an expression
that calls the function.

Rule of thumb:

  * Declarations have return types and parameters.
  * Expressions have result types and arguments.

llvm-svn: 200082
2014-01-25 16:55:45 +00:00
Fariborz Jahanian dad9630398 ObjectiveC. When issuing property implementation is
not using backing ivar warning, ignore when
property is not being synthesized (user declared its
implementation @dynamic). // rdar://1583425

llvm-svn: 199820
2014-01-22 19:02:20 +00:00
Alp Toker a2794f9f36 Introduce and use Decl::getAsFunction() to simplify templated function checks
Lift the getFunctionDecl() utility out of the parser into a general
Decl::getAsFunction() and use it to simplify other parts of the implementation.

Reduce isFunctionOrFunctionTemplate() to a simple type check that works the
same was as the other is* functions and move unwrapping of shadowed decls to
callers so it doesn't get run twice.

Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer.
There's no need to query when we already know the body can't be skipped.

llvm-svn: 199794
2014-01-22 07:29:52 +00:00
Richard Smith e81daee21b When formatting a C++-only declaration name, enable C++ mode in the formatter's
language options. This is not really ideal -- we should require the right
language options to be passed in, or not require language options to format a
name -- but it fixes a number of *obviously* wrong formattings. Patch by
Olivier Goffart!

llvm-svn: 199778
2014-01-22 00:27:42 +00:00
Alp Toker 601b22c377 Correct various uses of 'argument' that in fact refer to function parameters
Cleanup only.

llvm-svn: 199773
2014-01-21 23:35:24 +00:00
David Majnemer b9a5f2d3b6 MSVC ABI: Support C++11's auto on variables
The MSVC C++ ABI always uses the deduced type in place of auto when
generating external names for variables.

N.B.  MSVC doesn't support C++1y's 'operator auto' and this patch will
not give us said functionality.

llvm-svn: 199764
2014-01-21 20:33:36 +00:00
Alp Toker b3fd5cfa81 Update FunctionTypeLoc and related names to match r199686
llvm-svn: 199699
2014-01-21 00:32:38 +00:00
Alp Toker 9cacbabd33 Rename FunctionProtoType accessors from 'arguments' to 'parameters'
Fix a perennial source of confusion in the clang type system: Declarations and
function prototypes have parameters to which arguments are supplied, so calling
these 'arguments' was a stretch even in C mode, let alone C++ where default
arguments, templates and overloading make the distinction important to get
right.

Readability win across the board, especially in the casting, ADL and
overloading implementations which make a lot more sense at a glance now.

Will keep an eye on the builders and update dependent projects shortly.

No functional change.

llvm-svn: 199686
2014-01-20 20:26:09 +00:00
Richard Smith f600441a04 PR18544: don't assert that 'operator new' is not declared inside a namespace;
such an assert will fail in invalid code that does so!

llvm-svn: 199617
2014-01-19 23:25:37 +00:00
Ted Kremenek 256bd96d1c Harden InitListExpr::isStringLiteralInit() against getInit() returning null.
This led to a crash on invalid code (sorry, no good test case).

Fixes <rdar://problem/15831804>.

llvm-svn: 199571
2014-01-19 06:31:34 +00:00
David Majnemer 1cdd96d6ad Revert "Revert r199416, "MS ABI: Improve selection of an inheritance model""
This reverts commit r199475 (which reverted r199416) with fixes for the
breakages.

We wouldn't lock an inheritance model if we saw a pointer-to-member
formed as a result of the address-of operator.

llvm-svn: 199482
2014-01-17 09:01:00 +00:00
NAKAMURA Takumi 5c486cf3f3 Revert r199416, "MS ABI: Improve selection of an inheritance model"
It broke tests for targeting x86_64-pc-win32:

    Clang Tools :: clang-modernize/LoopConvert/array.cpp
    Clang :: CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
    Clang :: CodeGenCXX/member-call-parens.cpp
    Clang :: CodeGenCXX/ptr-to-datamember.cpp
    Clang :: SemaTemplate/instantiate-function-1.cpp

llvm-svn: 199475
2014-01-17 07:33:47 +00:00
Richard Smith 2c6b449098 Issue a warning if a throwing operator new or operator new[] returns a null
pointer, since this invokes undefined behavior. Based on a patch by Artyom
Skrobov! Handling of dependent exception specifications and some additional
testcases by me.

llvm-svn: 199452
2014-01-17 02:09:33 +00:00
Richard Smith beef3453cd Clean up variable template handling a bit, and correct the behavior of name
lookup when declaring a variable template specialization.

llvm-svn: 199438
2014-01-16 23:39:20 +00:00
David Majnemer 37054dd4e7 MS ABI: Improve selection of an inheritance model
The MSVC ABI is rather finicky about the exact representation of it's
pointer-to-member representation.  The exact position of when and where
it will go with one representation versus another appears to be when it
desires the pointer-to-member to be complete.

To properly implement this in clang, do several things:
- Give up on tracking the polymorphic nature of the class.  It isn't
  useful to Sema and is only pertinent when choosing CodeGen-time
  details like whether the field-offset can be 0 instead of -1.
- Insist on locking-in the inheritance model when we ask our
  pointer-to-member type to be complete.  From there, grab the
  underlying CXXRecordDecl and try to make *that* complete.  Once we've
  done this, we can calculate it's inheritance model and apply it using
  an attribute.

N.B. My first bullet point is a lie.  We will eventually care about the
specifics of whether or not a CXXRecordDecl is or is not polymorphic
because MSVC compatible mangling of such things depends on it.  However,
I believe we will handle this in a rather different way.

llvm-svn: 199416
2014-01-16 20:05:57 +00:00
Aaron Ballman 12b9f6535b Factored some function-like type reasoning out of SemaDeclAttr and onto Decl itself. This allows for more declarative subjects in attribute tablegen where the attribute appertains to something function-like, but not strictly a FunctionDecl.
llvm-svn: 199387
2014-01-16 13:55:42 +00:00
Aaron Ballman 36a5350e51 Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute.
Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it.

llvm-svn: 199378
2014-01-16 13:03:14 +00:00
Alp Toker bfa3934f27 Rename language option MicrosoftMode to MSVCCompat
There's been long-standing confusion over the role of these two options. This
commit makes the necessary changes to differentiate them clearly, following up
from r198936.

MicrosoftExt (aka. fms-extensions):
 Enable largely unobjectionable Microsoft language extensions to ease
 portability. This mode, also supported by gcc, is used for building software
 like FreeBSD and Linux kernel extensions that share code with Windows drivers.

MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode):
 Turn on a special mode supporting 'heinous' extensions for drop-in
 compatibility with the Microsoft Visual C++ product. Standards-compilant C and
 C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt.

Note that full -fms-compatibility mode is currently enabled by default on the
Windows target, which may need tuning to serve as a reasonable default.

See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined
type_info out of InitializePredefinedMacros'

No change in behaviour.

llvm-svn: 199209
2014-01-14 12:51:41 +00:00
Warren Hunt 26b944274e [ms-abi] Small Change to pack+alignment interaction.
This patch makes a small behavioral change to the interaction between 
pack and alignment.  Specifically it makes __declspec(align()) on a 
field change that field's alignment without respect to pack but the 
alignment change to the record alignment as a whole still obeys pack.

llvm-svn: 199172
2014-01-14 00:54:36 +00:00
Warren Hunt 6eba907102 [ms-abi] Report VBPtrOffset correctly
Although VBPtrs were being placed correctly by the ms-abi layout engine, 
their offsets were being improperly reported to the ASTRecordLayout 
builder due to a bug.  This patch fixes that and fixes the test cases to 
use the correct values.
y

llvm-svn: 199168
2014-01-14 00:31:30 +00:00
Warren Hunt 4c73e59475 [ms-abi] Reordering __declspec(align) pragma pack handling
This patch moves the check for pragma pack until after the application 
of __declspec align to before pragma pack.  This causes observable 
changes in the use of tail padding for bases.  A test case is included.

llvm-svn: 199154
2014-01-13 22:25:55 +00:00
Warren Hunt badf9e0f84 [ms-abi] Leading VFPtrs don't suppress the leading zero sized flag
The MS-ABI tracks a bit that asserts that the first sub-object is zero 
sized.  This bit is used to add padding between objects if there's the 
potential for zero sized objects to alias.  The bit is still true even 
if the zero sized base is lead by a VFPtr.  This patch makes clang mimic 
that behavior.

llvm-svn: 199132
2014-01-13 19:55:52 +00:00
Reid Kleckner 4f017ceeda [ms-abi] Quick fix layout of an array of records
This fixes llvm::SmallVector, which fixes lots of TUs in the MS ABI self
host.

llvm-svn: 199129
2014-01-13 19:25:00 +00:00
Alp Toker eee59685af Delete inaccurate doc comment - isVariadic is long gone
The canonical documentation in the header is up-to-date.

llvm-svn: 199054
2014-01-12 15:18:15 +00:00
Benjamin Kramer 2210562249 Make helper function static.
llvm-svn: 199013
2014-01-11 18:42:35 +00:00
Nick Lewycky 35a6ef4c35 Add a new attribute 'enable_if' which can be used to control overload resolution based on the values of the function arguments at the call site.
llvm-svn: 198996
2014-01-11 02:50:57 +00:00
Warren Hunt 9425891f28 [ms-abi] Change the way alignment is tracked
This patch more cleanly seperates the concepts of Preferred Alignment 
and Required Alignment.  Most notable that changes to Required Alignment 
do *not* impact preferred alignment until late in struct layout.  This 
is observable when using pragma pack and non-virtual bases and the use 
of tail padding when laying them out.

Test cases included.

llvm-svn: 198988
2014-01-11 01:16:40 +00:00
Warren Hunt 87c2b0400d [ms-abi] Adjusting Rules for Padding Between Bases
The presence of a VBPtr suppresses the presence of zero sized 
sub-objects in the non-virtual portion of the object in the context of 
determining if two base objects need alias-avoidance padding placed 
between them.

Test cases included.

llvm-svn: 198975
2014-01-10 23:32:32 +00:00
Warren Hunt f4518def33 [ms-abi] Handle __declspec(align) on bitfields "properly"
__declspec(align), when applied to bitfields affects their perferred 
alignment instead of their required alignment.  We don't know why.  
Also, #pragma pack(n) turns packing *off* if n is greater than the 
pointer size.  This is now observable because of the impact of 
declspec(align) on bitfields.

llvm-svn: 198907
2014-01-10 01:28:05 +00:00
Richard Smith 7073a2da15 Reapply r198845, reverted in r198849, with a fix to make it valid C++98, not
just valid C++11 =)

Original commit message:

PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
SPARC, where uint64_t apparently requires higher alignment than void*.

llvm-svn: 198903
2014-01-10 00:40:45 +00:00
Warren Hunt 640015cbc3 [ms-abi] Fixing CGRecordLayoutBuilder w.r.t. MS NonVirutalBase Layout
The MS abi lays out *all* non-virtual bases with leading vfptrs before 
laying out non-virutal bases without vfptrs.  This guarantees that the 
primary base is laid out first.  r198818 fixed RecordLayoutBuilder to 
produce compatiable layouts.  This patch fixes CGRecordLayoutBuilder to 
be able to consume those layouts and produce meaningful output without 
tripping any asserts about assumed incoming layout.

A test case is included that shows CGRecordLayoutBuilder in fact 
produces output in the compatiable order.

llvm-svn: 198900
2014-01-09 23:51:31 +00:00
Argyrios Kyrtzidis 62a85daecd Revert "PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on"
It broke building.
This reverts commit r198845.

llvm-svn: 198849
2014-01-09 05:01:04 +00:00
Richard Smith e2f4a2744c PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
SPARC, where uint64_t apparently requires higher alignment than void*.

llvm-svn: 198845
2014-01-09 03:29:54 +00:00
David Blaikie 461f1eaaa1 Fix the clang -Werror build after r198818
llvm-svn: 198837
2014-01-09 02:34:06 +00:00
Warren Hunt d640d7d96e [ms-abi] Refactor Microsoft Record Layout
This patch refactors microsoft record layout to be more "natural".  The 
most dominant change is that vbptrs and vfptrs are injected after the 
fact.  This simplifies the implementation and the math for the offest 
for the first base/field after the vbptr.

llvm-svn: 198818
2014-01-09 00:30:56 +00:00
Richard Smith 26d11be738 RP18408: If a member template is used as a template template argument, it does
not cause the template specialization to have no linkage.

llvm-svn: 198726
2014-01-08 01:51:59 +00:00
Chandler Carruth 5553d0d4ca Sort all the #include lines with LLVM's utils/sort_includes.py which
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.

llvm-svn: 198686
2014-01-07 11:51:46 +00:00
Fariborz Jahanian f1a66de5b9 ObjectiveC. Computation of offsets when doing @encode type encoding
is only used in an assert. Do not do it if assert is not on.

llvm-svn: 198652
2014-01-07 01:02:50 +00:00
Alp Toker b9fa512954 Highlight the previous underlying enum type when diagnosing a mismatch
enum-scoped.cpp:93:6: error: enumeration redeclared with different underlying type 'short' (was 'int')
  enum Redeclare6 : short;
       ^
enum-scoped.cpp:92:6: note: previous declaration is here
  enum Redeclare6 : int;
       ^            ~~~

The redeclaration source range is still missing but this is a step forward,
potentially edging towards a FixIt.

llvm-svn: 198601
2014-01-06 11:31:18 +00:00
Alp Toker ef6b007dc5 Only mark dump() function definitions 'used' in debug builds
This has the dual effect of (1) enabling more dead-stripping in release builds
and (2) ensuring that debug helper functions aren't stripped away in debug
builds, as they're intended to be called from the debugger.

Note that the attribute is applied to definitions rather than declarations in
headers going forward because it's now conditional on NDEBUG:

  /// \brief Mark debug helper function definitions like dump() that should not be
  /// stripped from debug builds.

Requires corresponding macro added in LLVM r198456.

llvm-svn: 198489
2014-01-04 13:47:14 +00:00
Reid Kleckner 5f08094106 [ms-cxxabi] Improve vbtable name mangling accuracy
Summary:
This makes us more compatible with MSVC 2012+ and fixes PR17748 where we
would give two tables the same name.

Rather than doing a fresh depth-first traversal of the inheritance graph
for every record's vbtables, now we memoize vbtable paths for each
record.  By doing memoization, we end up considering virtual bases of
subobjects that come later in the depth-first traversal.  Where
previously we would have ignored a virtual base that we'd already seen,
we now consider it for name mangling purposes without emitting a
duplicate vbtable for it.

Reviewers: majnemer

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2509

llvm-svn: 198462
2014-01-03 23:42:00 +00:00
Aaron Ballman 68af21c975 Fixing a FIXME; the RetTy template parameter is always bool in practice, and so it has been removed. No functional changes intended.
llvm-svn: 198440
2014-01-03 19:26:43 +00:00
Aaron Ballman 75ee4cc830 Removed one of the string versions of getQualifiedNameAsString, and switched over to using printQualifiedName where possible. No functional changes intended.
llvm-svn: 198433
2014-01-03 18:42:48 +00:00
Argyrios Kyrtzidis 2080d90f37 [objc] Refactor and improve functionality for the -Wunused-property-ivar warning.
- Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate
  all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor
- Don't check immediately after the method body is finished, check when the @implementation is finished.
  This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor.
- Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self.

rdar://15727325

llvm-svn: 198432
2014-01-03 18:32:18 +00:00
Aaron Ballman b190f974c9 Fixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and started using it in places it made sense.
No functional changes intended, just API cleanliness.

llvm-svn: 198428
2014-01-03 17:59:55 +00:00
Reid Kleckner b40a27dad8 [ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp
Summary:
No functionality change.

This code should live here long-term because we should be able to use it
to compute correct vftable names.

It turns out that the most natural way to implement the naming algorithm
is to use a caching layer similar to what we already have for virtual
table info in VTableContext.  Subsequent changes will take advantage of
this to fix PR17748, where we have a vbtable name collision.

Reviewers: majnemer

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2499

llvm-svn: 198380
2014-01-03 00:14:35 +00:00
Alp Toker 95e7ff2ed1 Eliminate UnaryTypeTraitExpr
Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.

The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.

This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.

llvm-svn: 198271
2014-01-01 05:57:51 +00:00
DeLesley Hutchins c4a82438a7 Update RecursiveASTVisitor so that it visits attributes. This is currently
important for thread safety attributes, which contain expressions that were
not being visited, and were thus invisible to various tools.  There are now
Visit*Attr methods that can be overridden for every attribute.

llvm-svn: 198224
2013-12-30 17:24:36 +00:00
Alp Toker a724cff01b Rename isBuiltinCall() to getBuiltinCallee()
This better describes what the function does.

Cleanup only.

llvm-svn: 198127
2013-12-28 21:59:02 +00:00
Reid Kleckner 31a9f74c1d Reduce indentation of some VFTableBuilder code.
No functionality change.

llvm-svn: 198085
2013-12-27 20:29:16 +00:00
Reid Kleckner 558cab2f49 Fix incorrect copy-pasted method decl that MSVC allowed.
llvm-svn: 198081
2013-12-27 19:45:53 +00:00
Reid Kleckner 604c8b45e4 [ms-cxxabi] Emit fewer trivial return adjusting thunks
Most importantly, this makes our vtable layout match MSVC's.  Previously
we would emit a return adjusting thunk whenever the return types
differed, even if the adjustment would have been trivial.

MSVC does emit some trivial return adjusting thunks, but only if there
was already an overridden method that required a return adjustment.

llvm-svn: 198080
2013-12-27 19:43:59 +00:00
Warren Hunt 50de3522e6 [ms-abi] Fixes improperly sized vfptrs with pragma pack
With pragma pack, the layout engine would produce vfptrs that were 
packed width rather than pointer width.  This patch addresses the issue 
and adds a test case.

llvm-svn: 198059
2013-12-26 22:09:12 +00:00
Aaron Ballman 3e424b5070 Teach the diagnostics engine about the Attr type to make reporting on semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.
llvm-svn: 198055
2013-12-26 18:30:57 +00:00
Alp Toker a5d645976f Assert that tag decls are never marked (in)valid after definition is complete
Sema relies on this assumption.

Follow-up to r197848.

llvm-svn: 197850
2013-12-21 01:10:54 +00:00
Reid Kleckner b60a3d5bc1 Eliminate the ItaniumVTableContext object from CodeGenVTables
Now CodeGenVTables has only one VTableContext object, which is either
Itanium or Microsoft.

Fixes a FIXME with no functionality change intended.

Ideally we could avoid the downcasts by pushing the things that
reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're
not there yet.

llvm-svn: 197845
2013-12-20 23:58:52 +00:00
Reid Kleckner d2d1cc5156 Compare canonical return types when generating MS C++ ABI vtable thunks
This was part of the cause for PR17655.  We were generating thunks when
we shouldn't have.  I suspect that if we tweak the test case for PR17655
to actually require thunks, we can reproduce the same crash.

llvm-svn: 197836
2013-12-20 21:44:05 +00:00
Aaron Ballman 9ead1243a5 Replacing calls to getAttr with calls to hasAttr for clarity. No functional change intended -- this only replaces Boolean uses of getAttr.
llvm-svn: 197648
2013-12-19 02:39:40 +00:00
Warren Hunt f037bd1e7c [ms-abi] Update Alignment for VtorDisps
The alignment impact of the virtual bases apperas to be applied in 
order, rather than up front.  This patch adds the new behavior and 
provides a test case.

llvm-svn: 197639
2013-12-19 00:43:59 +00:00
Aaron Ballman 8edb5c2081 Refactor the Microsoft inheritance attribute handling so that it no longer has special treatment. Also fixes a minor bug where the attributes were being parsed as though they were GNU-style attributes when they were in fact keyword attributes.
llvm-svn: 197629
2013-12-18 23:44:18 +00:00
Reid Kleckner e7106c9e0b Use getAsCXXRecordDecl to shorten some gets and casts
llvm-svn: 197626
2013-12-18 23:17:05 +00:00
Dmitri Gribenko e8bc31f0ab Documentation comment parsing: when checking if we have typedef to something
that we consider a function for the purposes of checking \param and \returns,
look through reference types.

llvm-svn: 197530
2013-12-17 22:22:14 +00:00
Dmitri Gribenko fa68a57cf7 Documentation comment parsing: allow \param and \returns on std::function,
boost::function and similar function-like objects

llvm-svn: 197528
2013-12-17 22:06:11 +00:00
Dmitri Gribenko 110dfa81fd Fix strange indentation and remove trailing whitespace on empty lines
llvm-svn: 197513
2013-12-17 19:28:18 +00:00
Alp Toker b164a349f9 Fix indentation from r197490 plus some typos
llvm-svn: 197507
2013-12-17 17:25:19 +00:00
Alp Toker 2dea15b53c ASTContext: Refactor implicit record creation
Tidy up built-in record creation to reduce code duplication.

Continuation of r197336.

llvm-svn: 197452
2013-12-17 01:22:38 +00:00
Alp Toker 56b5cc91af ASTContext: Declare builtin types implicitly
__builtin_va_list and friends have been showing up where they shouldn't for way
to long, making unwanted appearences in -ast-print, tooling and source level
visitors and even the hello world tutorial on the clang website.

This commit factors down the implicit typedef and record creation facilities to
ensure they're marked implicit.

Also fixes a unit test that was testing incorrect behaviour, and removes old
hacks in the DeclPrinter that tried to skip implicit declarations manually.

llvm-svn: 197336
2013-12-15 10:36:26 +00:00
Richard Smith 8a0dde75f1 PR18232: implement instantiation for class-scope explicit specializations of
class templates (a Microsoft extension).

llvm-svn: 197298
2013-12-14 01:04:22 +00:00
Alp Toker 88f64e6aeb Remove an unused parameter and include after r197273
llvm-svn: 197274
2013-12-13 21:19:30 +00:00
Alp Toker cbb9034e2a Eliminate BinaryTypeTraitExpr
There's nothing special about type traits accepting two arguments.

This commit eliminates BinaryTypeTraitExpr and switches all related handling
over to TypeTraitExpr.

Also fixes a CodeGen failure with variadic type traits appearing in a
non-constant expression.

The BTT/TT prefix and evaluation code is retained as-is for now but will soon
be further cleaned up.

This is part of the ongoing work to unify type traits.

llvm-svn: 197273
2013-12-13 20:49:58 +00:00
David Majnemer b4119f7459 [-cxx-abi microsoft] Remove trailing spaces from the mangler
No functional change, just a tidying up.

llvm-svn: 197196
2013-12-13 01:06:04 +00:00
David Majnemer 9855994d81 AST: Update URL for Itanium ABI spec
The old URL hasn't worked for quite some time.  While we are here, also
change the link so that it will send us straight to the mangling portion
of the ABI doc.

llvm-svn: 197195
2013-12-13 00:54:42 +00:00
David Majnemer 25e1a5e7e3 [-cxx-abi microsoft] Add commentary for mangleStaticGuardVariable
We will need to do some work here if we want to play nice with MSVC2013.
Add a TODO indicating what changed and why this matters.

llvm-svn: 197193
2013-12-13 00:52:45 +00:00
David Majnemer 210e6bfa19 Revert "[-cxx-abi microsoft] Mangle reference temporaries"
This reverts commit r197184.

Richard Smith brings up some good points, a proper implementation will
require us to mangle unnameable entities compatibly with MSVC.

llvm-svn: 197192
2013-12-13 00:39:38 +00:00
David Majnemer 0834f13c95 [-cxx-abi microsoft] Mangle reference temporaries
They are mangled the same as normal references, nothing special is going
on here.

llvm-svn: 197184
2013-12-12 23:12:01 +00:00
Warren Hunt 4431fe6bec [ms-abi] Refactoring Non-virtual base layout in record layout
This refactor addresses bugzilla bug 18167 and simplifies the code at 
the same time.  Also I add a test case for the bug.  Also I make a 
non-functional change to the basic layout lit tests to make them more 
reliable (using CHECK-NEXT instead of CHECK).

llvm-svn: 197183
2013-12-12 22:33:37 +00:00
Alp Toker 40f9b1cd69 Unify type trait parsing
Type trait parsing is all over the place at the moment with unary, binary and
n-ary C++11 type traits that were developed independently at different points
in clang's history.

There's no good reason to handle them separately -- there are three parsers,
three AST nodes and lots of duplicated handling code with slightly different
implementations and diags for each kind.

This commit unifies parsing of type traits and sets the stage for further
consolidation.

No change in behaviour other than more consistent error recovery.

llvm-svn: 197179
2013-12-12 21:23:03 +00:00
Rafael Espindola 3497069784 Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.

llvm-svn: 197164
2013-12-12 16:07:11 +00:00
Richard Smith c934e4fd2c PR18217: Rewrite JumpDiagnostics' handling of temporaries, to correctly handle
declarations that might lifetime-extend multiple temporaries. In passing, fix a
crasher (PR18217) if an initializer was dependent and exactly the wrong shape,
and remove a bogus function (Expr::findMaterializedTemporary) now its last use
is gone.

llvm-svn: 197103
2013-12-12 01:27:02 +00:00