summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/MCTargetDesc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Sparc/MCTargetDesc')
-rw-r--r--llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h82
-rw-r--r--llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp19
-rw-r--r--llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h2
3 files changed, 15 insertions, 88 deletions
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h b/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h
deleted file mode 100644
index 2e2d4bac797..00000000000
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//===-- SparcBaseInfo.h - Top level definitions for Sparc ---- --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains small standalone helper functions and enum definitions
-// for the Sparc target useful for the compiler back-end and the MC libraries.
-// As such, it deliberately does not include references to LLVM core code gen
-// types, passes, etc..
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARCBASEINFO_H
-#define SPARCBASEINFO_H
-
-namespace llvm {
-
-/// SPII - This namespace holds target specific flags for instruction info.
-namespace SPII {
-
-/// Target Operand Flags. Sparc specific TargetFlags for MachineOperands and
-/// SDNodes.
-enum TOF {
- MO_NO_FLAG,
-
- // Extract the low 10 bits of an address.
- // Assembler: %lo(addr)
- MO_LO,
-
- // Extract bits 31-10 of an address. Only for sethi.
- // Assembler: %hi(addr) or %lm(addr)
- MO_HI,
-
- // Extract bits 43-22 of an address. Only for sethi.
- // Assembler: %h44(addr)
- MO_H44,
-
- // Extract bits 21-12 of an address.
- // Assembler: %m44(addr)
- MO_M44,
-
- // Extract bits 11-0 of an address.
- // Assembler: %l44(addr)
- MO_L44,
-
- // Extract bits 63-42 of an address. Only for sethi.
- // Assembler: %hh(addr)
- MO_HH,
-
- // Extract bits 41-32 of an address.
- // Assembler: %hm(addr)
- MO_HM,
-
- // TargetFlags for Thread Local Storage.
- MO_TLS_GD_HI22,
- MO_TLS_GD_LO10,
- MO_TLS_GD_ADD,
- MO_TLS_GD_CALL,
- MO_TLS_LDM_HI22,
- MO_TLS_LDM_LO10,
- MO_TLS_LDM_ADD,
- MO_TLS_LDM_CALL,
- MO_TLS_LDO_HIX22,
- MO_TLS_LDO_LOX10,
- MO_TLS_LDO_ADD,
- MO_TLS_IE_HI22,
- MO_TLS_IE_LO10,
- MO_TLS_IE_LD,
- MO_TLS_IE_LDX,
- MO_TLS_IE_ADD,
- MO_TLS_LE_HIX22,
- MO_TLS_LE_LOX10
-};
-
-} // end namespace SPII
-} // end namespace llvm
-
-#endif
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
index 45f2f9f11e4..f38e3118184 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
@@ -29,8 +29,21 @@ SparcMCExpr::Create(VariantKind Kind, const MCExpr *Expr,
}
+
void SparcMCExpr::PrintImpl(raw_ostream &OS) const
{
+
+ bool closeParen = printVariantKind(OS, Kind);
+
+ const MCExpr *Expr = getSubExpr();
+ Expr->print(OS);
+
+ if (closeParen)
+ OS << ')';
+}
+
+bool SparcMCExpr::printVariantKind(raw_ostream &OS, VariantKind Kind)
+{
bool closeParen = true;
switch (Kind) {
case VK_Sparc_None: closeParen = false; break;
@@ -61,11 +74,7 @@ void SparcMCExpr::PrintImpl(raw_ostream &OS) const
case VK_Sparc_TLS_LE_HIX22: OS << "%tle_hix22("; break;
case VK_Sparc_TLS_LE_LOX10: OS << "%tle_lox10("; break;
}
-
- const MCExpr *Expr = getSubExpr();
- Expr->print(OS);
- if (closeParen)
- OS << ')';
+ return closeParen;
}
SparcMCExpr::VariantKind SparcMCExpr::parseVariantKind(StringRef name)
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
index f1995171864..ebe3a752a6f 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
@@ -93,7 +93,7 @@ public:
static bool classof(const SparcMCExpr *) { return true; }
static VariantKind parseVariantKind(StringRef name);
-
+ static bool printVariantKind(raw_ostream &OS, VariantKind Kind);
};
} // end namespace llvm.
OpenPOWER on IntegriCloud