Fix a couple of bugs, add some new cool stuff.

1. Fix a todo in Parser::ParseTag, to recover better.  On code like
   that in test/Sema/decl-invalid.c it causes us to return a single
   error instead of multiple.
2. Fix an error in Sema::ParseDeclarator, where it would crash if the
   declarator didn't have an identifier.  Instead, diagnose the problem.
3. Start adding infrastructure to track the range of locations covered
   by a declspec or declarator.  This is mostly implemented for declspec,
   but could be improved, it is missing for declarator.

Thanks to Neil for pointing out this crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40482 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/INPUTS/Cocoa_h.m b/INPUTS/Cocoa_h.m
new file mode 100644
index 0000000..e6ba599
--- /dev/null
+++ b/INPUTS/Cocoa_h.m
@@ -0,0 +1,2 @@
+
+#import <Cocoa/Cocoa.h>
diff --git a/INPUTS/carbon_h.c b/INPUTS/carbon_h.c
new file mode 100644
index 0000000..599f123
--- /dev/null
+++ b/INPUTS/carbon_h.c
@@ -0,0 +1,4 @@
+
+#include <Carbon/Carbon.h>
+
+//#import<vecLib/vecLib.h>
diff --git a/INPUTS/iostream.cc b/INPUTS/iostream.cc
new file mode 100644
index 0000000..eb12fc9
--- /dev/null
+++ b/INPUTS/iostream.cc
@@ -0,0 +1,5 @@
+// clang -I/usr/include/c++/4.0.0 -I/usr/include/c++/4.0.0/powerpc-apple-darwin8 -I/usr/include/c++/4.0.0/backward INPUTS/iostream.cc -Eonly
+
+#include <iostream>
+
+#include <stdint.h>
diff --git a/INPUTS/macro_pounder_fn.c b/INPUTS/macro_pounder_fn.c
new file mode 100644
index 0000000..73f40a1
--- /dev/null
+++ b/INPUTS/macro_pounder_fn.c
@@ -0,0 +1,17 @@
+
+// This pounds on macro expansion for performance reasons.  This is currently
+// heavily constrained by darwin's malloc.
+
+// Function-like macros.
+#define A0(A, B) A B
+#define A1(A, B) A0(A,B) A0(A,B) A0(A,B) A0(A,B) A0(A,B) A0(A,B)
+#define A2(A, B) A1(A,B) A1(A,B) A1(A,B) A1(A,B) A1(A,B) A1(A,B)
+#define A3(A, B) A2(A,B) A2(A,B) A2(A,B) A2(A,B) A2(A,B) A2(A,B)
+#define A4(A, B) A3(A,B) A3(A,B) A3(A,B) A3(A,B) A3(A,B) A3(A,B)
+#define A5(A, B) A4(A,B) A4(A,B) A4(A,B) A4(A,B) A4(A,B) A4(A,B)
+#define A6(A, B) A5(A,B) A5(A,B) A5(A,B) A5(A,B) A5(A,B) A5(A,B)
+#define A7(A, B) A6(A,B) A6(A,B) A6(A,B) A6(A,B) A6(A,B) A6(A,B)
+#define A8(A, B) A7(A,B) A7(A,B) A7(A,B) A7(A,B) A7(A,B) A7(A,B)
+
+A8(a, b)
+
diff --git a/INPUTS/macro_pounder_obj.c b/INPUTS/macro_pounder_obj.c
new file mode 100644
index 0000000..d2465f3
--- /dev/null
+++ b/INPUTS/macro_pounder_obj.c
@@ -0,0 +1,16 @@
+
+// This pounds on macro expansion for performance reasons.  This is currently
+// heavily constrained by darwin's malloc.
+
+// Object-like expansions
+#define A0 a b
+#define A1 A0 A0 A0 A0 A0 A0
+#define A2 A1 A1 A1 A1 A1 A1
+#define A3 A2 A2 A2 A2 A2 A2
+#define A4 A3 A3 A3 A3 A3 A3
+#define A5 A4 A4 A4 A4 A4 A4
+#define A6 A5 A5 A5 A5 A5 A5
+#define A7 A6 A6 A6 A6 A6 A6
+#define A8 A7 A7 A7 A7 A7 A7
+
+A8
diff --git a/INPUTS/stpcpy-test.c b/INPUTS/stpcpy-test.c
new file mode 100644
index 0000000..b96a806
--- /dev/null
+++ b/INPUTS/stpcpy-test.c
@@ -0,0 +1,47 @@
+#define __extension__
+
+#define __stpcpy(dest, src) (__extension__ (__builtin_constant_p (src) ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 ? __stpcpy_small (dest, __stpcpy_args (src), strlen (src) + 1) : ((char *) __mempcpy (dest, src, strlen (src) + 1) - 1)) : __stpcpy (dest, src)))
+#define stpcpy(dest, src) __stpcpy (dest, src)
+#define __stpcpy_args(src) __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4)
+
+#define __mempcpy(dest, src, n) (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) && __string2_1bptr_p (src) && n <= 8 ? __mempcpy_small (dest, __mempcpy_args (src), n) : __mempcpy (dest, src, n)))
+#define mempcpy(dest, src, n) __mempcpy (dest, src, n)
+#define __mempcpy_args(src) ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], ((char *) (src))[6], __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4)
+
+#define __STRING2_SMALL_GET16(src, idx) (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8 | ((__const unsigned char *) (__const char *) (src))[idx])
+
+#define __STRING2_SMALL_GET32(src, idx) (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx])
+
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)