Commit Graph

5427 Commits

Author SHA1 Message Date
Aaron Ballman 15063e19c6 [C++11] Replacing ObjCInterfaceDecl iterators known_categories_begin() and known_categories_end() with iterator_range known_categories(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203854
2014-03-13 21:35:02 +00:00
Aaron Ballman 3fe486a332 [C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203851
2014-03-13 21:23:55 +00:00
Aaron Ballman 59abbd4d9b [C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203849
2014-03-13 21:09:43 +00:00
Aaron Ballman a9f49e394c [C++11] Replacing ObjCInterfaceDecl iterators all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203848
2014-03-13 20:55:22 +00:00
Aaron Ballman a49c5064a1 [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases.

llvm-svn: 203842
2014-03-13 20:29:09 +00:00
Aaron Ballman f26acce6f7 [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203839
2014-03-13 19:50:17 +00:00
Aaron Ballman d174edffa0 Renaming the recently-created (r203830) props() range API to properties() for clarity.
llvm-svn: 203835
2014-03-13 19:11:50 +00:00
Aaron Ballman dc4bea4676 [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() with iterator_range props(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203830
2014-03-13 18:47:37 +00:00
Aaron Ballman 0ad78303de [C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203819
2014-03-13 17:34:31 +00:00
Aaron Ballman 2b124d1a5d [C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203812
2014-03-13 16:36:16 +00:00
Aaron Ballman 445a939db8 [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203808
2014-03-13 16:15:17 +00:00
Aaron Ballman 574705ed7f [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with iterator_range bases(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203803
2014-03-13 15:41:46 +00:00
Fariborz Jahanian 0c325319cf Objective-C. Prevent an assertion crash due to buggy code
as it can commonly happen. // rdar://16261494

llvm-svn: 203598
2014-03-11 18:56:18 +00:00
Craig Topper cbce6e9e63 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203543
2014-03-11 06:22:39 +00:00
Richard Trieu 99e1c9515a Move the warning about unused relational comparison from -Wunused-value to
-Wunused-comparison.  Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.

llvm-svn: 203535
2014-03-11 03:11:08 +00:00
Aaron Ballman be22bcb180 [C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203474
2014-03-10 17:08:28 +00:00
Aaron Ballman 62e47c423d Reverting llvm::distance changes to use std::distance with iterators instead, per post-commit review feedback.
Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach.

llvm-svn: 203461
2014-03-10 13:43:55 +00:00
Nick Lewycky 206cc2d9c6 Tab to spaces. No functionality change.
llvm-svn: 203417
2014-03-09 17:09:28 +00:00
Aaron Ballman b97112e4bd [C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.

llvm-svn: 203362
2014-03-08 22:19:01 +00:00
Aaron Ballman e8a8baef44 [C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman 43027eb093 Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
llvm-svn: 203351
2014-03-08 18:30:40 +00:00
Aaron Ballman da634f1dee In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.
This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts).

llvm-svn: 203299
2014-03-07 22:17:20 +00:00
Benjamin Kramer 15ae783e14 [C++11] Convert sort predicates into lambdas.
No functionality change.

llvm-svn: 203289
2014-03-07 21:35:40 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Aaron Ballman 629afaefe0 [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203278
2014-03-07 19:56:05 +00:00
Aaron Ballman 29c9460d3e Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
llvm-svn: 203262
2014-03-07 18:36:15 +00:00
Aaron Ballman 1391608234 [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203261
2014-03-07 18:11:58 +00:00
Aaron Ballman 43b68bebe7 [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203255
2014-03-07 17:50:17 +00:00
Aaron Ballman b2b8b1dc66 [C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203250
2014-03-07 16:09:59 +00:00
Aaron Ballman f6bf62e2d0 [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203248
2014-03-07 15:12:56 +00:00
Benjamin Kramer ed2f476b20 [C++11] Replace LLVM-style type traits with C++11 standard ones.
No functionality change.

llvm-svn: 203241
2014-03-07 14:30:23 +00:00
Aaron Ballman 63ab760ebe [C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.
llvm-svn: 203239
2014-03-07 13:44:44 +00:00
Aaron Ballman 7dce1a840c Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
llvm-svn: 203237
2014-03-07 13:13:38 +00:00
Aaron Ballman 690829696c [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203236
2014-03-07 12:50:00 +00:00
Timur Iskhodzhanov a895758203 Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritance hierarchy
llvm-svn: 203222
2014-03-07 09:34:59 +00:00
Aaron Ballman 86c9390673 [C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely.
llvm-svn: 203179
2014-03-06 23:45:36 +00:00
Ismail Pazarbasi be19ae05e7 Exclude invalid old decl from mismatching linkage assertion
This patch fixes PR18964. In linkage computation, assertion fails when
an old invalid declaration's linkage mismatches with the current
decl's one.

llvm-svn: 203168
2014-03-06 21:48:45 +00:00
Richard Smith 2d70976fc0 Fix dead store and simplify. No functionality change (although the code is now
correct if MaxEditDistance were increased to something greater than 1).

llvm-svn: 203153
2014-03-06 20:00:05 +00:00
David Majnemer 34b4989658 MS ABI: Disambiguate the manglings for global guard variables
If a guard variable will be created for an entity at global scope,
then we cannot rely on the scope depth to disambiguate names for us.

Instead, mangle the entire variable into the guard to ensure it's uniqueness.

llvm-svn: 203151
2014-03-06 19:57:36 +00:00
David Majnemer f55feec559 MS ABI: Fix the initializer/finalizer mangling for static data members
Initializers and finalizers for static data members have the variable's
access-specifier, storage-class, type and CV-qualifiers mangled in.

llvm-svn: 203145
2014-03-06 19:10:27 +00:00
Argyrios Kyrtzidis 38765b9c17 [ASTPrinter] 'SEL' isn't a ObjCObjectPointer, so we don't need to handle it in TypePrinter::printObjCObjectPointerBefore.
Suggested by Jordan.

llvm-svn: 203124
2014-03-06 15:31:56 +00:00
Alexey Bataev 568a833f68 [OPENMP] Clause 'num_threads'
llvm-svn: 203087
2014-03-06 06:15:19 +00:00
Richard Trieu 532018f7a5 Change the color of comment nodes from bright yellow to blue. Bright yellow on
a white background is difficult to read.  Also include a chart showing which
colors are used by which elements in the AST dump.

llvm-svn: 203050
2014-03-06 01:09:03 +00:00
Richard Smith da3f4fd3fe PR19010: Make sure we initialize (empty) indirect base class subobjects when
evaluating trivial default initialization of a literal class type.

llvm-svn: 203025
2014-03-05 23:32:50 +00:00
David Majnemer f27217ffaf AST: Remove layering violation with Sema
Scope lives in Sema and cannot be used in AST. Shuffle things around.

llvm-svn: 202993
2014-03-05 18:55:38 +00:00
Timur Iskhodzhanov 77764b6d4c Style fix: replace "1 entries" with "1 entry" in the vftable layout dumping code
llvm-svn: 202978
2014-03-05 13:54:07 +00:00
David Majnemer f017ec360c MS ABI: Mangle lambdas
Use a scheme inspired by the Itanium ABI to properly implement the
mangling of lambdas.

N.B.  The incredibly astute observer will notice that we do not generate
external names that are identical, or even compatible with, MSVC.
This is fine because they don't generate names that they can use across
translation units.  Technically, we can generate any name we'd like so
long as that name wouldn't conflict with any other and would be stable
across translation units.

This fixes PR15512.

llvm-svn: 202962
2014-03-05 10:35:06 +00:00
David Majnemer 2206bf5d5b [-cxx-abi microsoft] Implement local manglings accurately
Summary:
The MSVC ABI appears to mangle the lexical scope into the names of
statics.  Specifically, a counter is incremented whenever a scope is
entered where things can be declared in such a way that an ambiguity can
arise.  For example, a class scope inside of a class scope doesn't do
anything interesting because the nested class cannot collide with
another nested class.

There are problems with this scheme:
- It is unreliable. The counter is only incremented when a previously
  never encountered scope is entered.  There are cases where this will
  cause ambiguity amongst declarations that have the same name where one
  was introduced in a deep scope while the other was introduced right
  after in the previous lexical scope.
- It is wasteful.  Statements like: {{{{{{{ static int foo = a; }}}}}}}
  will make the mangling of "foo" larger than it need be because the
  scope counter has been incremented many times.

Because of these problems, and practical implementation concerns.  We
choose not to implement this scheme if the local static or local type
isn't visible.  The mangling of these declarations will look very
similar but the numbering will make far more sense, this scheme is
lifted from the Itanium ABI implementation.

Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 202951
2014-03-05 08:57:59 +00:00
Argyrios Kyrtzidis 0692508670 [AST] A "Class<P>" type should not have '*' when printed out.
rdar://14309030

llvm-svn: 202941
2014-03-05 06:47:57 +00:00
Fariborz Jahanian 7a5830294f Objective-C. Return 0 as class of methods in protocols.
This simplifies my last patch a bit. No change in
functionality.

llvm-svn: 202906
2014-03-04 22:57:32 +00:00
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