Add R600 builtin codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211631 91177308-0d34-0410-b5e6-96231b3b80d8
Forgot to add file in r211631

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211632 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test issues from r211623 and remove test-only API

1) missing iterator bits needed by libstdc++4.7
Using find_if was convenient, but since operator++ wasn't a good
interface anyway, I just replaced with a range-based for loop and
removed operator++ from the directory_iterator class.

2) stop relying on order of iterating real files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211633 91177308-0d34-0410-b5e6-96231b3b80d8
Provide a better diagnostic when braces are put before the identifier.

When a user types:
  int [4] foo;
assume that the user means:
  int foo[4];

Update the information for 'foo' to prevent additional errors, and provide
a fix-it hint to move the brackets to the correct location.

Additionally, suggest parens for types that require it, such as:
  int [4] *foo;
to:
  int (*foo)[4];


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211641 91177308-0d34-0410-b5e6-96231b3b80d8
Merge handleDLLImportAttr and handleDLLExportAttr into one function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211647 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Ignore dll attributes on partial template specializations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211648 91177308-0d34-0410-b5e6-96231b3b80d8
Split tests for __if_exists out into their own file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211649 91177308-0d34-0410-b5e6-96231b3b80d8
Add a missing test for the __if_exists extension

MSVC does not create a new scope for the body of an __if_exists compound
statement.  Clang already gets this right today, but it was untested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211650 91177308-0d34-0410-b5e6-96231b3b80d8
Fix parsing nested __if_exists blocks

Rather than having kw___if_exists be a special case of
ParseCompoundStatementBody, we can look for kw___if_exists in the big
switch over for valid statement tokens in ParseStatementOrDeclaration.

Nested __if_exists blocks are used in the DECLARE_REGISTRY_RESOURCEID
macro from atlcom.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211654 91177308-0d34-0410-b5e6-96231b3b80d8
Implement predefined stdint macros

Add predefined stdint macros that match the given patterns:

U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE}
U?INT{PTR,MAX}_{MAX,TYPE}

http://reviews.llvm.org/D4141

Author: binji

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211657 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] Improved code and replaced struct by lambda.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211661 91177308-0d34-0410-b5e6-96231b3b80d8
VirtualFileSystemTest.cpp: Get rid of initializer list on std::vector, to appease msc17.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211662 91177308-0d34-0410-b5e6-96231b3b80d8
Tools.cpp: Update getLinuxDynamicLinker() to return Twine instead of StringRef, since r211598 has introduced manipulation of return string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211663 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver] Follow-up to r211598, r211663. Do not build a dynamic linker
path using sub-strings concatenation. Return the whole string explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211665 91177308-0d34-0410-b5e6-96231b3b80d8
Don't go through the TypeSourceInfo when getting the SourceRange.

VarDecl provides a method getSourceRange(), which provides a more
robust way of getting the SourceRange since the TypeSourceInfo can
be null in certain cases.

Reviewed by: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211667 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] OMPSimdDirective and OMPForDirective: added initialization for CollapsedNum member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211672 91177308-0d34-0410-b5e6-96231b3b80d8
Added a test to ensure -Wimplicit-fallthrough works with -fblocks correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211676 91177308-0d34-0410-b5e6-96231b3b80d8
AST: Initialization with dllimport functions in C

The C++ language requires that the address of a function be the same
across all translation units.  To make __declspec(dllimport) useful,
this means that a dllimported function must also obey this rule.  MSVC
implements this by dynamically querying the import address table located
in the linked executable.  This means that the address of such a
function in C++ is not constant (which violates other rules).

However, the C language has no notion of ODR nor does it permit dynamic
initialization whatsoever.  This requires implementations to _not_
dynamically query the import address table and instead utilize a wrapper
function that will be synthesized by the linker which will eventually
query the import address table.  The effect this has is, to say the
least, perplexing.

Consider the following C program:
__declspec(dllimport) void f(void);

typedef void (*fp)(void);

static const fp var = &f;

const fp fun() { return &f; }

int main() { return fun() == var; }

MSVC will statically initialize "var" with the address of the wrapper
function and "fun" returns the address of the actual imported function.
This means that "main" will return false!

Note that LLVM's optimizers are strong enough to figure out that "main"
should return true.  However, this result is dependent on having
optimizations enabled!

N.B.  This change also permits the usage of dllimport declarators inside
of template arguments; they are sufficiently constant for such a
purpose.  Add tests to make sure we don't regress here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211677 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] Initial support for 'sections' directive.


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