Path: blob/main/contrib/llvm-project/llvm/lib/MC/MCAsmMacro.cpp
35233 views
//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/MC/MCAsmMacro.h"9#include "llvm/Support/raw_ostream.h"1011using namespace llvm;1213#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)14void MCAsmMacroParameter::dump(raw_ostream &OS) const {15OS << "\"" << Name << "\"";16if (Required)17OS << ":req";18if (Vararg)19OS << ":vararg";20if (!Value.empty()) {21OS << " = ";22bool first = true;23for (const AsmToken &T : Value) {24if (!first)25OS << ", ";26first = false;27OS << T.getString();28}29}30OS << "\n";31}3233void MCAsmMacro::dump(raw_ostream &OS) const {34OS << "Macro " << Name << ":\n";35OS << " Parameters:\n";36for (const MCAsmMacroParameter &P : Parameters) {37OS << " ";38P.dump();39}40if (!Locals.empty()) {41OS << " Locals:\n";42for (StringRef L : Locals)43OS << " " << L << '\n';44}45OS << " (BEGIN BODY)" << Body << "(END BODY)\n";46}47#endif484950