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
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
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
[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
Use array_lengthof; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219935 91177308-0d34-0410-b5e6-96231b3b80d8
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
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
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
Switching to range-based for loops; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219940 91177308-0d34-0410-b5e6-96231b3b80d8
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
Fixing comment grammar; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219942 91177308-0d34-0410-b5e6-96231b3b80d8
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
Update for llvm change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219952 91177308-0d34-0410-b5e6-96231b3b80d8
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
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
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
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
test/CodeGen/sections.c: add triple

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219969 91177308-0d34-0410-b5e6-96231b3b80d8
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
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