[llvm-branch-commits] [llvm-gcc-branch] r134034 - in /llvm-gcc-4.2/branches/Apple/Morbo/gcc: c-pch.c llvm-backend.cpp llvm.h testsuite/g++.dg/pch/template-2.C testsuite/g++.dg/pch/template-2.Hs
Devang Patel
dpatel at apple.com
Tue Jun 28 15:23:57 PDT 2011
Author: dpatel
Date: Tue Jun 28 17:23:57 2011
New Revision: 134034
URL: http://llvm.org/viewvc/llvm-project?rev=134034&view=rev
Log:
Merge r133482 from mainline.
Added:
llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.C
llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.Hs
Modified:
llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-pch.c
llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp
llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm.h
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-pch.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-pch.c?rev=134034&r1=134033&r2=134034&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-pch.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/c-pch.c Tue Jun 28 17:23:57 2011
@@ -446,6 +446,12 @@
been loaded. */
if (lang_post_pch_load)
(*lang_post_pch_load) ();
+ /* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+ llvm_post_pch_read();
+#endif
+ /* LLVM LOCAL end */
+
}
/* Indicate that no more PCH files should be read. */
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp?rev=134034&r1=134033&r2=134034&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp Tue Jun 28 17:23:57 2011
@@ -601,6 +601,11 @@
flag_llvm_pch_read = 1;
}
+// Initialize remainign llvm specific data structures after pch is loaded.
+void llvm_post_pch_read() {
+ readLLVMTypeUsers();
+}
+
/// llvm_pch_write_init - Initialize PCH writing.
void llvm_pch_write_init(void) {
timevar_push(TV_LLVM_INIT);
@@ -1046,17 +1051,6 @@
return; // Do not process broken code.
}
- // Initial fill of TypeRefinementDatabase::TypeUsers[] if we're
- // using a PCH. Won't work until the GCC PCH has been read in and
- // digested.
- {
- static bool done = false;
- if (!done && flag_llvm_pch_read) {
- readLLVMTypeUsers();
- done = true;
- }
- }
-
timevar_push(TV_LLVM_FUNCS);
// Convert the AST to raw/ugly LLVM code.
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm.h?rev=134034&r1=134033&r2=134034&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm.h (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm.h Tue Jun 28 17:23:57 2011
@@ -103,6 +103,9 @@
/* Read bytecodes from PCH file. */
void llvm_pch_read(const unsigned char *, unsigned);
+/* Initialize remainign llvm specific data structures after pch is loaded. */
+void llvm_post_pch_read(void);
+
/* llvm_asm_file_start - Start the .s file. */
void llvm_asm_file_start(void);
Added: llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g%2B%2B.dg/pch/template-2.C?rev=134034&view=auto
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.C (added)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.C Tue Jun 28 17:23:57 2011
@@ -0,0 +1,2 @@
+/* { dg-options "-m32 -I." } */
+#include "template-2.H"
Added: llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.Hs
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g%2B%2B.dg/pch/template-2.Hs?rev=134034&view=auto
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.Hs (added)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/g++.dg/pch/template-2.Hs Tue Jun 28 17:23:57 2011
@@ -0,0 +1,34 @@
+/* { dg-options "-m32 -I." } */
+
+
+namespace ATL
+{
+
+typedef struct
+{
+unsigned int size;
+} my_module;
+
+class CAM1;
+__attribute__((weak)) CAM1* _p1 = __null;
+class CAM1 : public my_module
+{
+};
+
+template <class T>
+class CAM1T : public CAM1
+{
+public :
+ CAM1T() throw() {}
+};
+
+class CAM2;
+__attribute__((weak)) CAM2* _pModule = __null;
+class CAM2 : public CAM1T<CAM2>
+{
+public :
+ CAM2() {}
+};
+
+}
+
More information about the llvm-branch-commits
mailing list