Skip to content

Commit

Permalink
[NFC][SandboxIR] Drop namespace:: prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
vporpo committed Jul 2, 2024
1 parent f80a407 commit 123beb7
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions llvm/lib/SandboxIR/SandboxIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,27 @@
#include "llvm/Support/Debug.h"
#include <sstream>

using namespace llvm;
using namespace sandboxir;
using namespace llvm::sandboxir;

sandboxir::Value::Value(ClassID SubclassID, llvm::Value *Val, Context &Ctx)
Value::Value(ClassID SubclassID, llvm::Value *Val, Context &Ctx)
: SubclassID(SubclassID), Val(Val), Ctx(Ctx) {
#ifndef NDEBUG
UID = 0; // FIXME: Once SBContext is available.
#endif
}

#ifndef NDEBUG
std::string sandboxir::Value::getName() const {
std::string Value::getName() const {
std::stringstream SS;
SS << "SB" << UID << ".";
return SS.str();
}

void sandboxir::Value::dumpCommonHeader(raw_ostream &OS) const {
void Value::dumpCommonHeader(raw_ostream &OS) const {
OS << getName() << " " << getSubclassIDStr(SubclassID) << " ";
}

void sandboxir::Value::dumpCommonFooter(raw_ostream &OS) const {
void Value::dumpCommonFooter(raw_ostream &OS) const {
OS.indent(2) << "Val: ";
if (Val)
OS << *Val;
Expand All @@ -40,26 +39,26 @@ void sandboxir::Value::dumpCommonFooter(raw_ostream &OS) const {
OS << "\n";
}

void sandboxir::Value::dumpCommonPrefix(raw_ostream &OS) const {
void Value::dumpCommonPrefix(raw_ostream &OS) const {
if (Val)
OS << *Val;
else
OS << "NULL ";
}

void sandboxir::Value::dumpCommonSuffix(raw_ostream &OS) const {
void Value::dumpCommonSuffix(raw_ostream &OS) const {
OS << " ; " << getName() << " (" << getSubclassIDStr(SubclassID) << ") "
<< this;
}

void sandboxir::Value::printAsOperandCommon(raw_ostream &OS) const {
void Value::printAsOperandCommon(raw_ostream &OS) const {
if (Val)
Val->printAsOperand(OS);
else
OS << "NULL ";
}

void sandboxir::User::dumpCommonHeader(raw_ostream &OS) const {
void User::dumpCommonHeader(raw_ostream &OS) const {
Value::dumpCommonHeader(OS);
// TODO: This is incomplete
}
Expand Down

0 comments on commit 123beb7

Please sign in to comment.