[llvm] r224327 - IR: Stop printing 'metadata' in Metadata::print()

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Dec 15 23:40:32 PST 2014


Author: dexonsmith
Date: Tue Dec 16 01:40:31 2014
New Revision: 224327

URL: http://llvm.org/viewvc/llvm-project?rev=224327&view=rev
Log:
IR: Stop printing 'metadata' in Metadata::print()

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

Modified:
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/test/Verifier/ident-meta1.ll
    llvm/trunk/test/Verifier/ident-meta3.ll
    llvm/trunk/test/Verifier/module-flags-1.ll
    llvm/trunk/test/Verifier/range-1.ll
    llvm/trunk/unittests/IR/MetadataTest.cpp

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Tue Dec 16 01:40:31 2014
@@ -2567,7 +2567,6 @@ void Value::printAsOperand(raw_ostream &
 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) c
 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) {

Modified: llvm/trunk/test/Verifier/ident-meta1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/ident-meta1.ll?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/test/Verifier/ident-meta1.ll (original)
+++ llvm/trunk/test/Verifier/ident-meta1.ll Tue Dec 16 01:40:31 2014
@@ -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
 

Modified: llvm/trunk/test/Verifier/ident-meta3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/ident-meta3.ll?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/test/Verifier/ident-meta3.ll (original)
+++ llvm/trunk/test/Verifier/ident-meta3.ll Tue Dec 16 01:40:31 2014
@@ -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

Modified: llvm/trunk/test/Verifier/module-flags-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/module-flags-1.ll?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/test/Verifier/module-flags-1.ll (original)
+++ llvm/trunk/test/Verifier/module-flags-1.ll Tue Dec 16 01:40:31 2014
@@ -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

Modified: llvm/trunk/test/Verifier/range-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/range-1.ll?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/test/Verifier/range-1.ll (original)
+++ llvm/trunk/test/Verifier/range-1.ll Tue Dec 16 01:40:31 2014
@@ -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

Modified: llvm/trunk/unittests/IR/MetadataTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/MetadataTest.cpp?rev=224327&r1=224326&r2=224327&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/MetadataTest.cpp (original)
+++ llvm/trunk/unittests/IR/MetadataTest.cpp Tue Dec 16 01:40:31 2014
@@ -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)





More information about the llvm-commits mailing list