blob: ba4fb7d4f387852e67721da4eb485fd0e23bb034 [file] [log] [blame]
Oliver Stannarda9301112018-03-06 14:07:01 +00001//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Oliver Stannarda9301112018-03-06 14:07:01 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/MC/MCAsmMacro.h"
10#include "llvm/Support/raw_ostream.h"
11
12using namespace llvm;
13
14void MCAsmMacroParameter::dump(raw_ostream &OS) const {
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;
Oliver Stannard44681072018-03-06 16:51:17 +000027 OS << T.getString();
Oliver Stannarda9301112018-03-06 14:07:01 +000028 }
29 }
30 OS << "\n";
31}
32
33void 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}