blob: 9c7317096ce95d4a359d380ad270c8d8e7c5d9c9 [file] [log] [blame]
Daniel Dunbar2c116242009-08-14 03:11:09 +00001//===- lib/MC/MCValue.cpp - MCValue implementation ------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCValue.h"
11#include "llvm/Support/raw_ostream.h"
12
13using namespace llvm;
14
15void MCValue::print(raw_ostream &OS) const {
16 if (isAbsolute()) {
17 OS << getConstant();
18 return;
19 }
20
21 OS << getSymA();
22 if (getSymB())
23 OS << " - " << getSymB();
24 if (getConstant())
25 OS << " + " << getConstant();
26}
27
28void MCValue::dump() const {
29 print(errs());
30}