Range'ify some for loops over RecordDecl::fields()

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216183 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. Recover from missing interface decl.
and checking on availability of method declaration
instead of crashing. // rdar://18059669


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216191 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor TLI creation. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216198 91177308-0d34-0410-b5e6-96231b3b80d8
Coverage Mapping: store function's hash in coverage function records.

The profile data format was recently updated and the new indexing api
requires the code coverage tool to know the function's hash as well
as the function's name to get the execution counts for a function.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216208 91177308-0d34-0410-b5e6-96231b3b80d8
Pass expressions instead of argument ranges to EmitCall/EmitCXXConstructorCall.

Summary:
This is a first small step towards passing generic "Expr" instead of
ArgBeg/ArgEnd pair into EmitCallArgs() family of methods. Having "Expr" will
allow us to get the corresponding FunctionDecl and its ParmVarDecls,
thus allowing us to alter CodeGen depending on the function/parameter
attributes.

No functionality change.

Test Plan: regression test suite

Reviewers: rnk

Reviewed By: rnk

Subscribers: aemerson, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216214 91177308-0d34-0410-b5e6-96231b3b80d8
Fix grammatical error in diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216221 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify this logic now that -W can't be applied to remarks. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216222 91177308-0d34-0410-b5e6-96231b3b80d8
Return statements are initialization; don't forget to revert the initializer to
its syntactic form before re-analyzing it during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216224 91177308-0d34-0410-b5e6-96231b3b80d8
Update Clang for LLVM API change to use unique_ptr in SourceManager::AddNewSourceBuffer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216226 91177308-0d34-0410-b5e6-96231b3b80d8
Update for LLVM API change to remove discriminator tracking from DILexicalBlock (in favor of DILexicalBlockFile - where a default arg is used to avoid the need for API churn of those callers)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216240 91177308-0d34-0410-b5e6-96231b3b80d8
[test/CodeGen/ARM] Adpat test to match new codegen after r216236.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216249 91177308-0d34-0410-b5e6-96231b3b80d8
CGCall: Factor out the logic mapping call arguments to LLVM IR arguments.

Summary:
This refactoring introduces ClangToLLVMArgMapping class, which
encapsulates the information about the order in which function arguments listed
in CGFunctionInfo should be passed to actual LLVM IR function, such as:
1) positions of sret, if there is any
2) position of inalloca argument, if there is any
3) position of helper padding argument for each call argument
4) positions of regular argument (there can be many if it's expanded).
Simplify several related methods (ConstructAttributeList, EmitFunctionProlog
and EmitCall): now they don't have to maintain iterators over the list
of LLVM IR function arguments, dealing with all the sret/inalloca/this complexities,
and just use expected positions of LLVM IR arguments stored in ClangToLLVMArgMapping.

This may increase the running time of EmitFunctionProlog, as we have to traverse
expandable arguments twice, but in further refactoring we will be able
to speed up EmitCall by passing already calculated CallArgsToIRArgsMapping to
ConstructAttributeList, thus avoiding traversing expandable argument there.

No functionality change.

Test Plan: regression test suite

Reviewers: majnemer, rnk

Reviewed By: rnk

Subscribers: cfe-commits, rjmccall, timurrrr

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216251 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR20705, crash on invalid.

dyn_cast -> dyn_cast_or_null to handle a null pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216254 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Don't use the Itanium scheme for numbering lambdas

The Itanium ABI will give out the same mangling number for two different
lambdas if their call operators have different types.  The MS ABI cannot
do the same because it does not mangle the return type into it's
lambdas.

This fixes PR20719.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216259 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64, inline-asm] Improve diagnostic that is printed when the size of a
variable that has regiser constraint "r" is not 64-bit.

General register operands are output using 64-bit "x" register names, regardless
of the size of the variable, unless the asm operand is prefixed with the "%w"
modifier. This surprises and confuses many users who aren't familiar with
aarch64 inline assembly rules.

With this commit, a note and fixit hint are printed which tell the users that
they need modifier "%w" in order to output a "w" register instead of an "x"
register.

<rdar://problem/12764785>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216260 91177308-0d34-0410-b5e6-96231b3b80d8
Fixing MSVC warning: "warning C4373: 'blah': virtual function overrides 'blah', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers."

This warning is basically useless because the "previous versions" being referred to is MSVC 2005 and earlier, and we obviously do not care about them. However, this warning isn't particularly chatty (I don't recall ever seeing it previously), and it has the opportunity to point out cases where the cv-qualifiers differ unintentionally (like this case), so I am leaving it enabled for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216267 91177308-0d34-0410-b5e6-96231b3b80d8
-fms-extensions: Alias _intNN to __intNN

Fixes build for SPEC 2000 CPU. MSVC disables these aliases under /Za,
which enables stricter standards compliance. We don't currently have any
way to disable them.

Patch by Kevin Smith!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216270 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. Warn if user has made explicit call
to +initilize as this results in an extra call
to this method. rdar://16628028


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216271 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Remove check covered by -Wobjc-missing-super-calls.

The ObjCDealloc checker is currently disabled because it was too aggressive, but this
is a good first step in getting it back to a useful state.

Patch by David Kilzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216272 91177308-0d34-0410-b5e6-96231b3b80d8
[test/CodeGen/ARM] Adpat test to match new codegen after r216274.
Moreover, rework some patterns to actually check the emitted instructions
instead of matching unrelated string!

E.g.,
some of the "// CHECK: vmov" were matching stuff like ".globl
funcname_with_vmov" instead of actual instructions.


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