[clang] Add test for CWG190 "Layout-compatible POD-struct types" (#121668)
[llvm-project.git] / llvm / lib / Support / InstructionCost.cpp
blobc485ce9107af92c614a09f21046c3a0e2bff31df
1 //===- InstructionCost.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 /// This file includes the function definitions for the InstructionCost class
10 /// that is used when calculating the cost of an instruction, or a group of
11 /// instructions.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Support/InstructionCost.h"
15 #include "llvm/Support/raw_ostream.h"
17 using namespace llvm;
19 void InstructionCost::print(raw_ostream &OS) const {
20 if (isValid())
21 OS << Value;
22 else
23 OS << "Invalid";