mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	IR: Stop printing 'metadata' in Metadata::print()
Stop printing `metadata` in `Metadata::print()` and `Metadata::printAsOperand()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224327 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -2567,7 +2567,6 @@ void Value::printAsOperand(raw_ostream &O, bool PrintType, const Module *M) cons
 | 
				
			|||||||
void Metadata::print(raw_ostream &ROS) const {
 | 
					void Metadata::print(raw_ostream &ROS) const {
 | 
				
			||||||
  formatted_raw_ostream OS(ROS);
 | 
					  formatted_raw_ostream OS(ROS);
 | 
				
			||||||
  if (auto *N = dyn_cast<MDNode>(this)) {
 | 
					  if (auto *N = dyn_cast<MDNode>(this)) {
 | 
				
			||||||
    OS << "metadata ";
 | 
					 | 
				
			||||||
    SlotTracker SlotTable(static_cast<Function *>(nullptr));
 | 
					    SlotTracker SlotTable(static_cast<Function *>(nullptr));
 | 
				
			||||||
    AssemblyWriter W(OS, SlotTable, nullptr, nullptr);
 | 
					    AssemblyWriter W(OS, SlotTable, nullptr, nullptr);
 | 
				
			||||||
    W.printMDNodeBody(N);
 | 
					    W.printMDNodeBody(N);
 | 
				
			||||||
@@ -2580,8 +2579,6 @@ void Metadata::print(raw_ostream &ROS) const {
 | 
				
			|||||||
void Metadata::printAsOperand(raw_ostream &ROS, bool PrintType,
 | 
					void Metadata::printAsOperand(raw_ostream &ROS, bool PrintType,
 | 
				
			||||||
                              const Module *M) const {
 | 
					                              const Module *M) const {
 | 
				
			||||||
  formatted_raw_ostream OS(ROS);
 | 
					  formatted_raw_ostream OS(ROS);
 | 
				
			||||||
  if (PrintType)
 | 
					 | 
				
			||||||
    OS << "metadata ";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  std::unique_ptr<TypePrinting> TypePrinter;
 | 
					  std::unique_ptr<TypePrinting> TypePrinter;
 | 
				
			||||||
  if (PrintType) {
 | 
					  if (PrintType) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,5 +8,5 @@
 | 
				
			|||||||
!1 = !{!"string1", !"string2"}
 | 
					!1 = !{!"string1", !"string2"}
 | 
				
			||||||
; CHECK: assembly parsed, but does not verify as correct!
 | 
					; CHECK: assembly parsed, but does not verify as correct!
 | 
				
			||||||
; CHECK-NEXT: incorrect number of operands in llvm.ident metadata
 | 
					; CHECK-NEXT: incorrect number of operands in llvm.ident metadata
 | 
				
			||||||
; CHECK-NEXT: metadata !1
 | 
					; CHECK-NEXT: !1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,4 +7,4 @@
 | 
				
			|||||||
!0 = !{!{!"nested metadata"}}
 | 
					!0 = !{!{!"nested metadata"}}
 | 
				
			||||||
; CHECK: assembly parsed, but does not verify as correct!
 | 
					; 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: invalid value for llvm.ident metadata entry operand(the operand should be a string)
 | 
				
			||||||
; CHECK-NEXT: metadata !1
 | 
					; CHECK-NEXT: !1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,10 +3,10 @@
 | 
				
			|||||||
; Check that module flags are structurally correct.
 | 
					; Check that module flags are structurally correct.
 | 
				
			||||||
;
 | 
					;
 | 
				
			||||||
; CHECK: incorrect number of operands in module flag
 | 
					; CHECK: incorrect number of operands in module flag
 | 
				
			||||||
; CHECK: metadata !0
 | 
					; CHECK: !0
 | 
				
			||||||
!0 = !{i32 1}
 | 
					!0 = !{i32 1}
 | 
				
			||||||
; CHECK: invalid behavior operand in module flag (expected constant integer)
 | 
					; CHECK: invalid behavior operand in module flag (expected constant integer)
 | 
				
			||||||
; CHECK: metadata !"foo"
 | 
					; CHECK: !"foo"
 | 
				
			||||||
!1 = !{!"foo", !"foo", i32 42}
 | 
					!1 = !{!"foo", !"foo", i32 42}
 | 
				
			||||||
; CHECK: invalid behavior operand in module flag (unexpected constant)
 | 
					; CHECK: invalid behavior operand in module flag (unexpected constant)
 | 
				
			||||||
; CHECK: i32 999
 | 
					; CHECK: i32 999
 | 
				
			||||||
@@ -18,7 +18,7 @@
 | 
				
			|||||||
; CHECK: i32 45
 | 
					; CHECK: i32 45
 | 
				
			||||||
!4 = !{i32 3, !"bla", i32 45}
 | 
					!4 = !{i32 3, !"bla", i32 45}
 | 
				
			||||||
; CHECK: invalid value for 'require' module flag (expected metadata pair)
 | 
					; CHECK: invalid value for 'require' module flag (expected metadata pair)
 | 
				
			||||||
; CHECK: metadata !
 | 
					; CHECK: !
 | 
				
			||||||
!5 = !{i32 3, !"bla", !{i32 46}}
 | 
					!5 = !{i32 3, !"bla", !{i32 46}}
 | 
				
			||||||
; CHECK: invalid value for 'require' module flag (first value operand should be a string)
 | 
					; CHECK: invalid value for 'require' module flag (first value operand should be a string)
 | 
				
			||||||
; CHECK: i32 47
 | 
					; CHECK: i32 47
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,6 @@ entry:
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
!1 = !{}
 | 
					!1 = !{}
 | 
				
			||||||
; CHECK: It should have at least one range!
 | 
					; CHECK: It should have at least one range!
 | 
				
			||||||
; CHECK-NEXT: metadata
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
define i8 @f3(i8* %x) {
 | 
					define i8 @f3(i8* %x) {
 | 
				
			||||||
entry:
 | 
					entry:
 | 
				
			||||||
@@ -148,4 +147,3 @@ entry:
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
!18 = !{}
 | 
					!18 = !{}
 | 
				
			||||||
; CHECK: It should have at least one range!
 | 
					; CHECK: It should have at least one range!
 | 
				
			||||||
; CHECK-NEXT: metadata
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,7 +63,7 @@ TEST_F(MDStringTest, PrintingSimple) {
 | 
				
			|||||||
  std::string Str;
 | 
					  std::string Str;
 | 
				
			||||||
  raw_string_ostream oss(Str);
 | 
					  raw_string_ostream oss(Str);
 | 
				
			||||||
  s->print(oss);
 | 
					  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.
 | 
					// Test printing of MDString with non-printable characters.
 | 
				
			||||||
@@ -73,7 +73,7 @@ TEST_F(MDStringTest, PrintingComplex) {
 | 
				
			|||||||
  std::string Str;
 | 
					  std::string Str;
 | 
				
			||||||
  raw_string_ostream oss(Str);
 | 
					  raw_string_ostream oss(Str);
 | 
				
			||||||
  s->print(oss);
 | 
					  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;
 | 
					typedef MetadataTest MDNodeTest;
 | 
				
			||||||
@@ -182,10 +182,10 @@ TEST_F(MDNodeTest, Print) {
 | 
				
			|||||||
  std::string Expected;
 | 
					  std::string Expected;
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    raw_string_ostream OS(Expected);
 | 
					    raw_string_ostream OS(Expected);
 | 
				
			||||||
    OS << "metadata !{";
 | 
					    OS << "!{";
 | 
				
			||||||
    C->printAsOperand(OS);
 | 
					    C->printAsOperand(OS);
 | 
				
			||||||
    OS << ", ";
 | 
					    OS << ", ";
 | 
				
			||||||
    S->printAsOperand(OS, false);
 | 
					    S->printAsOperand(OS);
 | 
				
			||||||
    OS << ", null";
 | 
					    OS << ", null";
 | 
				
			||||||
    MDNode *Nodes[] = {N0, N1, N2};
 | 
					    MDNode *Nodes[] = {N0, N1, N2};
 | 
				
			||||||
    for (auto *Node : Nodes)
 | 
					    for (auto *Node : Nodes)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user