1 //===----------------------- View.cpp ---------------------------*- 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 /// \file
9 ///
10 /// This file defines the virtual anchor method in View.h to pin the vtable.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #include "Views/View.h"
15 
16 namespace llvm {
17 namespace mca {
18 
anchor()19 void View::anchor() {}
20 
printInstructionString(const llvm::MCInst & MCI) const21 StringRef InstructionView::printInstructionString(const llvm::MCInst &MCI) const {
22     InstructionString = "";
23     MCIP.printInst(&MCI, 0, "", STI, InstrStream);
24     InstrStream.flush();
25     // Remove any tabs or spaces at the beginning of the instruction.
26     return StringRef(InstructionString).ltrim();
27   }
28 } // namespace mca
29 } // namespace llvm
30