[CMake] Fix installation without CLANG_BUILD_EXAMPLES

When CLANG_BUILD_EXAMPLES is not on we set the EXCLUDE_FROM_ALL
directory property for the examples/ directory to tell CMake not to
build them by default.  The AddLLVM.cmake APIs are not aware of this and
try to install targets that are not built.  This does not cause an
install-time error because CMake excludes the directory from the default
installation.  However, now that installation attaches targets to the
LLVMExports export set CMake-based applications that find_package(LLVM)
fail because the example plugin binary is not available.

Tell the AddLLVM.cmake APIs to exclude the examples from installation by
setting the EXCLUDE_FROM_ALL variable they check.

Patch by Brad King!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201799 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Remove dead option."
Some tests in debuginfo-tests require the system-darwin feature.

This reverts commit 179670.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201801 91177308-0d34-0410-b5e6-96231b3b80d8
Add TemplateSpecializationType polymorphism for hasTemplateArgument and
hasAnyTemplateArgument, and (out of necessity) an isExpr matcher.

Also updates the TemplateArgument doxygen to reflect reality for
non-canonical template arguments.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201807 91177308-0d34-0410-b5e6-96231b3b80d8
Enable MSRecordLayout in the presence of external sources.

External sources shouldn't prevent the layout engine from using 
MSLayout.  If lldb were to support debugging in microsoft mode, some 
code will need to be added to MSRecordLayoutBuilder to handel external 
layouts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201810 91177308-0d34-0410-b5e6-96231b3b80d8
Recommit virtual file system

Previously reverted in r201755 due to causing an assertion failure.

I've removed the offending assertion, and taught the CompilerInstance to
create a default virtual file system inside createFileManager. In the
future, we should be able to reach into the CompilerInvocation to
customize this behaviour without breaking clients that don't care.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201818 91177308-0d34-0410-b5e6-96231b3b80d8
Hide pragma handler classes in ParsePragma.cpp

This reduces the number of files we need to touch to add a new pragma,
and reduces the number of externally visible symbols in clang.

Make the handlers structs instead of classes because the vast majority
have no private members.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201820 91177308-0d34-0410-b5e6-96231b3b80d8
Expand macros in pragmas with -fms-extensions and -E

gcc never expands macros in pragmas and MSVC always expands macros
before processing pragmas.  Clang usually allows macro expansion, except
in a handful of pragmas, most of which are handled by the lexer.

Also remove PPCallbacks for pragmas that are currently handled in the
parser.  Without a Parser, such as with clang -E, these callbacks would
never be called.

Fixes PR18576.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201821 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Enable MSRecordLayout in the presence of external sources."

This reverts commit r201810.

It was failing these tests on my workstation:
    Clang :: CodeGen/override-layout.c
    Clang :: CodeGenCXX/override-layout.cpp
    Clang :: PCH/check-deserializations.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201823 91177308-0d34-0410-b5e6-96231b3b80d8
Sema: Do not assert when dereferencing member pointer using virtual inheritance with an incomplete class type

The MS ABI requires that we determine the vbptr offset if have a
virtual inheritance model.  Instead, raise an error pointing to the
diagnostic when this happens.

This fixes PR18583.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201824 91177308-0d34-0410-b5e6-96231b3b80d8
Revert the removal of PPCallbacks::PragmaComment() in r201821

The pp-trace clang tool was using it successfully.  We can still delete
the callbacks in Frontend/PrintPreprocessedOutput.cpp because they were
effectively dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201825 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fix a bug in IdenticalExprChecker concerning while loops.

Somehow both Daniel and I missed the fact that while loops are only identical
if they have identical bodies.

Patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201829 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an assertion failure when invoking dsymutil.

There is no bound architecture for the dsymutil action in the driver. Trying
to check various properties of the target will cause an assertion failure
because the target doesn't get initialized without a bound architecture.
<rdar://problem/16111555>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201830 91177308-0d34-0410-b5e6-96231b3b80d8
[MS-ABI] Update to zero-sized padding algorithm
Slight change to the way zero-sized sub-objects are tracked in the 
presence of virtual bases.
In addition we correctly distinguish between dsize and nvsize.
addresses http://llvm.org/bugs/show_bug.cgi?id=18826
Unit tests are included.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201832 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Include the vfptr offset in memptrs to virtual methods

Virtual methods expect 'this' to point to the vfptr containing the
virtual method, and this extends to virtual member pointer thunks.  The
relevant vfptr is always at offset zero on entry to the thunk, and no
this adjustment is needed.

Previously we would not include the vfptr adjustment in the member
pointer, and we'd look at the vfptr offset when loading from the vftable
in the thunk.

Fixes PR18917.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201835 91177308-0d34-0410-b5e6-96231b3b80d8
Accept -no-integrated-as in -cc1 and forward it to llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201837 91177308-0d34-0410-b5e6-96231b3b80d8
Fix gcc -Wparentheses warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201840 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Get rid of explicit dependencies to include/clang/*.inc and introduce CLANG_TABLEGEN_TARGETS.

This does;
  - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list.
  - List of targets is added to LLVM_COMMON_DEPENDS.
  - all clang libraries and targets depend on generated headers.

You might wonder this would be regression, but in fact, this is little loss.
  - Almost all of clang libraries depend on tblgen'd files and clang-tblgen.
  - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild.
  - Each library's dependencies to tblgen'd files might vary along headers' structure.
    It made hard to track and update *really optimal* dependencies.

Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201842 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for FPv4-SP to the clang driver

Added two new options for -mfpu when targetting ARM:
* fpv4-sp-d16
* fp4-sp-d16

The first is the same spelling as gcc.

The lack of a leading `v' is correct, this is consistent with ARM's
documentation and gcc's spelling of the option.



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