LLVM  9.0.0svn
MCAsmMacro.cpp
Go to the documentation of this file.
1 //===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "llvm/MC/MCAsmMacro.h"
11 
12 using namespace llvm;
13 
15  OS << "\"" << Name << "\"";
16  if (Required)
17  OS << ":req";
18  if (Vararg)
19  OS << ":vararg";
20  if (!Value.empty()) {
21  OS << " = ";
22  bool first = true;
23  for (const AsmToken &T : Value) {
24  if (!first)
25  OS << ", ";
26  first = false;
27  OS << T.getString();
28  }
29  }
30  OS << "\n";
31 }
32 
33 void MCAsmMacro::dump(raw_ostream &OS) const {
34  OS << "Macro " << Name << ":\n";
35  OS << " Parameters:\n";
36  for (const MCAsmMacroParameter &P : Parameters) {
37  OS << " ";
38  P.dump();
39  }
40  OS << " (BEGIN BODY)" << Body << "(END BODY)\n";
41 }
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Target independent representation for an assembler token.
Definition: MCAsmMacro.h:21
void dump() const
Definition: MCAsmMacro.h:152
#define P(N)
unsigned first
LLVM Value Representation.
Definition: Value.h:72
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45