1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

IR: Stop printing 'metadata' in Metadata::print()

Stop printing `metadata` in `Metadata::print()` and
`Metadata::printAsOperand()`.

llvm-svn: 224327
This commit is contained in:
Duncan P. N. Exon Smith 2014-12-16 07:40:31 +00:00
parent 1fb1f7f9a7
commit 58ed764767
6 changed files with 9 additions and 14 deletions

View File

@ -2567,7 +2567,6 @@ void Value::printAsOperand(raw_ostream &O, bool PrintType, const Module *M) cons
void Metadata::print(raw_ostream &ROS) const {
formatted_raw_ostream OS(ROS);
if (auto *N = dyn_cast<MDNode>(this)) {
OS << "metadata ";
SlotTracker SlotTable(static_cast<Function *>(nullptr));
AssemblyWriter W(OS, SlotTable, nullptr, nullptr);
W.printMDNodeBody(N);
@ -2580,8 +2579,6 @@ void Metadata::print(raw_ostream &ROS) const {
void Metadata::printAsOperand(raw_ostream &ROS, bool PrintType,
const Module *M) const {
formatted_raw_ostream OS(ROS);
if (PrintType)
OS << "metadata ";
std::unique_ptr<TypePrinting> TypePrinter;
if (PrintType) {

View File

@ -8,5 +8,5 @@
!1 = !{!"string1", !"string2"}
; CHECK: assembly parsed, but does not verify as correct!
; CHECK-NEXT: incorrect number of operands in llvm.ident metadata
; CHECK-NEXT: metadata !1
; CHECK-NEXT: !1

View File

@ -7,4 +7,4 @@
!0 = !{!{!"nested metadata"}}
; CHECK: assembly parsed, but does not verify as correct!
; CHECK-NEXT: invalid value for llvm.ident metadata entry operand(the operand should be a string)
; CHECK-NEXT: metadata !1
; CHECK-NEXT: !1

View File

@ -3,10 +3,10 @@
; Check that module flags are structurally correct.
;
; CHECK: incorrect number of operands in module flag
; CHECK: metadata !0
; CHECK: !0
!0 = !{i32 1}
; CHECK: invalid behavior operand in module flag (expected constant integer)
; CHECK: metadata !"foo"
; CHECK: !"foo"
!1 = !{!"foo", !"foo", i32 42}
; CHECK: invalid behavior operand in module flag (unexpected constant)
; CHECK: i32 999
@ -18,7 +18,7 @@
; CHECK: i32 45
!4 = !{i32 3, !"bla", i32 45}
; CHECK: invalid value for 'require' module flag (expected metadata pair)
; CHECK: metadata !
; CHECK: !
!5 = !{i32 3, !"bla", !{i32 46}}
; CHECK: invalid value for 'require' module flag (first value operand should be a string)
; CHECK: i32 47

View File

@ -16,7 +16,6 @@ entry:
}
!1 = !{}
; CHECK: It should have at least one range!
; CHECK-NEXT: metadata
define i8 @f3(i8* %x) {
entry:
@ -148,4 +147,3 @@ entry:
}
!18 = !{}
; CHECK: It should have at least one range!
; CHECK-NEXT: metadata

View File

@ -63,7 +63,7 @@ TEST_F(MDStringTest, PrintingSimple) {
std::string Str;
raw_string_ostream oss(Str);
s->print(oss);
EXPECT_STREQ("metadata !\"testing 1 2 3\"", oss.str().c_str());
EXPECT_STREQ("!\"testing 1 2 3\"", oss.str().c_str());
}
// Test printing of MDString with non-printable characters.
@ -73,7 +73,7 @@ TEST_F(MDStringTest, PrintingComplex) {
std::string Str;
raw_string_ostream oss(Str);
s->print(oss);
EXPECT_STREQ("metadata !\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str());
EXPECT_STREQ("!\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str());
}
typedef MetadataTest MDNodeTest;
@ -182,10 +182,10 @@ TEST_F(MDNodeTest, Print) {
std::string Expected;
{
raw_string_ostream OS(Expected);
OS << "metadata !{";
OS << "!{";
C->printAsOperand(OS);
OS << ", ";
S->printAsOperand(OS, false);
S->printAsOperand(OS);
OS << ", null";
MDNode *Nodes[] = {N0, N1, N2};
for (auto *Node : Nodes)