]> granicus.if.org Git - clang/log
clang
10 years agoclang-format: [JS] Improve formatting of function literals in chains
Daniel Jasper [Mon, 29 Sep 2014 07:54:54 +0000 (07:54 +0000)]
clang-format: [JS] Improve formatting of function literals in chains

Before:
  getSomeLongPromise(.....)
      .then(
           function(value) {
             body();
             body();
           })
      .thenCatch(function(error) {
    body();
    body();
  });

After:
  getSomeLongPromise(.....)
      .then(function(value) {
        body();
        body();
      })
      .thenCatch(function(error) {
        body();
        body();
      });

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

10 years agoRemove dead code from DIBuilder
Jyoti Allur [Mon, 29 Sep 2014 06:32:54 +0000 (06:32 +0000)]
Remove dead code from DIBuilder

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

10 years agotesting commit access to clang repo
Jyoti Allur [Mon, 29 Sep 2014 06:23:54 +0000 (06:23 +0000)]
testing commit access to clang repo

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

10 years agoTests for DR600-640.
Richard Smith [Mon, 29 Sep 2014 06:03:56 +0000 (06:03 +0000)]
Tests for DR600-640.

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

10 years agoFix "unsupported friend" diagnostic to also appear for friend functions with dependen...
Richard Smith [Mon, 29 Sep 2014 05:57:29 +0000 (05:57 +0000)]
Fix "unsupported friend" diagnostic to also appear for friend functions with dependent scopes.

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

10 years agoAdd the tests for __super that I forgot to commit in as part of r218484.
Nikola Smiljanic [Mon, 29 Sep 2014 01:11:55 +0000 (01:11 +0000)]
Add the tests for __super that I forgot to commit in as part of r218484.

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

10 years agoRun DR tests in C++17 mode too.
Richard Smith [Sun, 28 Sep 2014 21:56:04 +0000 (21:56 +0000)]
Run DR tests in C++17 mode too.

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

10 years agoCodeGen: Don't crash when initializing pointer-to-member fields in bases
David Majnemer [Sun, 28 Sep 2014 06:39:30 +0000 (06:39 +0000)]
CodeGen: Don't crash when initializing pointer-to-member fields in bases

Clang uses two types to talk about a C++ class, the
NonVirtualBaseLLVMType and the LLVMType.  Previously, we would allow one
of these to be packed and the other not.

This is problematic.  If both don't agree on a common subset of fields,
then routines like getLLVMFieldNo will point to the wrong field.  Solve
this by copying the 'packed'-ness of the complete type to the
non-virtual subobject.  For this to work, we need to take into account
the non-virtual subobject's size and alignment when we are computing the
layout of the complete object.

This fixes PR21089.

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

10 years agoAdd back checking for condition of conditional operator for -Wuninitialized
Richard Trieu [Fri, 26 Sep 2014 23:48:30 +0000 (23:48 +0000)]
Add back checking for condition of conditional operator for -Wuninitialized

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

10 years agoEnsure that all module build failures get diagnosed
Ben Langmuir [Fri, 26 Sep 2014 22:42:23 +0000 (22:42 +0000)]
Ensure that all module build failures get diagnosed

Otherwise we can end up silently skipping an import.  If we happen to be
building another module at the time, we may build a mysteriously broken
module and not know why it seems to be missing symbols.

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

10 years agoDon't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
Alexey Samsonov [Fri, 26 Sep 2014 21:22:08 +0000 (21:22 +0000)]
Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.

It makes no sense to link in sanitizer runtimes in this case: the user
probably doesn't want to see any system/toolchain libs in his link if he
provides these flags, and the link will most likely fail anyway - as sanitizer
runtimes depend on libpthread, libdl, libc etc.

Also, see discussion in https://code.google.com/p/address-sanitizer/issues/detail?id=344

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

10 years agoFix an assertion failure trying to emit a trivial destructor in ObjC++
Ben Langmuir [Fri, 26 Sep 2014 15:27:29 +0000 (15:27 +0000)]
Fix an assertion failure trying to emit a trivial destructor in ObjC++

If a base class declares a destructor, we will add the implicit
destructor for the subclass in
ActOnFields -> AddImplicitlyDeclaredMembersToClass

But in Objective C++, we did not compute whether we have a trivial
destructor until after that in
CXXRecordDecl::completeDefinition()

This was leading to a mismatch between the class, which thought it had
no trivial destructor, and the CXXDestructorDecl, which considered
itself trivial. It turns out the reason we delayed setting this until
completeDefinition() was for a warning that has since been removed as
part of -Warc-abi, so we just do it eagerly now.

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

10 years agoclang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.
NAKAMURA Takumi [Fri, 26 Sep 2014 09:37:15 +0000 (09:37 +0000)]
clang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.

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

10 years agoMS ABI: Assert that vftables should have a non-RTTI entry
David Majnemer [Fri, 26 Sep 2014 08:07:55 +0000 (08:07 +0000)]
MS ABI: Assert that vftables should have a non-RTTI entry

No functional change intended.

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

10 years agoSmall fix for bug 18635.
Alexander Musman [Fri, 26 Sep 2014 06:28:25 +0000 (06:28 +0000)]
Small fix for bug 18635.
(clang crashed in CodeGen in llvm::Module::getNamedValue on
 thread_local std::unique_ptr<int>).
Differential Revision: http://reviews.llvm.org/D5353

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

10 years agoSupport the assume_aligned function attribute
Hal Finkel [Fri, 26 Sep 2014 05:04:30 +0000 (05:04 +0000)]
Support the assume_aligned function attribute

In addition to __builtin_assume_aligned, GCC also supports an assume_aligned
attribute which specifies the alignment (and optional offset) of a function's
return value. Here we implement support for the assume_aligned attribute by making
use of the @llvm.assume intrinsic.

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

10 years agoCGBuiltin: Use frem instruction rather than libcall to implement fmod
Jan Vesely [Fri, 26 Sep 2014 01:19:41 +0000 (01:19 +0000)]
CGBuiltin: Use frem instruction rather than libcall to implement fmod

AFAICT the semantics of frem match libm's fmod.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218488 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago-ms-extensions: Implement __super scope specifier (PR13236).
Nikola Smiljanic [Fri, 26 Sep 2014 00:28:20 +0000 (00:28 +0000)]
-ms-extensions: Implement __super scope specifier (PR13236).

We build a NestedNameSpecifier that records the CXXRecordDecl in which
__super appeared. Name lookup is performed in all base classes of the
recorded CXXRecordDecl. Use of __super is allowed only inside class and
member function scope.

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

10 years agoFix PR20886 - enforce CUDA target match in method calls
Eli Bendersky [Thu, 25 Sep 2014 23:59:08 +0000 (23:59 +0000)]
Fix PR20886 - enforce CUDA target match in method calls

http://reviews.llvm.org/D5298

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

10 years agoSuggest fix-it for missing '{' after base-clause
Ismail Pazarbasi [Thu, 25 Sep 2014 21:13:02 +0000 (21:13 +0000)]
Suggest fix-it for missing '{' after base-clause

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

10 years agoMove calls to ResolveExceptionSpec out of SetDeclDefaulted and into DefineImplicit*
Ben Langmuir [Thu, 25 Sep 2014 20:55:00 +0000 (20:55 +0000)]
Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into DefineImplicit*

This fixes an assertion failure in CodeGen where we were not resolving
an exception specification.

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

10 years agoMS ABI: Avoid hashing back reference keys in mangler
David Majnemer [Thu, 25 Sep 2014 19:43:56 +0000 (19:43 +0000)]
MS ABI: Avoid hashing back reference keys in mangler

This patch replaces the back reference StringMap from the MS mangler
with a SmallVector of strings. My previous patches reduced the number of
hashes involved in back reference lookups, this one removes them
completely. The back reference map contains at most 10 entries, which
are likely to be of varying sizes and different initial subsequences,
and which can easily became huge (due to templates and namespaces).

The solution presented is the simplest possible one. Nevertheless, it's
enough to reduce compilation times for a particular test case from 11.1s
to 9s, versus 8.58s for the Itanium ABI. Possible further improvements
include using a sorted vector (carefully to not introduce an extra
comparison), storing the string contents in a common arena, and/or keep
the string storage in the context for reuse.

Patch by Agustín Bergé.

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

10 years agoAdd increment/decrement operators and compound assignment operators to the
Richard Trieu [Thu, 25 Sep 2014 01:15:40 +0000 (01:15 +0000)]
Add increment/decrement operators and compound assignment operators to the
uninitialized checkers that did not have them before.

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

10 years agoFix handling of preincrement on bit-fields. This gives a bit-field in C++, but
Richard Smith [Wed, 24 Sep 2014 23:55:00 +0000 (23:55 +0000)]
Fix handling of preincrement on bit-fields. This gives a bit-field in C++, but
we were failing to find that bit-field when performing integer promotions. This
brings us closer to following the standard, and closer to GCC.

In C, this change is technically a regression: we get bit-field promotions
completely wrong in C, promoting cases that are categorically not bit-field
designators. This change makes us do so slightly more consistently, though.

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

10 years agoThread Safety Analysis: Update to documentation.
DeLesley Hutchins [Wed, 24 Sep 2014 22:13:34 +0000 (22:13 +0000)]
Thread Safety Analysis:  Update to documentation.

The attribute documentation now conforms to Aaron Ballman's renaming of the
thread safety attributes, as well as the new paper that is due to be published
in the conference on Source Code Analysis and Manipulation (SCAM 2014) later
this week.  In addition, recent changes to the analysis, such as checking
of references and negative capabilities, are now documented.

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

10 years agopass environment when invoking llvm-config and clang from lit.cfg
Scott Douglass [Wed, 24 Sep 2014 18:37:52 +0000 (18:37 +0000)]
pass environment when invoking llvm-config and clang from lit.cfg

Use the same environment when invoking llvm-config from lit.cfg as
will be used when running tests, so that ASAN_OPTIONS, INCLUDE, etc.
are present.

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

10 years agoSimplify tests.
Nico Weber [Wed, 24 Sep 2014 18:25:54 +0000 (18:25 +0000)]
Simplify tests.

This reverts bits of r218166 that are no longer necessary now that r218394 made
-Wmissing-prototype-for-cc a regular warning.

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

10 years agoDowngrade error about stdcall decls with no prototype to a warning
Reid Kleckner [Wed, 24 Sep 2014 17:49:24 +0000 (17:49 +0000)]
Downgrade error about stdcall decls with no prototype to a warning

Fixes PR21027.  The MIDL compiler produces code that does this.

If we wanted to improve the warning, I think we could do this:
  void __stdcall f(); // Don't warn without -Wstrict-prototypes.
  void g() {
    f(); // Might warn, the user probably meant for f to take no args.
    f(1, 2, 3); // Warn, we have no idea what args f takes.
    f(1); // Error, this is insane, one of these calls is broken.
  }

Reviewers: thakis

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

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

10 years agoclang-format: Don't let -style=Chromium imply c++03 template formatting.
Nico Weber [Wed, 24 Sep 2014 17:17:32 +0000 (17:17 +0000)]
clang-format: Don't let -style=Chromium imply c++03 template formatting.

Chromium's now using some c++11 language features, so it's now fine that
clang-format produces vector<vector<int>>.

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

10 years agoInclude debug info for types referenced only via explicit cast expressions.
David Blaikie [Wed, 24 Sep 2014 17:01:27 +0000 (17:01 +0000)]
Include debug info for types referenced only via explicit cast expressions.

Most of the debug info emission is powered essentially from function
definitions - if we emit the definition of a function, we emit the types
of its parameters, the members of those types, and so on and so forth.

For types that aren't referenced even indirectly due to this - because
they only appear in temporary expressions, not in any named variable, we
need to explicitly emit/add them as is done here. This is not the only
case of such code, and we might want to consider handling "void
func(void*); ... func(new T());" (currently debug info for T is not
emitted) at some point, though GCC doesn't. There's a much broader
solution to these issues, but it's a lot of work for possibly marginal
gain (but might help us improve the default -fno-standalone-debug
behavior to be even more aggressive in some places). See the original
review thread for more details.

Patch by jyoti allur (jyoti.yalamanchili@gmail.com)!

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

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

10 years agoConstify a functor's function call operator because it can/should be.
David Blaikie [Wed, 24 Sep 2014 16:35:29 +0000 (16:35 +0000)]
Constify a functor's function call operator because it can/should be.

Patch by Graham Lee (graham@iamleeg.com)!

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

10 years agoPatch to allow mangling of microsoft’s __uuidof expression for the Itanium ABI
Fariborz Jahanian [Wed, 24 Sep 2014 16:28:40 +0000 (16:28 +0000)]
Patch to allow mangling of microsoft’s __uuidof expression for the Itanium ABI
when under -fms-extensions. Reviewed by John McCall.
//rdar://17784718

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

10 years agoClean up ClangTool's argument adjuster handling a bit with unique_ptr.
Benjamin Kramer [Wed, 24 Sep 2014 11:47:42 +0000 (11:47 +0000)]
Clean up ClangTool's argument adjuster handling a bit with unique_ptr.

Make the dtor non-virtual while there. No functionality change.

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

10 years agoSema: Inherit the flexible array property from struct fields
David Majnemer [Wed, 24 Sep 2014 11:04:09 +0000 (11:04 +0000)]
Sema: Inherit the flexible array property from struct fields

A record which contains a flexible array member is itself a flexible
array member.  A struct which contains such a record should also
consider itself to be a flexible array member.

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

10 years ago[x86] Fixed argument types in intrinsics:
Robert Khasanov [Wed, 24 Sep 2014 06:45:23 +0000 (06:45 +0000)]
[x86] Fixed argument types in intrinsics:
_addcarryx_u64
_addcarry_u64
_subborrow_u64

Thanks Pasi Parviainen for notice.

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

10 years agoFix the argument index error of __builtin___memccpy_chk
Steven Wu [Wed, 24 Sep 2014 04:37:33 +0000 (04:37 +0000)]
Fix the argument index error of __builtin___memccpy_chk

memccpy_check should have source and dest size at arg 3 and 4
rdar://18431336

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

10 years agoFix an edge case with BinaryOperator's in -Wuninitialized. Add testcases for
Richard Trieu [Wed, 24 Sep 2014 03:53:56 +0000 (03:53 +0000)]
Fix an edge case with BinaryOperator's in -Wuninitialized.  Add testcases for
the other visitors as well.

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

10 years agoFollow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.
Nico Weber [Wed, 24 Sep 2014 03:28:54 +0000 (03:28 +0000)]
Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.

r218292 reverted r197496 because it broke things. In addition to breaking
things, r197496 also made all traits starting with __is_ revertible.
Reinstantiate that part of r197496 because code out there (e.g. libc++) depends
on this behavior. Fixes PR21045.

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

10 years agoMS ABI: Pure virtual functions don't contribute to vtordisps
David Majnemer [Tue, 23 Sep 2014 22:58:15 +0000 (22:58 +0000)]
MS ABI: Pure virtual functions don't contribute to vtordisps

Usually, overriding a virtual function defined in a virtual base
required emission of a vtordisp slot in the record.  However no vtordisp
is needed if the overriding function is pure; it should be impossible to
observe the pure virtual method.

This fixes PR21046.

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

10 years agoImprove -Wuninitialized to take into account field ordering with initializer
Richard Trieu [Tue, 23 Sep 2014 22:52:42 +0000 (22:52 +0000)]
Improve -Wuninitialized to take into account field ordering with initializer
lists.  Since the fields are inititalized one at a time, using a field with
lower index to initialize a higher indexed field should not be warned on.

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

10 years agoPR18793: If we try to EnterTokenStream when our current lexer is a caching
Richard Smith [Tue, 23 Sep 2014 21:05:52 +0000 (21:05 +0000)]
PR18793: If we try to EnterTokenStream when our current lexer is a caching
lexer, add the token buffer underneath the caching lexer where possible and
push the tokens directly into the caching lexer otherwise. We previously
put the lexer into a corrupted state where we could not guarantee to provide
the tokens in the right order and would sometimes assert.

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

10 years agoDon't perform ADL when looking up operator=; there is no non-member form of
Richard Smith [Tue, 23 Sep 2014 20:31:39 +0000 (20:31 +0000)]
Don't perform ADL when looking up operator=; there is no non-member form of
that function, and apart from being slow, this is unnecessary: ADL can trigger
instantiations that are not permitted here. The standard isn't *completely*
clear here, but this seems like the intent, and in any case this approach is
permitted by [temp.inst]p7.

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

10 years agoRevert "Don't use comdats for initializers on platforms that don't support it"
Reid Kleckner [Tue, 23 Sep 2014 16:20:01 +0000 (16:20 +0000)]
Revert "Don't use comdats for initializers on platforms that don't support it"

On further investigation, COMDATs should work with .ctors, and the issue
I was hitting probably reproduces with .init_array.

This reverts commit r218287.

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

10 years ago[OPENMP] Parsing/Sema of directive omp parallel for simd
Alexander Musman [Tue, 23 Sep 2014 09:33:00 +0000 (09:33 +0000)]
[OPENMP] Parsing/Sema of directive omp parallel for simd

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

10 years ago[mips] Fix r218248's testcase to use -O1 instead of -O3.
Daniel Sanders [Tue, 23 Sep 2014 08:58:04 +0000 (08:58 +0000)]
[mips] Fix r218248's testcase to use -O1 instead of -O3.

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

10 years agoReverting r214064 and r215650 while investigating a pesky performance regression
Artyom Skrobov [Tue, 23 Sep 2014 08:34:41 +0000 (08:34 +0000)]
Reverting r214064 and r215650 while investigating a pesky performance regression

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

10 years agoFix a typo in comment in ASTBitCodes.h
Alexander Musman [Tue, 23 Sep 2014 05:23:29 +0000 (05:23 +0000)]
Fix a typo in comment in ASTBitCodes.h

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

10 years agoAST: Mangle cast expression encoding more accurately
David Majnemer [Tue, 23 Sep 2014 04:27:55 +0000 (04:27 +0000)]
AST: Mangle cast expression encoding more accurately

Don't mangle all casts in expressions as "cv", use the appropriate
encoding which corresponds to a specific cast.

This fixes PR21034.

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

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

10 years agoRevert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.
Nico Weber [Tue, 23 Sep 2014 04:09:56 +0000 (04:09 +0000)]
Revert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.

Also add a test to make sure that this doesn't break again. Fixes PR21036.

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

10 years agoAttempt to fix Sema/builtin-object-size.c after r218258
Hans Wennborg [Tue, 23 Sep 2014 00:02:36 +0000 (00:02 +0000)]
Attempt to fix Sema/builtin-object-size.c after r218258

The type of size_t varies between targets.

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

10 years agoDon't use comdats for initializers on platforms that don't support it
Reid Kleckner [Tue, 23 Sep 2014 00:00:14 +0000 (00:00 +0000)]
Don't use comdats for initializers on platforms that don't support it

In particular, pre-.init_array ELF uses the .ctors section mechanism.
MinGW COFF also uses .ctors, now that I think about it. Therefore,
restrict this optimization to the two platforms that are currently known
to work: ELF with .init_array and COFF with .CRT$XCU.

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

10 years agoFix a vftable mangling bug
Reid Kleckner [Mon, 22 Sep 2014 23:14:46 +0000 (23:14 +0000)]
Fix a vftable mangling bug

We need to walk the class hierarchy twice: once in depth-first base
specifier order for mangling and again in depth-first layout order for
vftable layout.

Vftable layout seems to depend on the full path from the most derived
class to the base containing the vfptr.

Fixes PR21031.

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

10 years agoms-inline-asm: Add a test case for the usage of labels in bracket expressions
Ehsan Akhgari [Mon, 22 Sep 2014 20:41:39 +0000 (20:41 +0000)]
ms-inline-asm: Add a test case for the usage of labels in bracket expressions

Summary: This is a test for this patch: http://reviews.llvm.org/D5445.

Reviewers: rnk

Subscribers: cfe-commits

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

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

10 years agoMS ABI: Remove a FIXME that has been fixed
David Majnemer [Mon, 22 Sep 2014 20:39:37 +0000 (20:39 +0000)]
MS ABI: Remove a FIXME that has been fixed

We've implemented MSVC-style RTTI for quite some time.

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

10 years agoReturn true from UnifySection when emitting a diagnostic
Ehsan Akhgari [Mon, 22 Sep 2014 19:46:39 +0000 (19:46 +0000)]
Return true from UnifySection when emitting a diagnostic

Test Plan: I noticed this through code inspection.  The callers use the return value to remove the SectionAttr if a diagnostic is emitted, but I don't think the failure to do so is observable right now.

Reviewers: rnk

Subscribers: cfe-commits

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

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

10 years agoFix test/CodeGen/mips-varargs.c to use %clang_cc1
Kaelyn Takata [Mon, 22 Sep 2014 18:06:01 +0000 (18:06 +0000)]
Fix test/CodeGen/mips-varargs.c to use %clang_cc1

Only tests under test/Driver should use %clang, and test/CodeGen in
particular must always use %clang_cc1.

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

10 years agoFix evatuated value of __builtin_object_size according to its
Fariborz Jahanian [Mon, 22 Sep 2014 17:11:59 +0000 (17:11 +0000)]
Fix evatuated value of __builtin_object_size according to its
'type'  argument when it cannot be determined which objects ptr
points to at compile time. rdar://18334276

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

10 years agoclang/test/CodeGen/mips-varargs.c: Fixup for -Asserts.
NAKAMURA Takumi [Mon, 22 Sep 2014 16:40:05 +0000 (16:40 +0000)]
clang/test/CodeGen/mips-varargs.c: Fixup for -Asserts.

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

10 years ago[mips] Correct alignment of vectors passed in varargs for the O32 ABI.
Daniel Sanders [Mon, 22 Sep 2014 13:27:06 +0000 (13:27 +0000)]
[mips] Correct alignment of vectors passed in varargs for the O32 ABI.

Summary:
Vectors are normally 16-byte aligned, however the O32 ABI enforces a
maximum alignment of 8-bytes since the base of the stack is 8-byte aligned.
Previously, this was enforced on the caller side, but not on the callee side.

This fixes the output of OpenCL's printf when given vectors.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits, pekka.jaaskelainen

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

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

10 years agoremoved unicode symbols from comments.
Alexey Bataev [Mon, 22 Sep 2014 12:32:31 +0000 (12:32 +0000)]
removed unicode symbols from comments.

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

10 years ago[OPENMP] Codegen for 'omp critical' directive.
Alexey Bataev [Mon, 22 Sep 2014 10:01:53 +0000 (10:01 +0000)]
[OPENMP] Codegen for 'omp critical' directive.
This patch adds codegen for constructs:
#pragma omp critical [name]
<body>

It generates global variable ".gomp_critical_user_[name].var" of type int32[8]. Then it generates library call "kmpc_critical(loc, gtid, .gomp_critical_user_[name].var)", code for <body> statement and final call "kmpc_end_critical(loc, gtid, .gomp_critical_user_[name].var)".
Differential Revision: http://reviews.llvm.org/D5202

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

10 years agoAdd some documentation stating that the memory allocated by the ASTContext.h placemen...
Ehsan Akhgari [Mon, 22 Sep 2014 02:26:17 +0000 (02:26 +0000)]
Add some documentation stating that the memory allocated by the ASTContext.h placement new does not need to be explicitly freed

Reviewers: rnk

Subscribers: cfe-commits

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

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

10 years agoms-inline-asm: Scope inline asm labels to functions
Ehsan Akhgari [Mon, 22 Sep 2014 02:21:54 +0000 (02:21 +0000)]
ms-inline-asm: Scope inline asm labels to functions

Summary:
This fixes PR20023.  In order to implement this scoping rule, we piggy
back on the existing LabelDecl machinery, by creating LabelDecl's that
will carry the "internal" name of the inline assembly label, which we
will rewrite the asm label to.

Reviewers: rnk

Subscribers: cfe-commits

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

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

10 years agoFix bugs in cpuid.h.
Akira Hatanaka [Sat, 20 Sep 2014 01:31:09 +0000 (01:31 +0000)]
Fix bugs in cpuid.h.

This commit makes two changes:

- Remove the push and pop instructions that were saving and restoring %ebx
  before and after cpuid in 32-bit pic mode. We were doing this to ensure we
  don't lose the GOT address in pic register %ebx, but this isn't necessary
  because the GOT address is kept in a virtual register.

- In 64-bit mode, preserve base register %rbx around cpuid.

This fixes PR20311 and rdar://problem/17686779.

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

10 years agoFollow-up to r214408: Warn on other callee-cleanup functions without prototype too.
Nico Weber [Fri, 19 Sep 2014 23:07:12 +0000 (23:07 +0000)]
Follow-up to r214408: Warn on other callee-cleanup functions without prototype too.

According to lore, we used to verifier-fail on:

  void __thiscall f();
  int main() { f(1); }

So that's fixed now. System headers use prototype-less __stdcall functions,
so make that a warning that's DefaultError -- then it fires on regular code
but is suppressed in system headers.

Since it's used in system headers, we have codegen tests for this; massage
them slightly so that they still compile.

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

10 years agoFix ctor/dtor aliases losing 'dllexport' (for Itanium ABI)
Dario Domizioli [Fri, 19 Sep 2014 22:06:24 +0000 (22:06 +0000)]
Fix ctor/dtor aliases losing 'dllexport' (for Itanium ABI)

This patch makes sure that the dllexport attribute is transferred to the alias when such alias is created. It only affects the Itanium ABI because for the MSVC ABI a workaround is in place to not generate aliases of dllexport ctors/dtors.
A new CodeGenModule function is provided, CodeGenModule::setAliasAttributes, to factor the code for transferring attributes to aliases.

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

10 years agoIn the Itanium ABI, move stuff to the comdat of variables with static init.
Rafael Espindola [Fri, 19 Sep 2014 19:43:18 +0000 (19:43 +0000)]
In the Itanium ABI, move stuff to the comdat of variables with static init.

Clang can already handle

-------------------------------------------
struct S {
  static const int x;
};
template<typename T> struct U {
  static const int k;
};
template<typename T> const int U<T>::k = T::x;

const int S::x = 42;
extern const int *f();
const int *g() { return &U<S>::k; }
int main() {
  return *f() + U<S>::k;
}

const int *f() { return &U<S>::k; }
-------------------------------------------

since r217264 which puts the .inint_array section in the same COMDAT
as the variable.

This patch allows the linker to more easily delete some dead code and data by
putting the guard variable and init function in the same COMDAT.

This is a fixed version of r218089.

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

10 years agoSilence MSVC warnings from r218127 about not returning a value
Reid Kleckner [Fri, 19 Sep 2014 16:20:24 +0000 (16:20 +0000)]
Silence MSVC warnings from r218127 about not returning a value

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

10 years agoMake DynTypedNode have the dynamic type of the object, instead of its static type.
Samuel Benzaquen [Fri, 19 Sep 2014 16:10:03 +0000 (16:10 +0000)]
Make DynTypedNode have the dynamic type of the object, instead of its static type.

Summary:
Make DynTypedNode have the dynamic type of the object, instead of its static type.
Some optimizations that are in the works require that the nodes have the right type.

Reviewers: klimek

Subscribers: cfe-commits

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

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

10 years agoSilence a signed/unsigned mismatch warning from MSVC; NFC.
Aaron Ballman [Fri, 19 Sep 2014 12:21:56 +0000 (12:21 +0000)]
Silence a signed/unsigned mismatch warning from MSVC; NFC.

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

10 years agoclang-format: [JS] add space before operator 'in'.
Daniel Jasper [Fri, 19 Sep 2014 10:48:15 +0000 (10:48 +0000)]
clang-format: [JS] add space before operator 'in'.

Before:
  return ('aaa')in bbbb;

After:
  return ('aaa') in bbbb;

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

10 years ago[x86] Add _addcarry_u{32|64} and _subborrow_u{32|64}.
Robert Khasanov [Fri, 19 Sep 2014 10:29:22 +0000 (10:29 +0000)]
[x86] Add _addcarry_u{32|64} and _subborrow_u{32|64}.
They are added to adxintrin.h but outside __ADX__ block.
These intrinics generates adc and sbb correspondingly that were available before ADX

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

10 years ago[x86] Added _addcarryx_u32, _addcarryx_u64 intrinsics
Robert Khasanov [Fri, 19 Sep 2014 10:17:06 +0000 (10:17 +0000)]
[x86] Added _addcarryx_u32, _addcarryx_u64 intrinsics

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

10 years ago[x86] Enable broadwell target in clang.
Robert Khasanov [Fri, 19 Sep 2014 09:53:48 +0000 (09:53 +0000)]
[x86] Enable broadwell target in clang.
Added -madx option

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

10 years agoclang-format: Prevent column layout if elements aren't uniform enough.
Daniel Jasper [Fri, 19 Sep 2014 08:28:43 +0000 (08:28 +0000)]
clang-format: Prevent column layout if elements aren't uniform enough.

This patch only considers the difference between the length of the
shortest and longest element, but we might want to look at other
features (token count, etc.) in future.

Before:
  std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{
      aaaaaaa,      aaaaaaaaaa,
      aaaaa,        aaaaaaaaaaaaaaa,
      aaa,          aaaaaaaaaa,
      a,            aaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa,
      aaaaaaa,      a};

After:
  std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{
      aaaaaaaaaaaaaaaaa, aaaaa, aaaaaaaaaaaaaaa, aaa, aaaaaaaaaa, a,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaa, a};

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

10 years ago[OPENMP] Initial parsing/sema analysis of 'target' directive.
Alexey Bataev [Fri, 19 Sep 2014 08:19:49 +0000 (08:19 +0000)]
[OPENMP] Initial parsing/sema analysis of 'target' directive.

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

10 years agoclang-format: Undo r216377.
Daniel Jasper [Fri, 19 Sep 2014 08:01:25 +0000 (08:01 +0000)]
clang-format: Undo r216377.

It has proven to not be a food idea in many case.

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

10 years agoDon't use the third field of llvm.global_ctors for MachO.
Rafael Espindola [Fri, 19 Sep 2014 01:54:22 +0000 (01:54 +0000)]
Don't use the third field of llvm.global_ctors for MachO.

The field is defined as:

If the third field is present, non-null, and points to a global variable or function, the initializer function will only run if the associated data from the current module is not discarded.

And without COMDATs we can't implement that.

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

10 years agoRevert "Put more stuff in the comdat used for variables with static init."
Rafael Espindola [Fri, 19 Sep 2014 01:28:16 +0000 (01:28 +0000)]
Revert "Put more stuff in the comdat used for variables with static init."

This reverts commit r218089.
It looks like it was causing issues on COFF.

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

10 years agoPut more stuff in the comdat used for variables with static init.
Rafael Espindola [Thu, 18 Sep 2014 23:41:44 +0000 (23:41 +0000)]
Put more stuff in the comdat used for variables with static init.

Clang can already handle

-------------------------------------------
struct S {
  static const int x;
};
template<typename T> struct U {
  static const int k;
};
template<typename T> const int U<T>::k = T::x;

const int S::x = 42;
extern const int *f();
const int *g() { return &U<S>::k; }
int main() {
  return *f() + U<S>::k;
}

const int *f() { return &U<S>::k; }
-------------------------------------------

since r217264 which puts the .inint_array section in the same COMDAT
as the variable.

This patch allows the linker to more easily delete some dead code and data by
putting the guard variable and init function in the same COMDAT.

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

10 years agoThread Safety Analysis: add new warning flag, -Wthread-safety-reference, which
DeLesley Hutchins [Thu, 18 Sep 2014 23:02:26 +0000 (23:02 +0000)]
Thread Safety Analysis: add new warning flag, -Wthread-safety-reference, which
warns when a guarded variable is passed by reference as a function argument.
This is released as a separate warning flag, because it could potentially
break existing code that uses thread safety analysis.

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

10 years agoMS ABI: Don't ICE for pointers to pointers to members of incomplete classes
David Majnemer [Thu, 18 Sep 2014 22:05:54 +0000 (22:05 +0000)]
MS ABI: Don't ICE for pointers to pointers to members of incomplete classes

CodeGen would try to come up with an LLVM IR type for a pointer to
member type on the way to forming an LLVM IR type for a pointer to
pointer to member type.

However, if the pointer to member representation has not been locked in yet,
we would not be able to come up with a pointer to member IR type.

In these cases, make the pointer to member type an incomplete type.
This will make the pointer to pointer to member type a pointer to an
incomplete type.  If the class eventually obtains an inheritance model,
we will make the pointer to member type represent the actual inheritance
model.

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

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

10 years ago[X86, inlineasm] Do not allow using constraint 'x' for a variable larger than
Akira Hatanaka [Thu, 18 Sep 2014 21:58:54 +0000 (21:58 +0000)]
[X86, inlineasm] Do not allow using constraint 'x' for a variable larger than
128-bit unless the target CPU supports AVX.

rdar://problem/11846140

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

10 years ago[X86, inline-asm] Allow 256-bit wide operands for the 'x' constraints
Hans Wennborg [Thu, 18 Sep 2014 20:24:04 +0000 (20:24 +0000)]
[X86, inline-asm] Allow 256-bit wide operands for the 'x' constraints

The 'x' constraint is for "any SSE register", and GCC seems to include the
256-bit ymm registers in that concept.

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

10 years ago[X86, inlineasm] Check that the output size is correct for the given constraint.
Akira Hatanaka [Thu, 18 Sep 2014 18:17:18 +0000 (18:17 +0000)]
[X86, inlineasm] Check that the output size is correct for the given constraint.

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

10 years agoPatch to check at compile time for overflow when
Fariborz Jahanian [Thu, 18 Sep 2014 17:58:27 +0000 (17:58 +0000)]
Patch to check at compile time for overflow when
__builtin___memcpy_chk and similar builtins are
being used. Patch by Jacques Fortier (with added
clang tests).  rdar://11076881

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

10 years agoRevert r217995 and follow-ups:
Hans Wennborg [Thu, 18 Sep 2014 16:01:32 +0000 (16:01 +0000)]
Revert r217995 and follow-ups:

r218053: Use exceptions() instead of getNumExceptions()/getExceptionType() to avoid
r218011: Work around MSVC parser bug by putting redundant braces around the body of
r217997: Skip parens when detecting whether we're instantiating a function declaration.
r217995: Instantiate exception specifications when instantiating function types (other

The Windows build was broken for 16 hours and no one had any good ideas of how to
fix it. Reverting for now to make the builders green. See the cfe-commits thread [1] for
more info.

This was the build error (from [2]):

C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1590) : error C2668: '`anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType' : ambiguous call to overloaded function
        C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1313): could be 'clang::QualType `anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)'
        with
        [
            Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>
        ]
        c:\bb-win7\ninja-clang-i686-msc17-r\llvm-project\clang\lib\sema\TreeTransform.h(4532): or       'clang::QualType clang::TreeTransform<Derived>::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)'
        with
        [
            Derived=`anonymous-namespace'::TemplateInstantiator,
            Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>
        ]
        while trying to match the argument list '(clang::TypeLocBuilder, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl *, unsigned int, clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>)'

 1. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140915/115011.html
 2. http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/10515/steps/build_clang_tools_1/logs/stdio

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

10 years agoUse exceptions() instead of getNumExceptions()/getExceptionType() to avoid
Alexander Kornienko [Thu, 18 Sep 2014 15:19:53 +0000 (15:19 +0000)]
Use exceptions() instead of getNumExceptions()/getExceptionType() to avoid
accesses to incorrect exception types when getExceptionSpecType() != EST_Dynamic

This fixes a crash in test/CXX/except/except.spec/template.cpp that happens in
certain build configurations.

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

10 years agoParsing/Sema of directive omp for simd
Alexander Musman [Thu, 18 Sep 2014 05:12:34 +0000 (05:12 +0000)]
Parsing/Sema of directive omp for simd

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

10 years agoWork around MSVC parser bug by putting redundant braces around the body of
Richard Smith [Thu, 18 Sep 2014 03:49:06 +0000 (03:49 +0000)]
Work around MSVC parser bug by putting redundant braces around the body of
this range-based for loop.

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

10 years agoBasic: use hex string for __ARM_FP macro
Saleem Abdulrasool [Thu, 18 Sep 2014 02:13:33 +0000 (02:13 +0000)]
Basic: use hex string for __ARM_FP macro

The ARM ACLE describes the values as hex constants rather than numeric
constants; follow suit.  Address post-commit review comments from Jon Roelofs.

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

10 years agoChange -Wbind-to-temporary-copy from an ExtWarn to an Extension.
Nico Weber [Thu, 18 Sep 2014 02:09:53 +0000 (02:09 +0000)]
Change -Wbind-to-temporary-copy from an ExtWarn to an Extension.

The reasoning is that this construct is accepted by all compilers and valid in
C++11, so it doesn't seem like a useful warning to have enabled by default.
Building with -pedantic, -Wbind-to-temporary-copy, or -Wc++98-compat still
shows the warning.

The motivation is that I built re2, and this was the only warning that was
emitted during the build. Both changing re2 to fix the warning and detecting
clang and suppressing the warning in re2's build seem inferior than just giving
the compiler a good default for this warning.

Also move the cxx98compat version of this warning to CXX98CompatPedantic, and
update tests accordingly.

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

10 years agoSema: Diagnose undefined structs used as Microsoft anonymous structs
David Majnemer [Thu, 18 Sep 2014 00:42:05 +0000 (00:42 +0000)]
Sema: Diagnose undefined structs used as Microsoft anonymous structs

Previously, we would not mark structs containing anonymous structs as
invalid.  Later, horrific things would occur when trying to determine
the size of the parent record.

Instead, require the struct to be a complete type when used as an
anonymous struct.  Mark both the anonymous field for the struct and the
parent context as invalid (this is similar to what we do when a struct
contains a field with an incomplete type.)

This fixes PR11847.

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

10 years agoFix test case.
Akira Hatanaka [Thu, 18 Sep 2014 00:29:04 +0000 (00:29 +0000)]
Fix test case.

This is another follow-up patch to r217996.

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

10 years agoSkip parens when detecting whether we're instantiating a function declaration.
Richard Smith [Thu, 18 Sep 2014 00:12:09 +0000 (00:12 +0000)]
Skip parens when detecting whether we're instantiating a function declaration.

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

10 years agoFix test case.
Akira Hatanaka [Thu, 18 Sep 2014 00:04:10 +0000 (00:04 +0000)]
Fix test case.

This is a follow-up to r217994.

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

10 years agoInstantiate exception specifications when instantiating function types (other
Richard Smith [Wed, 17 Sep 2014 23:57:05 +0000 (23:57 +0000)]
Instantiate exception specifications when instantiating function types (other
than the type of a function declaration). We previously didn't instantiate
these at all! This also covers the pathological case where the only mention of
a parameter pack is within the exception specification; this gives us a second
way (other than alias templates) to reach the horrible state where a type
contains an unexpanded pack, but its canonical type does not.

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

10 years ago[X86, inline-asm] Check that the input size is correct for constraints R, q, Q,
Akira Hatanaka [Wed, 17 Sep 2014 23:35:14 +0000 (23:35 +0000)]
[X86, inline-asm] Check that the input size is correct for constraints R, q, Q,
S, D, A, y, x, f, t, and u.

This is a follow-up patch for r167717.

rdar://problem/11846140
rdar://problem/17476970

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

10 years agoBasic: add support for ARM ACLE 6.5.1
Saleem Abdulrasool [Wed, 17 Sep 2014 14:50:27 +0000 (14:50 +0000)]
Basic: add support for ARM ACLE 6.5.1

Extend ARM ACLE support (Section 6.5.1) for AArch32.  Define __ARM_FP if
hardware floating point support is available as per the value defined by the
ACLE.

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

10 years agoBasic: use range-based for loops for ARM target
Saleem Abdulrasool [Wed, 17 Sep 2014 14:50:23 +0000 (14:50 +0000)]
Basic: use range-based for loops for ARM target

Tweak handleTargetFeature for the ARM(32) target to use range based for loops.
NFC.

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