Factor out parsing and allocation of IdentifierLoc objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189833 91177308-0d34-0410-b5e6-96231b3b80d8
Update GCC attribute argument parsing comment to better reflect what's going on
here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189838 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: Update testcases for improved codegen.

From llvm r189841.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189842 91177308-0d34-0410-b5e6-96231b3b80d8
Consumed analysis: add return_typestate attribute.
Patch by chris.wailes@gmail.com

Functions can now declare what state the consumable type the are returning will
be in. This is then used on the caller side and checked on the callee side.
Constructors now use this attribute instead of the 'consumes' attribute.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189844 91177308-0d34-0410-b5e6-96231b3b80d8
Fix non-void return warning, and format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189845 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor computation of whether a variable declaration's type should be merged
with a prior declaration. No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189850 91177308-0d34-0410-b5e6-96231b3b80d8
Switched FormatAttr to using an IdentifierArgument instead of a StringArgument since that is a more accurate modeling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189851 91177308-0d34-0410-b5e6-96231b3b80d8
Don't emit an available_externally vtable pointing to linkonce_odr funcs.

This fixes pr13124.

From the discussion at
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022606.html
we know that we cannot make funcions in a weak_odr vtable also weak_odr. They
should remain linkonce_odr.

The side effect is that we cannot emit a available_externally vtable unless we
also emit a copy of the function. This also has an issue: If codegen is going
to output a function, sema has to mark it used. Given llvm.org/pr9114, it looks
like sema cannot be more aggressive at marking functions used because
of vtables.

This leaves us with a few unpleasant options:

* Marking functions in vtables used if possible. This sounds a bit sloppy, so
  we should avoid it.
* Producing available_externally vtables only when all the functions in it are
  already used or weak_odr. This would cover cases like

--------------------
struct foo {
  virtual ~foo();
};
struct bar : public foo {
  virtual void zed();
};
void f() {
  foo *x(new bar);
  delete x;
}
void g(bar *x) {
  x->~bar(); // force the destructor to be used
}
--------------------------

and

----------------------------------
template<typename T>
struct bar {
  virtual ~bar();
};
template<typename T>
bar<T>::~bar() {
}

// make the destructor weak_odr instead of linkonce_odr
extern template class bar<int>;

void f() {
  bar<int> *x(new bar<int>);
  delete x;
}
----------------------------

These look like corner cases, so it is unclear if it is worth it.

* And finally: Just nuke this optimization. That is what this patch implements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189852 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify. This function bails out a few lines above if !Found.empty().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189857 91177308-0d34-0410-b5e6-96231b3b80d8
Reference extension is weird/surprising and unnecessary, let's not do that.

Found by Chris Wailes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189859 91177308-0d34-0410-b5e6-96231b3b80d8
Emit uuid globals as linkonce_odr

Patch by Nico Rieck!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189860 91177308-0d34-0410-b5e6-96231b3b80d8
Consumed analysis: update to comments in test cases.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189866 91177308-0d34-0410-b5e6-96231b3b80d8
Parser: support Microsoft syntax for 'typename typedef'

Summary:
Transform the token sequence for:
typename typedef T U;

to:
typename T typedef U;

Raise a diagnostic when this happens but only if we succeeded handling
the typename.

Reviewers: rsmith, rnk

Reviewed By: rsmith

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189867 91177308-0d34-0410-b5e6-96231b3b80d8
Don't run optimizations in a clang test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189880 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Make -W a core option so we can adjust clang warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189882 91177308-0d34-0410-b5e6-96231b3b80d8
Use -O0 in this test too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189884 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the test on -Asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189888 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC migrator: Cannot use bridging annotations for
ObjectiveC methods. Apply specific annotations for them
instead as determined by the static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189892 91177308-0d34-0410-b5e6-96231b3b80d8
Add a diagnostic group for the "ignoring (static|inline) keyword on
explicit template instantiation" warning.

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