1*af732203SDimitry Andric //===- InstructionCost.cpp --------------------------------------*- C++ -*-===//
2*af732203SDimitry Andric //
3*af732203SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*af732203SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*af732203SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*af732203SDimitry Andric //
7*af732203SDimitry Andric //===----------------------------------------------------------------------===//
8*af732203SDimitry Andric /// \file
9*af732203SDimitry Andric /// This file includes the function definitions for the InstructionCost class
10*af732203SDimitry Andric /// that is used when calculating the cost of an instruction, or a group of
11*af732203SDimitry Andric /// instructions.
12*af732203SDimitry Andric //===----------------------------------------------------------------------===//
13*af732203SDimitry Andric 
14*af732203SDimitry Andric #include "llvm/Support/InstructionCost.h"
15*af732203SDimitry Andric #include "llvm/Support/raw_ostream.h"
16*af732203SDimitry Andric 
17*af732203SDimitry Andric using namespace llvm;
18*af732203SDimitry Andric 
print(raw_ostream & OS) const19*af732203SDimitry Andric void InstructionCost::print(raw_ostream &OS) const {
20*af732203SDimitry Andric   if (isValid())
21*af732203SDimitry Andric     OS << Value;
22*af732203SDimitry Andric   else
23*af732203SDimitry Andric     OS << "Invalid";
24*af732203SDimitry Andric }
25