[PATCH] Make -fdump-vtable-layouts print to stdout, not stderr
Reid Kleckner
rnk at google.com
Fri Nov 8 11:46:54 PST 2013
Hi timurrrr, whunt,
This makes it consistent with -fdump-record-layouts. My reasoning for
going with stdout is that when one of these options is present, the
layouts are really a program output, and shouldn't be interleaved with
diagnostics, which are on stderr.
http://llvm-reviews.chandlerc.com/D2127
Files:
lib/AST/VTableBuilder.cpp
test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
test/CodeGenCXX/vtable-layout.cpp
Index: lib/AST/VTableBuilder.cpp
===================================================================
--- lib/AST/VTableBuilder.cpp
+++ lib/AST/VTableBuilder.cpp
@@ -997,7 +997,7 @@
LayoutVTable();
if (Context.getLangOpts().DumpVTableLayouts)
- dumpLayout(llvm::errs());
+ dumpLayout(llvm::outs());
}
uint64_t getNumThunks() const {
@@ -2593,7 +2593,7 @@
LayoutVFTable();
if (Context.getLangOpts().DumpVTableLayouts)
- dumpLayout(llvm::errs());
+ dumpLayout(llvm::outs());
}
uint64_t getNumThunks() const { return Thunks.size(); }
@@ -3229,7 +3229,7 @@
MethodVFTableLocations.insert(NewMethodLocations.begin(),
NewMethodLocations.end());
if (Context.getLangOpts().DumpVTableLayouts)
- dumpMethodLocations(RD, NewMethodLocations, llvm::errs());
+ dumpMethodLocations(RD, NewMethodLocations, llvm::outs());
}
void MicrosoftVTableContext::dumpMethodLocations(
Index: test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
===================================================================
--- test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
+++ test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o - >%t 2>&1
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
// RUN: FileCheck --check-prefix=NO-THUNKS-Test1 %s < %t
// RUN: FileCheck --check-prefix=NO-THUNKS-Test2 %s < %t
@@ -24,7 +24,7 @@
// RUN: FileCheck --check-prefix=RET-THUNKS-Test5 %s < %t
// RUN: FileCheck --check-prefix=RET-THUNKS-Test6 %s < %t
-// RUN: FileCheck --check-prefix=MANGLING %s < %t
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
struct Empty {
// Doesn't have a vftable!
Index: test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
===================================================================
--- test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
+++ test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o - > %t 2>&1
-// RUN: FileCheck --check-prefix=EMITS-VFTABLE %s < %t
-// RUN: FileCheck --check-prefix=NO-VFTABLE %s < %t
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o %t.ll > %t
+// RUN: FileCheck --check-prefix=EMITS-VFTABLE %s < %t.ll
+// RUN: FileCheck --check-prefix=NO-VFTABLE %s < %t.ll
// RUN: FileCheck --check-prefix=CHECK-A %s < %t
// RUN: FileCheck --check-prefix=CHECK-B %s < %t
// RUN: FileCheck --check-prefix=CHECK-C %s < %t
Index: test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
===================================================================
--- test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
+++ test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -fdump-vtable-layouts %s -o - -cxx-abi microsoft -triple=i386-pc-win32 >%t 2>&1
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -cxx-abi microsoft -triple=i386-pc-win32 >%t
// RUN: FileCheck --check-prefix=VTABLE-C %s < %t
// RUN: FileCheck --check-prefix=VTABLE-D %s < %t
@@ -24,7 +24,7 @@
// RUN: FileCheck --check-prefix=RET-T %s < %t
// RUN: FileCheck --check-prefix=RET-V %s < %t
-// RUN: FileCheck --check-prefix=MANGLING %s < %t
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
struct Empty { };
Index: test/CodeGenCXX/vtable-layout.cpp
===================================================================
--- test/CodeGenCXX/vtable-layout.cpp
+++ test/CodeGenCXX/vtable-layout.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts > %t 2>&1
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts > %t
// RUN: FileCheck --check-prefix=CHECK-1 %s < %t
// RUN: FileCheck --check-prefix=CHECK-2 %s < %t
// RUN: FileCheck --check-prefix=CHECK-3 %s < %t
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2127.1.patch
Type: text/x-patch
Size: 4258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131108/e3aef384/attachment.bin>
More information about the cfe-commits
mailing list