aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-10-19 21:14:46 +0000
committerAndrew Trick <atrick@apple.com>2010-10-19 21:14:46 +0000
commit7cffb55ef5845f86b41b83c332e4b453ee4dcb16 (patch)
treea023116ef317997a60fcb84db3c3df7c750fcb24
parentda7700e8180a3959a9f07debe3dbc358a5ea0639 (diff)
Reverting 116836,116837,116838 until we resolve the getLangStandardForKind failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116859 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/Decl.cpp2
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp2
-rw-r--r--test/PCH/Inputs/chain-cxx1.h19
-rw-r--r--test/PCH/Inputs/chain-cxx2.h32
-rw-r--r--test/PCH/chain-cxx.cpp73
5 files changed, 55 insertions, 73 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 4898d6f2fc..e822009c58 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1580,8 +1580,6 @@ void TagDecl::completeDefinition() {
TagDecl* TagDecl::getDefinition() const {
if (isDefinition())
return const_cast<TagDecl *>(this);
- if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(this))
- return CXXRD->getDefinition();
for (redecl_iterator R = redecls_begin(), REnd = redecls_end();
R != REnd; ++R)
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 6bf5598c93..24ac8f4417 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -1116,13 +1116,13 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
Abv->Add(BitCodeAbbrevOp(serialization::PREDEF_TYPE_NULL_ID)); // InfoType
// VarDecl
- Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
Abv->Add(BitCodeAbbrevOp(0)); // StorageClass
Abv->Add(BitCodeAbbrevOp(0)); // StorageClassAsWritten
Abv->Add(BitCodeAbbrevOp(0)); // isThreadSpecified
Abv->Add(BitCodeAbbrevOp(0)); // hasCXXDirectInitializer
Abv->Add(BitCodeAbbrevOp(0)); // isExceptionVariable
Abv->Add(BitCodeAbbrevOp(0)); // isNRVOVariable
+ Abv->Add(BitCodeAbbrevOp(0)); // PrevDecl
Abv->Add(BitCodeAbbrevOp(0)); // HasInit
Abv->Add(BitCodeAbbrevOp(0)); // HasMemberSpecializationInfo
// ParmVarDecl
diff --git a/test/PCH/Inputs/chain-cxx1.h b/test/PCH/Inputs/chain-cxx1.h
new file mode 100644
index 0000000000..7ea3ffb61c
--- /dev/null
+++ b/test/PCH/Inputs/chain-cxx1.h
@@ -0,0 +1,19 @@
+// Primary header for C++ chained PCH test
+
+void f();
+
+// Name not appearing in dependent
+void pf();
+
+namespace ns {
+ void g();
+
+ void pg();
+}
+
+template <typename T>
+struct S { typedef int G; };
+
+// Partially specialize
+template <typename T>
+struct S<T *> { typedef int H; };
diff --git a/test/PCH/Inputs/chain-cxx2.h b/test/PCH/Inputs/chain-cxx2.h
new file mode 100644
index 0000000000..adc10fd836
--- /dev/null
+++ b/test/PCH/Inputs/chain-cxx2.h
@@ -0,0 +1,32 @@
+// Dependent header for C++ chained PCH test
+
+// Overload function from primary
+void f(int);
+
+// Add function with different name
+void f2();
+
+// Reopen namespace
+namespace ns {
+ // Overload function from primary
+ void g(int);
+
+ // Add different name
+ void g2();
+}
+
+// Specialize template from primary
+template <>
+struct S<int> { typedef int I; };
+
+// Partially specialize
+template <typename T>
+struct S<T &> { typedef int J; };
+
+// Specialize previous partial specialization
+template <>
+struct S<int *> { typedef int K; };
+
+// Specialize the partial specialization from this file
+template <>
+struct S<int &> { typedef int L; };
diff --git a/test/PCH/chain-cxx.cpp b/test/PCH/chain-cxx.cpp
index b2d0523410..3e46214c70 100644
--- a/test/PCH/chain-cxx.cpp
+++ b/test/PCH/chain-cxx.cpp
@@ -1,77 +1,13 @@
// Test C++ chained PCH functionality
// Without PCH
-// RUN: %clang_cc1 -fsyntax-only -verify -include %s -include %s %s
+// RUN: %clang_cc1 -fsyntax-only -verify -include %S/Inputs/chain-cxx1.h -include %S/Inputs/chain-cxx2.h %s
// With PCH
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t1 %s
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t2 %s -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -x c++ -emit-pch -o %t1 %S/Inputs/chain-cxx1.h
+// RUN: %clang_cc1 -x c++ -emit-pch -o %t2 %S/Inputs/chain-cxx2.h -include-pch %t1 -chained-pch
// RUN: %clang_cc1 -fsyntax-only -verify -include-pch %t2 %s
-#ifndef HEADER1
-#define HEADER1
-//===----------------------------------------------------------------------===//
-// Primary header for C++ chained PCH test
-
-void f();
-
-// Name not appearing in dependent
-void pf();
-
-namespace ns {
- void g();
-
- void pg();
-}
-
-template <typename T>
-struct S { typedef int G; };
-
-// Partially specialize
-template <typename T>
-struct S<T *> { typedef int H; };
-
-//===----------------------------------------------------------------------===//
-#elif not defined(HEADER2)
-#define HEADER2
-//===----------------------------------------------------------------------===//
-// Dependent header for C++ chained PCH test
-
-// Overload function from primary
-void f(int);
-
-// Add function with different name
-void f2();
-
-// Reopen namespace
-namespace ns {
- // Overload function from primary
- void g(int);
-
- // Add different name
- void g2();
-}
-
-// Specialize template from primary
-template <>
-struct S<int> { typedef int I; };
-
-// Partially specialize
-template <typename T>
-struct S<T &> { typedef int J; };
-
-// Specialize previous partial specialization
-template <>
-struct S<int *> { typedef int K; };
-
-// Specialize the partial specialization from this file
-template <>
-struct S<int &> { typedef int L; };
-
-//===----------------------------------------------------------------------===//
-#else
-//===----------------------------------------------------------------------===//
-
void test() {
f();
f(1);
@@ -90,6 +26,3 @@ void test() {
typedef S<int *>::K T5;
typedef S<int &>::L T6;
}
-
-//===----------------------------------------------------------------------===//
-#endif