[MSExtensions] Add support for __forceinline.

__forceinline is a combination of the inline keyword and __attribute__((always_inline))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158653 91177308-0d34-0410-b5e6-96231b3b80d8
Handle C++11 attribute namespaces automatically.

Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158661 91177308-0d34-0410-b5e6-96231b3b80d8
alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the function allocates x^2 bytes. GCC also accepts this syntax

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158662 91177308-0d34-0410-b5e6-96231b3b80d8
fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158663 91177308-0d34-0410-b5e6-96231b3b80d8
[VS Toolchain] Correctly forward -l linker inputs to link.exe.

Patch by Nikola Smiljanic!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158664 91177308-0d34-0410-b5e6-96231b3b80d8
document _has_feature(objc_default_synthesize_properties).
// rdar://11676972


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158665 91177308-0d34-0410-b5e6-96231b3b80d8
Allow internal decls in inline functions if the function is in the main file.

This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158666 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation cleanup:
* Escaped "::" where needed to prevent Doxygen trying to make links;
* Updated one mention of C++0x to refer to C++11;
* Fixed a \brief summary to make it somewhat concise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158667 91177308-0d34-0410-b5e6-96231b3b80d8
Move a few static functions from DiagnosticRenderer.cpp into SourceManager.

This simplifies the code a little bit, since these functions all took a
SourceManager parameter and called a bunch of methods on it, and makes
the functions available to other users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158676 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add a comment: why we treat array compound literals as lvalues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158681 91177308-0d34-0410-b5e6-96231b3b80d8
Add new tool 'diag-build' for showing enabled warnings in a project.

diag-build acts as a wrapper for 'diagtool show-enabled', in the same way
that scan-build acts as a wrapper for the static analyzer. The common case is
simple: use 'diag-build make' or 'diag-build xcodebuild' to list the warnings
enabled for the first compilation command we see. Other build systems require
you to manually specify "dry-run" and "use $CC and $CXX"; if there is a build
system you are interested in, please add it to the switch statement.

diag-build is fairly stupid right now, but it serves its basic purpose.
Hopefully it can grow to meet any additional requirements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158682 91177308-0d34-0410-b5e6-96231b3b80d8
Support -Winternal-linkage-in-inline in C++ code.

This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158683 91177308-0d34-0410-b5e6-96231b3b80d8
Add language std for OpenCL 1.1 and 1.2.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158686 91177308-0d34-0410-b5e6-96231b3b80d8
XFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158687 91177308-0d34-0410-b5e6-96231b3b80d8
Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.

Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).

This removes the warning entirely from uses in the main source file in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158689 91177308-0d34-0410-b5e6-96231b3b80d8
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer.  These are essentially part of
the Objective-C language.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158690 91177308-0d34-0410-b5e6-96231b3b80d8
Improve the error message when a function overload candidate is rejected
because it expects a reference and receives a non-l-value.

For example, given:

  int foo(int &);
  template<int x> void b() { foo(x); }

clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158691 91177308-0d34-0410-b5e6-96231b3b80d8
Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158694 91177308-0d34-0410-b5e6-96231b3b80d8
[objcmt] When checking whether the subscripting methods are declared use
ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well
and update related tests.

rdar://11695288

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158697 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the location of the fixit for -Wnewline-eof.

It turns out SourceManager treating the "one-past-the-end" location as invalid,
but then failing to set the invalid flag properly.

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