clang-cl: Implement the -arch flag

Summary:
This implements the -arch flag for both x86 and x86-64 by letting
them affect the default target features we pass to cc1.  -m machine
flags will override the features set by -arch.

Reviewers: hansw

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213083 91177308-0d34-0410-b5e6-96231b3b80d8
Added the pack_elements range accessor. Refactoring some for loops to use range-based for loops instead. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213095 91177308-0d34-0410-b5e6-96231b3b80d8
Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213097 91177308-0d34-0410-b5e6-96231b3b80d8
Switching some iterator-based for loops to use range-based for loops. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213098 91177308-0d34-0410-b5e6-96231b3b80d8
Use the integrated assembler by default on OpenBSD/sparc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213105 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid referencing the vtable when calling the ctor without emitting it

This fixes compilation errors about incomplete types used with WebKit's
RefPtr template.  Simply calling an out of line constructor should not
instantiate all inline and defaulted virtual methods.

Tested by building and testing several big piles of code on Linux.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213109 91177308-0d34-0410-b5e6-96231b3b80d8
Handle diagnostic warnings in Frontend diagnostic handler.

Clang uses a diagnostic handler to grab diagnostic messages so it can print them
with the line of source code they refer to. This patch extends this to handle
diagnostic warnings that were added to llvm to produce a warning when
loop vectorization is explicitly specified (using a pragma clang loop directive)
but fails.

Reviewed by: Aaron Ballman


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213112 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for wildcard expansion on Windows

This depends on LLVM r213114

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213115 91177308-0d34-0410-b5e6-96231b3b80d8
Driver: bifurcate extended and basic MSC versioning

This restores the original behaviour of -fmsc-version. The older option
remains as a mechanism for specifying the basic version information. A
secondary option, -fms-compatibility-version permits the user to specify an
extended version to the driver.

The new version takes the value as a dot-separated value rather than the
major * 100 + minor format that -fmsc-version format. This makes it easier to
specify the value as well as a more flexible manner for specifying the value.

Specifying both values is considered an error.

The older parameter is left solely as a driver option, which is normalised into
the newer parameter. This allows us to retain a single code path in the
compiler itself whilst preserving the semantics of the old parameter as well as
avoid having to determine which of two formats are being used by the invocation.

The test changes are due to the fact that the compiler no longer supports the
old option, and is a direct conversion to the new option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213119 91177308-0d34-0410-b5e6-96231b3b80d8
Improve error recovery around colon.

Recognize additional cases, when '::' is mistyped as ':'.
This is a fix to RP18587 - colons have too much protection in member-declarations
Review is tracked by http://reviews.llvm.org/D3653.

This is an attempt to recommit the fix, initially committed as r212957 but then
reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator
turns on colon protection in for context as well.


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

No functionality changed, just some cleanups:
- Switch some loops to range-based for.
- Name some iterators with a more creative name than "I".
- Reduce dependence on auto. Does RD->bases() give you a list of
  CXXBaseSpecifiers or CXXRecordDecls? It's more clear to just say which
  upfront.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213121 91177308-0d34-0410-b5e6-96231b3b80d8
AST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilder

No functionality changed, it just makes the code a little less brittle.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213122 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Up the required alignment after inserting padding between vbases

We would correctly insert sufficiently aligned padding between vbases
when our leading base was empty, however we would neglect to increase
the required alignment of the most derived class.

This fixes PR20315.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213123 91177308-0d34-0410-b5e6-96231b3b80d8
Don't add -Bsymbolic by default on Android.

-Bsymbolic is not a platform requirement and should not
be added unconditionally.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213126 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Add support for -mfpxx and -mno-fpxx.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213132 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Correct the invocation of GAS in several cases.

Summary:
As a result of this patch, assembling an empty file with GCC and Clang (using
GAS as the assembler) now produces identical objects.

-mfp32/-mfpxx/-mfp64 now form a trinity of options. -mfpxx is the default
when the triple vendor is 'img' or 'mti', the ABI is O32, and the CPU is
between mips2 and mips32r2/mips64r2 (inclusive).

-mno-shared is always given to the assembler to match the effect of
-mabicalls (currently unimplemented but Clang acts as if it is given).
Similarly, -call_nonpic is always given to match the effect of -mplt (also
unimplemented and acts as if given) except when the ABI is 64 in which case
-mplt has no effect so -KPIC is given instead.

-mhard-float/-msoft-float are now passed on.

-modd-spreg/-mno-odd-spreg are now passed on.

-mno-mips16 is correctly passed on. The assembler option is -no-mips16 not
-mno-mips16

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213138 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213139 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test: Introduce the feature "staticanalyzer" for --enable-clang-static-analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213140 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.
Use the tools::mips::isNaN2008() routine instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213141 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver][Mips] Remove flags which is not used in multi-library selection.

No functional changes.

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