[llvm-branch-commits] [llvm-branch] r223028 - Add file that should have been in r223027

Daniel Sanders daniel.sanders at imgtec.com
Mon Dec 1 06:43:25 PST 2014


Author: dsanders
Date: Mon Dec  1 08:43:25 2014
New Revision: 223028

URL: http://llvm.org/viewvc/llvm-project?rev=223028&view=rev
Log:
Add file that should have been in r223027


Added:
    llvm/branches/release_35/lib/Target/Mips/MipsABIInfo.h

Added: llvm/branches/release_35/lib/Target/Mips/MipsABIInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/Target/Mips/MipsABIInfo.h?rev=223028&view=auto
==============================================================================
--- llvm/branches/release_35/lib/Target/Mips/MipsABIInfo.h (added)
+++ llvm/branches/release_35/lib/Target/Mips/MipsABIInfo.h Mon Dec  1 08:43:25 2014
@@ -0,0 +1,46 @@
+//===---- MipsABIInfo.h - Information about MIPS ABI's --------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MIPSABIINFO_H
+#define MIPSABIINFO_H
+
+namespace llvm {
+class MipsABIInfo {
+public:
+  enum class ABI { Unknown, O32, N32, N64, EABI };
+
+protected:
+  ABI ThisABI;
+
+public:
+  MipsABIInfo(ABI ThisABI) : ThisABI(ThisABI) {}
+
+  static MipsABIInfo Unknown() { return MipsABIInfo(ABI::Unknown); }
+  static MipsABIInfo O32() { return MipsABIInfo(ABI::O32); }
+  static MipsABIInfo N32() { return MipsABIInfo(ABI::N32); }
+  static MipsABIInfo N64() { return MipsABIInfo(ABI::N64); }
+  static MipsABIInfo EABI() { return MipsABIInfo(ABI::EABI); }
+
+  bool IsKnown() const { return ThisABI != ABI::Unknown; }
+  bool IsO32() const { return ThisABI == ABI::O32; }
+  bool IsN32() const { return ThisABI == ABI::N32; }
+  bool IsN64() const { return ThisABI == ABI::N64; }
+  bool IsEABI() const { return ThisABI == ABI::EABI; }
+  ABI GetEnumValue() const { return ThisABI; }
+
+  /// Ordering of ABI's
+  /// MipsGenSubtargetInfo.inc will use this to resolve conflicts when given
+  /// multiple ABI options.
+  bool operator<(const MipsABIInfo Other) const {
+    return ThisABI < Other.GetEnumValue();
+  }
+};
+}
+
+#endif





More information about the llvm-branch-commits mailing list