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
AArch64: refactor table-driven NEON lookup.

This extracts the table-driven intrinsic lookup phase into a separate
function, to be used by EmitCommonNeonBuiltinExpr soon.

It also simplifies the logic used in that lookup, since VectorCastArgN
and ScalarArgN were actually identical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201847 91177308-0d34-0410-b5e6-96231b3b80d8
ARM & AArch64: use table for EmitCommonNeonBuiltinExpr

This extends the intrinsic lookup table format slightly, and adds
entries for use the shared ARM/AArch64 definitions. The benefit is
currently smaller than for the SISD intrinsics (there's more custom
code implementing this set), but a few lines are saved and there's
scope for future expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201848 91177308-0d34-0410-b5e6-96231b3b80d8
Remove commas at the end of lists (C++11 again)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201849 91177308-0d34-0410-b5e6-96231b3b80d8
Moving the documentation for the sanitizer negation attributes into AttrDocs.

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