MS ABI: Refactor extended qualifiers

Extended qualifiers can appear in many places, refactor the code so it's
more reusable.  Add tests in areas where we've increased compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201574 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: fix a bug in processing invalid arguments, introduced in r201249

Recommit r201346, reverted in r201373.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201578 91177308-0d34-0410-b5e6-96231b3b80d8
Add files that I forgot to svn add in 201578.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201579 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Teach CastSizeChecker about flexible array members.

...as well as fake flexible array members: structs that end in arrays with
length 0 or 1.

Patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201583 91177308-0d34-0410-b5e6-96231b3b80d8
Remove trailing spaces (no other change). Bikeshed #2



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201584 91177308-0d34-0410-b5e6-96231b3b80d8
DeLesley Hutchins (who wrote the original thread-safety attribute functionality) and I have agreed to start migrating from lock-specific terminology to "capability"-specific terminology. This opens the door for future threading-related analysis passes so that a common nomenclature can be used.

The following attributes have been (silently) deprecated, with their replacements listed:

lockable => capability
exclusive_locks_required => requires_capability
shared_locks_required => requires_shared_capability
locks_excluded => requires_capability

There are no functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201585 91177308-0d34-0410-b5e6-96231b3b80d8
In some cases (for example, the Firefox build system), the CLANG_CXX variable is defined but empty.
Extend the test (like it is done in scan-build) to check also if the variable 
is empty or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201586 91177308-0d34-0410-b5e6-96231b3b80d8
Missed updating this test case with r201585 -- the lockable attribute is now internally represented by CapabilityAttr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201587 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Parse the /d2Zi+ flag (PR18728)

This is an undocumented, but reportedly widely used flag.
We don't support it, but should be able to parse it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201588 91177308-0d34-0410-b5e6-96231b3b80d8
Attempting to fix the build bot due to some missing text in the ast dump.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201590 91177308-0d34-0410-b5e6-96231b3b80d8
Fix testcase to actually check what it was supposed to, and make it a bit more robust.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201591 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: support -v

It doesn't conflict with any cl.exe options and it's useful for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201597 91177308-0d34-0410-b5e6-96231b3b80d8
Updated documentation for Thread Safety Analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201598 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201602 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl /fallback: emit a note when falling back

This makes it a lot easier to see what's going on from the output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201604 91177308-0d34-0410-b5e6-96231b3b80d8
Experiment with making -Wunreachable-code more immediately useful by restricting warnings to those issued in the main file.

This warning has a whole bunch of known false positives, much of them due
to code that is "sometimes unreachable".  This can caused by code that
is conditionally generated by the preprocessor, branches that are defined
in terms of architecture-specific details (e.g., the size of a type), and
so on.  While these are all good things to address one by one, the reality
is that this warning has received little love lately.  By restricting
its purvue, we can focus on the top issues effecting main files, which
should be smaller, and then gradually widen the scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201607 91177308-0d34-0410-b5e6-96231b3b80d8
More tests for r201536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201610 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Remove nv adjustment from direct vdtor calls and prologues

Summary:
Generally the vector deleting dtor, which we model as a vtable thunk,
takes care of non-virtual adjustment and delegates to the other
destructor variants.  The other non-complete destructor variants assume
that 'this' on entry points to the virtual base subobject that first
declared the virtual destructor.

We need to change the adjustment in both the prologue and the vdtor call
setup.

Reviewers: timurrrr

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2821

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201612 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the Driver/cl-fallback.c test

On machines that have cl.exe on PATH, the note will print the full path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201613 91177308-0d34-0410-b5e6-96231b3b80d8
Fix false positives in -Wmsvc-include by continuing header search

This makes Clang and LLVM -Wmsvc-include clean.

I believe the correct behavior here is to avoid updating the cache when
we find the header via MSVC's search rules.

Differential Revision: http://llvm-reviews.chandlerc.com/D2733

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