[llvm] r237910 - Size enum so we can store it as 16-bits and avoid casts. NFC

Pete Cooper peter_cooper at apple.com
Thu May 21 09:40:19 PDT 2015


Author: pete
Date: Thu May 21 11:40:18 2015
New Revision: 237910

URL: http://llvm.org/viewvc/llvm-project?rev=237910&view=rev
Log:
Size enum so we can store it as 16-bits and avoid casts.  NFC

Modified:
    llvm/trunk/include/llvm/MC/MCExpr.h

Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=237910&r1=237909&r2=237910&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Thu May 21 11:40:18 2015
@@ -159,7 +159,7 @@ public:
 /// of the symbol as external.
 class MCSymbolRefExpr : public MCExpr {
 public:
-  enum VariantKind {
+  enum VariantKind : uint16_t {
     VK_None,
     VK_Invalid,
 
@@ -295,7 +295,7 @@ public:
 
 private:
   /// The symbol reference modifier.
-  const unsigned Kind : 16;
+  const VariantKind Kind;
 
   /// Specifies how the variant kind should be printed.
   const unsigned UseParensForSymbolVariant : 1;
@@ -328,7 +328,7 @@ public:
 
   const MCSymbol &getSymbol() const { return *Symbol; }
 
-  VariantKind getKind() const { return static_cast<VariantKind>(Kind); }
+  VariantKind getKind() const { return Kind; }
 
   void printVariantKind(raw_ostream &OS) const;
 





More information about the llvm-commits mailing list