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
void Metadata::print(raw_ostream &ROS) const {
formatted_raw_ostream OS(ROS);
if (auto *N = dyn_cast<MDNode>(this)) {
void Metadata::print(raw_ostream &ROS) const {
formatted_raw_ostream OS(ROS);
if (auto *N = dyn_cast<MDNode>(this)) {
SlotTracker SlotTable(static_cast<Function *>(nullptr));
AssemblyWriter W(OS, SlotTable, nullptr, nullptr);
W.printMDNodeBody(N);
SlotTracker SlotTable(static_cast<Function *>(nullptr));
AssemblyWriter W(OS, SlotTable, nullptr, nullptr);
W.printMDNodeBody(N);
void Metadata::printAsOperand(raw_ostream &ROS, bool PrintType,
const Module *M) const {
formatted_raw_ostream OS(ROS);
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) {
std::unique_ptr<TypePrinting> TypePrinter;
if (PrintType) {
!1 = !{!"string1", !"string2"}
; CHECK: assembly parsed, but does not verify as correct!
; CHECK-NEXT: incorrect number of operands in llvm.ident metadata
!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
!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)
!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 that module flags are structurally correct.
;
; CHECK: incorrect number of operands in module flag
; Check that module flags are structurally correct.
;
; CHECK: incorrect number of operands in module flag
!0 = !{i32 1}
; CHECK: invalid behavior operand in module flag (expected constant integer)
!0 = !{i32 1}
; CHECK: invalid behavior operand in module flag (expected constant integer)
-; CHECK: metadata !"foo"
!1 = !{!"foo", !"foo", i32 42}
; CHECK: invalid behavior operand in module flag (unexpected constant)
; CHECK: i32 999
!1 = !{!"foo", !"foo", i32 42}
; CHECK: invalid behavior operand in module flag (unexpected constant)
; CHECK: i32 999
; CHECK: i32 45
!4 = !{i32 3, !"bla", i32 45}
; CHECK: invalid value for 'require' module flag (expected metadata pair)
; CHECK: i32 45
!4 = !{i32 3, !"bla", i32 45}
; CHECK: invalid value for 'require' module flag (expected metadata pair)
!5 = !{i32 3, !"bla", !{i32 46}}
; CHECK: invalid value for 'require' module flag (first value operand should be a string)
; CHECK: i32 47
!5 = !{i32 3, !"bla", !{i32 46}}
; CHECK: invalid value for 'require' module flag (first value operand should be a string)
; CHECK: i32 47
}
!1 = !{}
; CHECK: It should have at least one range!
}
!1 = !{}
; CHECK: It should have at least one range!
define i8 @f3(i8* %x) {
entry:
define i8 @f3(i8* %x) {
entry:
}
!18 = !{}
; CHECK: It should have at least one range!
}
!18 = !{}
; CHECK: It should have at least one range!
std::string Str;
raw_string_ostream oss(Str);
s->print(oss);
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.
}
// Test printing of MDString with non-printable characters.
std::string Str;
raw_string_ostream oss(Str);
s->print(oss);
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;
}
typedef MetadataTest MDNodeTest;
std::string Expected;
{
raw_string_ostream OS(Expected);
std::string Expected;
{
raw_string_ostream OS(Expected);
C->printAsOperand(OS);
OS << ", ";
C->printAsOperand(OS);
OS << ", ";
- S->printAsOperand(OS, false);
OS << ", null";
MDNode *Nodes[] = {N0, N1, N2};
for (auto *Node : Nodes)
OS << ", null";
MDNode *Nodes[] = {N0, N1, N2};
for (auto *Node : Nodes)