clang-cl: implement /fallback mode

When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191034 91177308-0d34-0410-b5e6-96231b3b80d8
Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions

When -fms-extensions is enabled, the typo correction was being called here on
non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct
compilation depended on Sema::CorrectTypo not finding a viable candidate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191046 91177308-0d34-0410-b5e6-96231b3b80d8
PR17290: Use 'false' macro in fix-it hint for initializing a variable of type
_Bool in C, if the macro is defined. Also teach FixItUtils to look at whether
the macro was defined at the source location for which it is creating a fixit,
rather than looking at whether it's defined *now*. This is especially relevant
for analysis-based warnings which are delayed until end of TU.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191057 91177308-0d34-0410-b5e6-96231b3b80d8
Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
Testcase I forgot to svn add in r191057.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191067 91177308-0d34-0410-b5e6-96231b3b80d8
Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class.  This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
  int x;
  int y;
  A() : x(y) {}  // y is initialized after x, warn here
  A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191068 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Do not imply -undefined dynamic_lookup when linking dylibs with -fsanitize=address.
Instead add the ASan runtime to the linker command line so that only the ASan API functions can be undefined in the target library.

Fixes http://llvm.org/bugs/show_bug.cgi?id=17275



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191076 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix darwin-sanitizer-ld.c to test for the new order of linker flags introduced by r191076.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191077 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Use getParentIgnoreParenCasts instead of doing it by hand.

Apart from being more compact and already implemented, this also handles the
case where the parent is null. (It does also ignore all casts, not just
implicit ones, but this is more efficient to test and in the case we care
about---a message in a PseudoObjectExpr---there should only be implicit casts
anyway.

This should fix our internal buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191094 91177308-0d34-0410-b5e6-96231b3b80d8
Use -fms-compatibility to trigger lookup into dep. bases

Update the docs for -fms-extensions and -fms-compatibility to try to
clarify the difference between the two.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191095 91177308-0d34-0410-b5e6-96231b3b80d8
Clarify that we silently ignore some MS extensions like IDL attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191096 91177308-0d34-0410-b5e6-96231b3b80d8
Fix ReST links I just added to the manual

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191097 91177308-0d34-0410-b5e6-96231b3b80d8
Update -fmsc-version docs for r190908, which set the default to 1700

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191098 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: implement custom search for cl.exe in /fallback mode

This solves the problem of fallback onto ourselves if clang-cl
has been renamed to cl.exe and put on the PATH, as happens with
the VS integration.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191099 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor: CheckExplicitInitList is only called to check an entire InitListExpr,
so the Index in/out parameters are pointless (always passed in as 0, always
ignored by the caller).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191103 91177308-0d34-0410-b5e6-96231b3b80d8
Switch tests in test/Headers to use %clang_cc1 rather than %clang. There
is no need to go through the driver indirection here, and it clutters
things up as dependencies can sneak in for specific things the driver is
doing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191107 91177308-0d34-0410-b5e6-96231b3b80d8
Fix return type of _mm_extract_epi8 etc.

PR17300.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191120 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Allocate NaClTargetInfo for MIPSEL NaCl

A patch to AllocateTarget function to recognize llvm::Triple::NaCl for
MIPSEL and return NaClTargetInfo. Additional test has been added to check
if the expected macros get defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191124 91177308-0d34-0410-b5e6-96231b3b80d8
Fix clang-format-diff.py to accept -style again.

Copy and paste error in r190935..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191137 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Improve address-of-operator detection

Before:
  size = sizeof * a;

After:
  size = sizeof *a;

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