From 7908a6a189d12c38269df2891a24382525d00591 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 29 Jun 2009 19:51:00 +0000 Subject: [PATCH] Rename MCValue::getCst to getConstant and add MCValue::isConstant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74440 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCValue.h | 5 +++-- lib/MC/MCAsmStreamer.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/llvm/MC/MCValue.h b/include/llvm/MC/MCValue.h index 7df12dadd0e..811d331edda 100644 --- a/include/llvm/MC/MCValue.h +++ b/include/llvm/MC/MCValue.h @@ -30,10 +30,11 @@ class MCValue { int64_t Cst; public: - int64_t getCst() const { return Cst; } + int64_t getConstant() const { return Cst; } MCSymbol *getSymA() const { return SymA; } MCSymbol *getSymB() const { return SymB; } - + + bool isConstant() const { return !SymA && !SymB; } static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) { MCValue R; diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index e38f2b3d8bc..eebb58c9365 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -66,11 +66,11 @@ static inline raw_ostream &operator<<(raw_ostream &os, const MCValue &Value) { os << Value.getSymA()->getName(); if (Value.getSymB()) os << " - " << Value.getSymB()->getName(); - if (Value.getCst()) - os << " + " << Value.getCst(); + if (Value.getConstant()) + os << " + " << Value.getConstant(); } else { assert(!Value.getSymB() && "Invalid machine code value!"); - os << Value.getCst(); + os << Value.getConstant(); } return os; @@ -83,7 +83,7 @@ static inline int64_t truncateToSize(int64_t Value, unsigned Bytes) { static inline MCValue truncateToSize(const MCValue &Value, unsigned Bytes) { return MCValue::get(Value.getSymA(), Value.getSymB(), - truncateToSize(Value.getCst(), Bytes)); + truncateToSize(Value.getConstant(), Bytes)); } void MCAsmStreamer::SwitchSection(MCSection *Section) { -- 2.34.1