]> granicus.if.org Git - clang/log
clang
9 years agoMove test/CodeGen/sections.c to CodeGenCXX/sections.cpp
Hans Wennborg [Fri, 17 Oct 2014 18:13:21 +0000 (18:13 +0000)]
Move test/CodeGen/sections.c to CodeGenCXX/sections.cpp

The test was running with -xc++. Seems it wants to be a C++ file.

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

9 years agoRename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarity
David Blaikie [Fri, 17 Oct 2014 18:00:12 +0000 (18:00 +0000)]
Rename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarity

Code review feedback from Richard Smith on r219900.

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

9 years agoSema: address post-commit review comment
Saleem Abdulrasool [Fri, 17 Oct 2014 17:20:33 +0000 (17:20 +0000)]
Sema: address post-commit review comment

Hoist the IgnoreParens so that we ignore it around attributes as well in order
to future-proof the code.  Addresses Richard's comments for SVN r219974.

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

9 years agoDriver: support detecting driver mode when clang has a version suffix without dash...
Hans Wennborg [Fri, 17 Oct 2014 17:07:59 +0000 (17:07 +0000)]
Driver: support detecting driver mode when clang has a version suffix without dash (PR21094)

Clang would previously not get into C++ mode when invoked as 'clang++3.6'
(though clang++-3.6 would work).

I found the previous loop logic in this function confusing; hopefully this
makes it a little clearer.

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

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

9 years agoclang-format: Prefer breaking before trailing return arrows.
Daniel Jasper [Fri, 17 Oct 2014 14:37:40 +0000 (14:37 +0000)]
clang-format: Prefer breaking before trailing return arrows.

Before:
  auto SomeFunction(
      A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}

After:
  auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const
      -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}

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

9 years agoclang-format: [Java] Don't break immediately after "throws".
Daniel Jasper [Fri, 17 Oct 2014 13:36:14 +0000 (13:36 +0000)]
clang-format: [Java] Don't break immediately after "throws".

Before:
  public void doSooooooooooooooooooooooooooomething() throws
      LooooooooooooooooooooooooooooongException {}

After:
  public void doSooooooooooooooooooooooooooomething()
      throws LooooooooooooooooooooooooooooongException {}

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

9 years agoRevert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, r218053...
NAKAMURA Takumi [Fri, 17 Oct 2014 12:48:37 +0000 (12:48 +0000)]
Revert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, r218053). These were"

It broke some builders. I guess it'd be reproducible with --vg.

  Failing Tests (3):
      Clang :: CXX/except/except.spec/p1.cpp
      Clang :: SemaTemplate/instantiate-exception-spec-cxx11.cpp
      Clang :: SemaTemplate/instantiate-exception-spec.cpp

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

9 years agoAdd explicit triple to clang/test/CodeGen/sanitize-address-field-padding.cpp, for...
NAKAMURA Takumi [Fri, 17 Oct 2014 12:48:01 +0000 (12:48 +0000)]
Add explicit triple to clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling.

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

9 years agocomplex long double support for PowerPC
Joerg Sonnenberger [Fri, 17 Oct 2014 11:51:19 +0000 (11:51 +0000)]
complex long double support for PowerPC

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

9 years agoOptimize Type::isStructureOrClassType() by reusing RT->getDecl().
Yaron Keren [Fri, 17 Oct 2014 11:44:44 +0000 (11:44 +0000)]
Optimize Type::isStructureOrClassType() by reusing RT->getDecl().

RecordType->getDecl() which maps to TagType::getDecl() is not a simple
accessor but a loop on redecls in getInterestingTagDecl.

isStructureOrClassType() was calling getDecl() three times performing
three times the work actually required. It is optimized by calling
RT->getDecl() once and reusing the result three times.

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

9 years agoD5775: The new test case was missing from the preceding commit.
Artyom Skrobov [Fri, 17 Oct 2014 10:25:09 +0000 (10:25 +0000)]
D5775: The new test case was missing from the preceding commit.

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

9 years agoD5775: Fix of assertion failure in case of non-POD unions with bitfields. Patch by...
Artyom Skrobov [Fri, 17 Oct 2014 10:22:03 +0000 (10:22 +0000)]
D5775: Fix of assertion failure in case of non-POD unions with bitfields. Patch by Evgeny Astigeevich!

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

9 years agoUser c-tor name to fix the sanitizer test
Renato Golin [Fri, 17 Oct 2014 10:09:25 +0000 (10:09 +0000)]
User c-tor name to fix the sanitizer test

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

9 years agoTrying to fix failing Clang sanitizer test on ARM bots
Renato Golin [Fri, 17 Oct 2014 09:40:21 +0000 (09:40 +0000)]
Trying to fix failing Clang sanitizer test on ARM bots

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

9 years agoTowards PR21289: don't lose track of unexpanded parameter packs with
Richard Smith [Fri, 17 Oct 2014 02:46:42 +0000 (02:46 +0000)]
Towards PR21289: don't lose track of unexpanded parameter packs with
non-dependent types, in CXXScalarValueInitExprs and in the
nested-name-specifier or template arguments of a DeclRefExpr in particular.

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

9 years agoRemove incorrect usage of JoinedOrSeparate.
Richard Smith [Fri, 17 Oct 2014 01:52:48 +0000 (01:52 +0000)]
Remove incorrect usage of JoinedOrSeparate.

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

9 years agoPR21215: Support -fmodule-map-file being specified multiple times. Support
Richard Smith [Fri, 17 Oct 2014 01:42:53 +0000 (01:42 +0000)]
PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory.

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

9 years agoSwitch to range-based for loop. No functionality change.
Richard Smith [Fri, 17 Oct 2014 01:26:52 +0000 (01:26 +0000)]
Switch to range-based for loop. No functionality change.

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

9 years agoPer comments on PR12350, move DR244 back from 'done' to 'partial' and add tests showi...
Richard Smith [Fri, 17 Oct 2014 01:03:17 +0000 (01:03 +0000)]
Per comments on PR12350, move DR244 back from 'done' to 'partial' and add tests showing what we get wrong.

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

9 years agoCodeGen: Kill FillInNullDataMemberPointers
David Majnemer [Fri, 17 Oct 2014 01:00:43 +0000 (01:00 +0000)]
CodeGen: Kill FillInNullDataMemberPointers

It exists to handle the case where base subobjects are character arrays.
This never happens.

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

9 years agoAST: Remove dead code from RecordLayoutBuilder
David Majnemer [Fri, 17 Oct 2014 01:00:41 +0000 (01:00 +0000)]
AST: Remove dead code from RecordLayoutBuilder

No functionality change intended.

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

9 years agotrying to fix the new test again, this time for the clang-cmake-armv7-a15 bot
Kostya Serebryany [Fri, 17 Oct 2014 00:47:30 +0000 (00:47 +0000)]
trying to fix the new test again, this time for the clang-cmake-armv7-a15 bot

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

9 years agoSanitizerBlacklist: blacklist functions by their source location.
Alexey Samsonov [Fri, 17 Oct 2014 00:20:19 +0000 (00:20 +0000)]
SanitizerBlacklist: blacklist functions by their source location.

This commit changes the way we blacklist functions in ASan, TSan,
MSan and UBSan. We used to treat function as "blacklisted"
and turned off instrumentation in it in two cases:

1) Function is explicitly blacklisted by its mangled name.
This part is not changed.

2) Function is located in llvm::Module, whose identifier is
contained in the list of blacklisted sources. This is completely
wrong, as llvm::Module may not correspond to the actual source
file function is defined in. Also, function can be defined in
a header, in which case user had to blacklist the .cpp file
this header was #include'd into, not the header itself.
Such functions could cause other problems - for instance, if the
header was included in multiple source files, compiled
separately and linked into a single executable, we could end up
with both instrumented and non-instrumented version of the same
function participating in the same link.

After this change we will make blacklisting decision based on
the SourceLocation of a function definition. If a function is
not explicitly defined in the source file, (for example, the
function is compiler-generated and responsible for
initialization/destruction of a global variable), then it will
be blacklisted if the corresponding global variable is defined
in blacklisted source file, and will be instrumented otherwise.

After this commit, the active users of blacklist files may have
to revisit them. This is a backwards-incompatible change, but
I don't think it's possible or makes sense to support the
old incorrect behavior.

I plan to make similar change for blacklisting GlobalVariables
(which is ASan-specific).

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

9 years agoAppease the buildbots with the special case for non-set variables
Filipe Cabecinhas [Thu, 16 Oct 2014 23:54:26 +0000 (23:54 +0000)]
Appease the buildbots with the special case for non-set variables

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

9 years agoTeach SanitizerBlacklist to blacklist by SourceLocation. NFC.
Alexey Samsonov [Thu, 16 Oct 2014 23:50:26 +0000 (23:50 +0000)]
Teach SanitizerBlacklist to blacklist by SourceLocation. NFC.

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

9 years agoAdded %itanium_abi_host_triple to fix debuginfo-tests when clang is a cross-compiler...
Filipe Cabecinhas [Thu, 16 Oct 2014 23:41:40 +0000 (23:41 +0000)]
Added %itanium_abi_host_triple to fix debuginfo-tests when clang is a cross-compiler by default

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

9 years agoRe-commit r217995 and follow-up patches (r217997, r218011, r218053). These were
Richard Smith [Thu, 16 Oct 2014 23:00:46 +0000 (23:00 +0000)]
Re-commit r217995 and follow-up patches (r217997, r218011, r218053). These were
reverted in r218058 because they triggered a rejects-valid bug in MSVC.

Original commit message from r217995:

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@219977 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: handle additional case of qualified types
Saleem Abdulrasool [Thu, 16 Oct 2014 22:42:53 +0000 (22:42 +0000)]
Sema: handle additional case of qualified types

A second instance of attributed types escaped the previous change, identified
thanks to Richard Smith!  When deducing the void case, we would also assume that
the type would not be attributed.  Furthermore, properly handle multiple
attributes being applied to a single TypeLoc.

Properly handle this case and future-proof a bit by ignoring parenthesis
further.  The test cases do use the additional parenthesis to ensure that this
case remains properly handled.

Addresses post-commit review comments from Richard Smith to SVN r219851.

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

9 years agotest/CodeGen/sections.c: add triple
Hans Wennborg [Thu, 16 Oct 2014 21:36:23 +0000 (21:36 +0000)]
test/CodeGen/sections.c: add triple

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

9 years agotrying to fix the new test on hexagon-build
Kostya Serebryany [Thu, 16 Oct 2014 21:22:40 +0000 (21:22 +0000)]
trying to fix the new test on hexagon-build

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

9 years agoInsert poisoned paddings between fields in C++ classes so that AddressSanitizer can...
Kostya Serebryany [Thu, 16 Oct 2014 20:54:52 +0000 (20:54 +0000)]
Insert poisoned paddings between fields in C++ classes so that AddressSanitizer can find intra-object-overflow bugs

Summary:
The general approach is to add extra paddings after every field
in AST/RecordLayoutBuilder.cpp, then add code to CTORs/DTORs that poisons the paddings
(CodeGen/CGClass.cpp).

Everything is done under the flag -fsanitize-address-field-padding.
The blacklist file (-fsanitize-blacklist) allows to avoid the transformation
for given classes or source files.

See also https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow

Test Plan: run SPEC2006 and some of the Chromium tests with  -fsanitize-address-field-padding

Reviewers: samsonov, rnk, rsmith

Reviewed By: rsmith

Subscribers: majnemer, cfe-commits

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

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

9 years agoMS Compat: mark globals emitted in read-only sections const
Hans Wennborg [Thu, 16 Oct 2014 20:52:46 +0000 (20:52 +0000)]
MS Compat: mark globals emitted in read-only sections const

They cannot be written to, so marking them const makes sense and may improve
optimisation.

As a side-effect, SectionInfos has to be moved from Sema to ASTContext.

It also fixes this problem, that occurs when compiling ATL:

  warning LNK4254: section 'ATL' (C0000040) merged into '.rdata' (40000040) with different attributes

The ATL headers are putting variables in a special section that's marked
read-only. However, Clang currently can't model that read-onlyness in the IR.
But, by making the variables const, the section does become read-only, and
the linker warning is avoided.

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

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

9 years agoNo longer emit diagnostics about unused results (comparisons, etc) from unevaluated...
Aaron Ballman [Thu, 16 Oct 2014 20:13:28 +0000 (20:13 +0000)]
No longer emit diagnostics about unused results (comparisons, etc) from unevaluated contexts. Fixes PR18571.

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

9 years agoUpdate for llvm change.
Rafael Espindola [Thu, 16 Oct 2014 20:00:22 +0000 (20:00 +0000)]
Update for llvm change.

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

9 years agoDebugInfo: Follow up to r219736, also test/demonstrate that we emit the constant...
David Blaikie [Thu, 16 Oct 2014 18:38:36 +0000 (18:38 +0000)]
DebugInfo: Follow up to r219736, also test/demonstrate that we emit the constant value in this case as well.

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

9 years agoFixing comment grammar; NFC.
Aaron Ballman [Thu, 16 Oct 2014 18:09:29 +0000 (18:09 +0000)]
Fixing comment grammar; NFC.

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

9 years agoSpeculatively fix GCC 4.7 build after r219938
Hans Wennborg [Thu, 16 Oct 2014 17:57:41 +0000 (17:57 +0000)]
Speculatively fix GCC 4.7 build after r219938

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

9 years agoSwitching to range-based for loops; NFC.
Aaron Ballman [Thu, 16 Oct 2014 17:53:07 +0000 (17:53 +0000)]
Switching to range-based for loops; NFC.

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

9 years agoFix code to follow the "Don’t use else after a return" rule.
Samuel Benzaquen [Thu, 16 Oct 2014 17:50:19 +0000 (17:50 +0000)]
Fix code to follow the "Don’t use else after a return" rule.

Summary:
Fix code to follow the "Don’t use else after a return" rule.
This is a followup from rL219792.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

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

9 years agoUse iterators and algorithms to possibly make this code a bit tidier
David Blaikie [Thu, 16 Oct 2014 17:23:58 +0000 (17:23 +0000)]
Use iterators and algorithms to possibly make this code a bit tidier

(also, the code executed once the element was found was split half
inside the loop and half after it - now put it all together after the
find operation)

I'm a bit concerned that this code is rather untested (commenting out
this whole function and running check-clang doesn't fail any tests)...

And I wish I had polymorphic lambdas.

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

9 years agoRemove one of SanitizerBlacklist::isIn() overloads. NFC.
Alexey Samsonov [Thu, 16 Oct 2014 17:10:38 +0000 (17:10 +0000)]
Remove one of SanitizerBlacklist::isIn() overloads. NFC.

The final goal is to get rid of all the rest overloads that
accept LLVM objects (llvm::Function and llvm::GlobalVariable),
and pass in source-level entities instead.

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

9 years agoUse array_lengthof; NFC.
Hans Wennborg [Thu, 16 Oct 2014 16:54:36 +0000 (16:54 +0000)]
Use array_lengthof; NFC.

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

9 years ago[AArch64] Enable A53 erratum workaround (835769) by default for Android targets
Bradley Smith [Thu, 16 Oct 2014 16:35:14 +0000 (16:35 +0000)]
[AArch64] Enable A53 erratum workaround (835769) by default for Android targets

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

9 years agotests: move test to more appropriate location
Saleem Abdulrasool [Thu, 16 Oct 2014 16:12:41 +0000 (16:12 +0000)]
tests: move test to more appropriate location

The test is a C++ semantic analysis test, move it to SemaCXX from Sema.  NFC.

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

9 years agoOpenCL: Emit global variables in the constant addr space as constant globals
Tom Stellard [Thu, 16 Oct 2014 15:29:19 +0000 (15:29 +0000)]
OpenCL: Emit global variables in the constant addr space as constant globals

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

9 years agoOpenCL: Add -ffake-address-space-map to a test
Tom Stellard [Thu, 16 Oct 2014 15:29:17 +0000 (15:29 +0000)]
OpenCL: Add -ffake-address-space-map to a test

The ensures there is an explicit address space id in the output.

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

9 years agoclang-format: Fix behavior with comments before conditional expressions
Daniel Jasper [Thu, 16 Oct 2014 09:10:11 +0000 (09:10 +0000)]
clang-format: Fix behavior with comments before conditional expressions

Before:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
                   ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa
                                     : bbbbbbbbbbbbbbbbbbbb);

After:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
               ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa : bbbbbbbbbbbbbbbbbbbb);

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

9 years agoclang-format: [ObjC] Fix method expression detection.
Daniel Jasper [Thu, 16 Oct 2014 08:38:51 +0000 (08:38 +0000)]
clang-format: [ObjC] Fix method expression detection.

Before:
  return (a)[foo bar : baz];

After:
  return (a)[foo bar:baz];

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

9 years agoFrontend: Fix some underscore-then-capital UB
Justin Bogner [Thu, 16 Oct 2014 06:00:55 +0000 (06:00 +0000)]
Frontend: Fix some underscore-then-capital UB

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

9 years agospecify dwarf version for Solaris
Alexander Eremin [Thu, 16 Oct 2014 05:55:24 +0000 (05:55 +0000)]
specify dwarf version for Solaris

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

9 years agoPR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc...
David Blaikie [Thu, 16 Oct 2014 04:21:25 +0000 (04:21 +0000)]
PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc) for non-type template parameters

Plumb through the full QualType of the TemplateArgument::Declaration, as
it's insufficient to only know whether the type is a reference or
pointer (that was necessary for mangling, but insufficient for debug
info). This shouldn't increase the size of TemplateArgument as
TemplateArgument::Integer is still longer by another 32 bits.

Several bits of code were testing that the reference-ness of the
parameters matched, but this seemed to be insufficient (various other
features of the type could've mismatched and wouldn't've been caught)
and unnecessary, at least insofar as removing those tests didn't cause
anything to fail.

(Richard - perchaps you can hypothesize why any of these checks might
need to test reference-ness of the parameters (& explain why
reference-ness is part of the mangling - I would've figured that for the
reference-ness to be different, a prior template argument would have to
be different). I'd be happy to add them in/beef them up and add test
cases if there's a reason for them)

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

9 years agoBugfix in template instantiation in CXXPseudoDestructorExpr.
Alexey Bataev [Thu, 16 Oct 2014 03:04:35 +0000 (03:04 +0000)]
Bugfix in template instantiation in CXXPseudoDestructorExpr.
Fix for clang crash when instantiating a template with qualified lookup for members in non-class types.
Differential Revision: http://reviews.llvm.org/D5769

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

9 years agoDebugInfo: Cleanup testing of non-type template parameters.
David Blaikie [Thu, 16 Oct 2014 00:41:40 +0000 (00:41 +0000)]
DebugInfo: Cleanup testing of non-type template parameters.

Separate out the non-nullable parameters from the nullable ones
(currently only the template template parameter) and demonstrate that
cv-qualifiers aren't preserved for non-null parameters (but are
preserved for null parameters) by adding 'const' to an int* non-type
template parameter.

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

9 years ago[CMake] clangBasic: Add Core to LINK_COMPONENTS introduced by r219840.
NAKAMURA Takumi [Thu, 16 Oct 2014 00:12:02 +0000 (00:12 +0000)]
[CMake] clangBasic: Add Core to LINK_COMPONENTS introduced by r219840.

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

9 years agoMoving CGF::EmitAlignmentAssumption to IRBuilder
Hal Finkel [Wed, 15 Oct 2014 23:45:08 +0000 (23:45 +0000)]
Moving CGF::EmitAlignmentAssumption to IRBuilder

The functionality contained in CodeGenFunction::EmitAlignmentAssumption has
been moved to IRBuilder (so that it can also be used by LLVM-level code).
Remove this now-duplicate implementation in favor of the IRBuilder code.

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

9 years agoCodeGen: Don't drop thread_local when emitting __thread aliases
David Majnemer [Wed, 15 Oct 2014 22:38:23 +0000 (22:38 +0000)]
CodeGen: Don't drop thread_local when emitting __thread aliases

CodeGen wouldn't mark the aliasee as thread_local if the aliasee was a
tentative definition.

Even if the definition was already emitted, it would never mark the
alias as thread_local.

This fixes PR21288.

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

9 years agoMove SanitizerBlacklist object from CodeGenModule to ASTContext.
Alexey Samsonov [Wed, 15 Oct 2014 22:17:27 +0000 (22:17 +0000)]
Move SanitizerBlacklist object from CodeGenModule to ASTContext.

Soon we'll need to have access to blacklist before the CodeGen
phase (see http://reviews.llvm.org/D5687), so parse and construct
the blacklist earlier.

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

9 years agoAvoid having "using namespace" for both "clang" and "llvm" namespaces.
Alexey Samsonov [Wed, 15 Oct 2014 22:00:40 +0000 (22:00 +0000)]
Avoid having "using namespace" for both "clang" and "llvm" namespaces.
This is fragile, as there are classes with the same name in both
namespaces (e.g. llvm::Module and clang::Module).

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

9 years agoSema: handle AttributedTypeLocs in C++14 auto deduction
Saleem Abdulrasool [Wed, 15 Oct 2014 21:37:55 +0000 (21:37 +0000)]
Sema: handle AttributedTypeLocs in C++14 auto deduction

When performing a type deduction from the return type, the FunctionDecl may be
attributed with a calling convention.  In such a case, the retrieved type
location may be an AttributedTypeLoc.  Performing a castAs<FunctionProtoTypeLoc>
on such a type loc would result in an assertion as they are not derived types.

Ensure that we correctly handle the attributed type location by looking through
it to the modified type loc.

Fixes an assertion triggered in C++14 mode.

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

9 years agotest: simplify test further
Saleem Abdulrasool [Wed, 15 Oct 2014 21:37:52 +0000 (21:37 +0000)]
test: simplify test further

Remove the use of an unnecessary function.  NFC.

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

9 years agoChange hasName() to take const std::string&, as it was taking before rL219792.
Samuel Benzaquen [Wed, 15 Oct 2014 21:23:31 +0000 (21:23 +0000)]
Change hasName() to take const std::string&, as it was taking before rL219792.

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

9 years agoMove -fsanitize-blacklist to LangOpts from CodeGenOpts. NFC.
Alexey Samsonov [Wed, 15 Oct 2014 20:22:54 +0000 (20:22 +0000)]
Move -fsanitize-blacklist to LangOpts from CodeGenOpts. NFC.

After http://reviews.llvm.org/D5687 is submitted, we will need
SanitizerBlacklist before the CodeGen phase, so make it a LangOpt
(as it will actually affect ABI / class layout).

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

9 years agoMove SanitizerBlacklist to clangBasic. NFC.
Alexey Samsonov [Wed, 15 Oct 2014 19:57:45 +0000 (19:57 +0000)]
Move SanitizerBlacklist to clangBasic. NFC.

This change moves SanitizerBlacklist.h from lib/CodeGen
to public Clang headers in include/clang/Basic. SanitizerBlacklist
is currently only used in CodeGen to decide which functions/modules
should be instrumented, but this will soon change as ASan will
optionally modify class layouts during AST construction
(http://reviews.llvm.org/D5687). We need blacklist machinery
to be available at this point.

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

9 years agoAs requested by Matt Thomas, use long long for intmax_t and int64_t on
Joerg Sonnenberger [Wed, 15 Oct 2014 19:52:03 +0000 (19:52 +0000)]
As requested by Matt Thomas, use long long for intmax_t and int64_t on
PPC64/NetBSD.

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

9 years agoSet ABI and DescriptionString first to reduce OS specific logic.
Joerg Sonnenberger [Wed, 15 Oct 2014 19:47:15 +0000 (19:47 +0000)]
Set ABI and DescriptionString first to reduce OS specific logic.
Use switch for FreeBSD check to allow easier extension.

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

9 years agoAdd llvm_unreachable after switch to avoid warnings about a missing
Kaelyn Takata [Wed, 15 Oct 2014 18:03:26 +0000 (18:03 +0000)]
Add llvm_unreachable after switch to avoid warnings about a missing
return.

Forgot to add this in r219818.

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

9 years agoDrop unneccessary default case from switch introduced in r219809
Kaelyn Takata [Wed, 15 Oct 2014 17:46:18 +0000 (17:46 +0000)]
Drop unneccessary default case from switch introduced in r219809

This silences:
../tools/clang/tools/libclang/CIndex.cpp:6451:3: warning: default label
in switch which covers all enumeration values [-Wcovered-switch-default]

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

9 years agoRevert "Fix late template parsing leak with incremental processing"
Reid Kleckner [Wed, 15 Oct 2014 17:22:56 +0000 (17:22 +0000)]
Revert "Fix late template parsing leak with incremental processing"

This reverts commit r219810.

The test suite appears broken.

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

9 years ago[analyzer] Perl scripts are run differently from makefiles. Sometimes additional...
Anton Yartsev [Wed, 15 Oct 2014 17:13:02 +0000 (17:13 +0000)]
[analyzer] Perl scripts are run differently from makefiles. Sometimes additional utilities are involved, e.g. 'env' utility that present in MSYS but is missing in MinGW. The patch unifies launch of "c++-analyzer" and "ccc-analyzer".

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

9 years agoFix late template parsing leak with incremental processing
Reid Kleckner [Wed, 15 Oct 2014 17:08:33 +0000 (17:08 +0000)]
Fix late template parsing leak with incremental processing

Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing.  Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed.  Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.

Patch by Brad King!

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

9 years ago[libclang] Add function to retrieve storage class in libclang.
Argyrios Kyrtzidis [Wed, 15 Oct 2014 17:05:31 +0000 (17:05 +0000)]
[libclang] Add function to retrieve storage class in libclang.

Patch by guibufolo!

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

9 years agoAdding attributes to the IndirectFieldDecl that we generate for anonymous struct...
Aaron Ballman [Wed, 15 Oct 2014 16:58:18 +0000 (16:58 +0000)]
Adding attributes to the IndirectFieldDecl that we generate for anonymous struct/union fields. This fixes PR20930.

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

9 years agoDon't use a global_ctors comdat for globals that aren't externally visible
Reid Kleckner [Wed, 15 Oct 2014 16:38:00 +0000 (16:38 +0000)]
Don't use a global_ctors comdat for globals that aren't externally visible

In particular, if you have two identical templates in different TUs in
anonymous namespaces, we would use the same global_ctors comdat key for
both. As a result, only one would be run.

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

9 years agoCodeGen: Cleanup CGRecordLowering::lowerUnion a little
David Majnemer [Wed, 15 Oct 2014 16:36:11 +0000 (16:36 +0000)]
CodeGen: Cleanup CGRecordLowering::lowerUnion a little

Remove some duplicated state, no functionality change intended.

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

9 years agoFix for PR21254 - Assertion in comment parser
Dario Domizioli [Wed, 15 Oct 2014 16:18:20 +0000 (16:18 +0000)]
Fix for PR21254 - Assertion in comment parser

The size of the ID field in CommandInfo was narrow, leading to potential
wrap-around of command IDs, causing misinterpretation later on.
The patch does the following:
- It extends the ID bitfield from 8 to 20 bits.
- It provides a DRY definition of the number of bits for the field to
  avoid using literal numbers in different files.
- It introduces a new assertion that checks for the wrap-around.
- It adds the testcase from PR21254.

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

9 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 15 Oct 2014 16:12:57 +0000 (16:12 +0000)]
Update for llvm api change.

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

9 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 15 Oct 2014 15:44:25 +0000 (15:44 +0000)]
Update for llvm api change.

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

9 years agoTurned Sema::HandleDelayedAvailabilityCheck into a static function; NFC.
Aaron Ballman [Wed, 15 Oct 2014 15:37:51 +0000 (15:37 +0000)]
Turned Sema::HandleDelayedAvailabilityCheck into a static function; NFC.

Did a bit of drive-by reformatting as well since it required rearranging some other static functions in the file.

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

9 years ago[analyzer] Handle 'mingw32-make' in the same way as 'make' and 'gmake'.
Anton Yartsev [Wed, 15 Oct 2014 15:11:45 +0000 (15:11 +0000)]
[analyzer] Handle 'mingw32-make' in the same way as 'make' and 'gmake'.

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

9 years agoSpeed up hasName() matcher.
Samuel Benzaquen [Wed, 15 Oct 2014 14:58:46 +0000 (14:58 +0000)]
Speed up hasName() matcher.

Summary:
Speed up hasName() matcher by skipping the expensive generation of the
fully qualified name unless we need it.
In the common case of matching an unqualified name, we don't need to
generate the full name. We might not even need to copy any string at
all.
This change speeds up our clang-tidy benchmark by ~10%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoFixed a comment. No functional changes.
Alexander Kornienko [Wed, 15 Oct 2014 11:03:39 +0000 (11:03 +0000)]
Fixed a comment. No functional changes.

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

9 years agoCodeGen: Use the initing member's type for a union's storage type more often
David Majnemer [Wed, 15 Oct 2014 07:57:41 +0000 (07:57 +0000)]
CodeGen: Use the initing member's type for a union's storage type more often

Unions are initialized with the default initialization of their first
named member.  If that member is not zero initialized, then we should
prefer that member's type.  Otherwise, we might try to make an otherwise
unsuitable type (like an array) which we cannot easily initialize with a
pointer to member.

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

9 years agoCodeGen: Fix a typo in a comment
David Majnemer [Wed, 15 Oct 2014 07:57:38 +0000 (07:57 +0000)]
CodeGen: Fix a typo in a comment

No functionality change intended.

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

9 years agoMS ABI: Use the correct this arg when generating implicit array copy ctor
David Majnemer [Wed, 15 Oct 2014 04:54:54 +0000 (04:54 +0000)]
MS ABI: Use the correct this arg when generating implicit array copy ctor

We assumed the last argument of the copy constructor was the this
pointer.  However, this is not the case under the MS ABI.

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

9 years agoImprovements to -Wnull-conversion
Richard Trieu [Wed, 15 Oct 2014 03:42:06 +0000 (03:42 +0000)]
Improvements to -Wnull-conversion

Split logic to separate checking function
Refine the macro checking
Catch nullptr->bool conversions
Add some explanatory comments

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

9 years agoFrontend: Don't accept null DiagnosticsEngines when building ASTUnits
Justin Bogner [Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)]
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits

The various ways to create an ASTUnit all take a refcounted pointer to
a diagnostics engine as an argument, and if it isn't pointing at
anything they initialize it. This is a pretty confusing API, and it
really makes more sense for the caller to initialize the thing since
they control the lifetime anyway.

This fixes the one caller that didn't bother initializing the pointer
and asserts that the argument is initialized.

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

9 years agoFrontend: Remove some unused arguments in ASTUnit (NFC)
Justin Bogner [Tue, 14 Oct 2014 23:36:06 +0000 (23:36 +0000)]
Frontend: Remove some unused arguments in ASTUnit (NFC)

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

9 years agovadefs.h: be even more conservative and only define the macros if already defined
Hans Wennborg [Tue, 14 Oct 2014 23:20:25 +0000 (23:20 +0000)]
vadefs.h: be even more conservative and only define the macros if already defined

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

9 years agoclang-cl: Diagnose the usage of ASAN with a debug runtime library
Ehsan Akhgari [Tue, 14 Oct 2014 23:15:44 +0000 (23:15 +0000)]
clang-cl: Diagnose the usage of ASAN with a debug runtime library

Summary:
AddressSanitizer currently doesn't support this configuration, and binaries
built with it will just get into an infinite loop during startup.

Test Plan: Includes an automated test.

Reviewers: samsonov

Subscribers: cfe-commits

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

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

9 years agoSort files list in lib/Headers/CMakeLists.txt
Hans Wennborg [Tue, 14 Oct 2014 23:15:43 +0000 (23:15 +0000)]
Sort files list in lib/Headers/CMakeLists.txt

majnemer pointed out that vadefs.h was added in the wrong place. Might
as well sort the rest too.

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

9 years agoMS Compat: interpose vadefs.h to fix definitions of _crt_va_{start,end,arg} (PR21247)
Hans Wennborg [Tue, 14 Oct 2014 22:35:42 +0000 (22:35 +0000)]
MS Compat: interpose vadefs.h to fix definitions of _crt_va_{start,end,arg} (PR21247)

Differential revision: http://reviews.llvm.org/D5784

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

9 years agoDebugInfo: Lazily built static member variable declarations should use the canonical...
David Blaikie [Tue, 14 Oct 2014 22:22:17 +0000 (22:22 +0000)]
DebugInfo: Lazily built static member variable declarations should use the canonical declaration for line/file information.

When lazily constructing static member variable declarations (when
the vtable optimization fires and the definition of the type is omitted
(or built later, lazily), but the out of line definition of the static
member is provided and must be described in debug info) ensure we use
the canonical declaration when computing the file, line, etc for that
declaration (rather than the definition, which is also a declaration,
but not the canonical one).

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

9 years agoARM: remove ARM/Thumb distinction for preferred alignment.
Tim Northover [Tue, 14 Oct 2014 22:12:21 +0000 (22:12 +0000)]
ARM: remove ARM/Thumb distinction for preferred alignment.

Thumb1 has legitimate reasons for preferring 32-bit alignment of types
i1/i8/i16, since the 16-bit encoding of "add rD, sp, #imm" requires #imm to be
a multiple of 4. However, this is a trade-off betweem code size and RAM usage;
the DataLayout string is not the best place to represent it even if desired.

So this patch removes the extra Thumb requirements, hopefully making ARM and
Thumb completely compatible in this respect.

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

9 years agoBe smarter when parsing variable declarations with unknown types.
Kaelyn Takata [Tue, 14 Oct 2014 21:57:21 +0000 (21:57 +0000)]
Be smarter when parsing variable declarations with unknown types.

Specifically, avoid typo-correcting the variable name into a type before
typo-correcting the actual type name in the declaration. Doing so
results in a very unpleasant cascade of errors, with the typo correction
of the actual type name being buried in the middle.

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

9 years agoARM: set preferred aggregate alignment to 32 universally.
Tim Northover [Tue, 14 Oct 2014 20:57:29 +0000 (20:57 +0000)]
ARM: set preferred aggregate alignment to 32 universally.

Before, ARM and Thumb mode code had different preferred alignments, which could
lead to some rather unexpected results. There's justification for reducing it
from the default 64-bits (wasted space), but I don't think there is for going
below 32-bits.

There's no actual ABI change here, just to reassure people.

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

9 years agoFactor code into CXXRecordDecl::getTemplateInstantiationPattern() helper
Reid Kleckner [Tue, 14 Oct 2014 20:28:40 +0000 (20:28 +0000)]
Factor code into CXXRecordDecl::getTemplateInstantiationPattern() helper

This moves some code from SemaType.cpp's hasVisibleDefinition() into
DeclCXX.cpp so that it can be used elsewhere. I found one other instance
of code trying to do the same thing, there are probably more. Search for
getInstantiatedFrom() to try to find more.

No functionality change.

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoPatch to warn on interger overflow in presence of
Fariborz Jahanian [Tue, 14 Oct 2014 20:27:05 +0000 (20:27 +0000)]
Patch to warn on interger overflow in presence of
implicit casts. Reviewed by Reid Kleckner.
rdar://18405357

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

9 years agoCodeGen: correct block mangling in ObjC
Saleem Abdulrasool [Tue, 14 Oct 2014 17:20:18 +0000 (17:20 +0000)]
CodeGen: correct block mangling in ObjC

Mangling for blocks defined within blocks in an ObjectiveC context were also
broken by SVN r219393.  Because the code in mangleName assumed that the code was
either C or C++, we would trigger assertions when trying to mangle the inner
blocks in an ObjectiveC context.

Add a test and use the ObjectiveC specific mangling when dealing with an
ObjectiveC method declaration.

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

9 years agoCodeGen: correct mangling for blocks
Saleem Abdulrasool [Tue, 14 Oct 2014 17:20:14 +0000 (17:20 +0000)]
CodeGen: correct mangling for blocks

This addresses a regression introduced with SVN r219393.  A block may be
contained within another block.  In such a scenario, we would end up within a
BlockDecl, which is not a NamedDecl (as the names are synthesised).  The cast to
a NamedDecl of the DeclContext would then assert as the types are unrelated.

Restore the mangling behaviour to that prior to SVN r219393.  If the current
block is contained within a BlockDecl, walk up to the parent DeclContext,
recursively, until we have a non-BlockDecl.  This is expected to be a NamedDecl.
Add in a couple of asserts to ensure that the assumption that we only encounter
a block within a NamedDecl or a BlockDecl.

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

9 years agoFormatting for prior commit
David Blaikie [Tue, 14 Oct 2014 17:09:38 +0000 (17:09 +0000)]
Formatting for prior commit

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