Fix use-after-free detected by ASan bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203140 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Use private linkage for remaining GlobalVariables with private names."

This reverts commit r203059.

Revert while we discuss what does it mean to be private and weak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203141 91177308-0d34-0410-b5e6-96231b3b80d8
Very minor simplification and typo correction; no functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203144 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Fix the initializer/finalizer mangling for static data members

Initializers and finalizers for static data members have the variable's
access-specifier, storage-class, type and CV-qualifiers mangled in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203145 91177308-0d34-0410-b5e6-96231b3b80d8
Add tests for MS inline asm change r203146

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203147 91177308-0d34-0410-b5e6-96231b3b80d8
Refactored to use a simple helper function that wraps the logic of creating an SExprNode and returning the position in which it was inserted.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203148 91177308-0d34-0410-b5e6-96231b3b80d8
Based on usage, the NamedDecl is always set when constructing a CallingContext, but none of the other optional parameters are. Removing the optional parameters, and making the NamedDecl required.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203149 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Disambiguate the manglings for global guard variables

If a guard variable will be created for an entity at global scope,
then we cannot rely on the scope depth to disambiguate names for us.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203151 91177308-0d34-0410-b5e6-96231b3b80d8
Fix dead store and simplify. No functionality change (although the code is now
correct if MaxEditDistance were increased to something greater than 1).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203153 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Add support for Objective-C blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203157 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] s/cpp11-migrate/clang-modernize/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203158 91177308-0d34-0410-b5e6-96231b3b80d8
Update for LLVM API change

Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203161 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: rename FileCheck variable to follow the existing convention.

I added this "STF" variable without noticing that all the other counter names
end with a "C". Renaming it to "STC" for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203165 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: rename profile data files from .pgodata to .profdata.

These tests were added before we had settled on using a .profdata extension
for the profile data files. Renaming them now for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203166 91177308-0d34-0410-b5e6-96231b3b80d8
Remove dead code I introduced 6 years, 4 months ago in r43518.

Found by -Wunreachable-code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203167 91177308-0d34-0410-b5e6-96231b3b80d8
Exclude invalid old decl from mismatching linkage assertion

This patch fixes PR18964. In linkage computation, assertion fails when
an old invalid declaration's linkage mismatches with the current
decl's one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203168 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a dead store, add a FIXME for another.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203169 91177308-0d34-0410-b5e6-96231b3b80d8
Make the test a bit stronger by showing what is added to llvm.used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203170 91177308-0d34-0410-b5e6-96231b3b80d8
Use llvm.compiler.used instead of llvm.used for objc symbols.

LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not
print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the
ones that the clang's objc codegen is producing. The net result, is that it is
equivalent to llvm.compiler.used.

The need for putting the private symbol in llvm.compiler.used should be clear
(the objc runtime uses them). The reason for also putting the weak symbols in
it is for LTO: ld64 will not ask us to preserve the it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203172 91177308-0d34-0410-b5e6-96231b3b80d8
C. Compare vector sizes using their raw element size instead of
getTypeSize (which rounds up sizes) in order to issue diagnostics 
when casting to mismatched vector sizes; instead of crashing in IRGen.
// rdar:// 16196902. Reviewed offline by John McCall.


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