r178551 - [ms-cxxabi] Rename enum and remove dead case per Jordan's suggestion

Reid Kleckner reid at kleckner.net
Tue Apr 2 10:40:19 PDT 2013


Author: rnk
Date: Tue Apr  2 12:40:19 2013
New Revision: 178551

URL: http://llvm.org/viewvc/llvm-project?rev=178551&view=rev
Log:
[ms-cxxabi] Rename enum and remove dead case per Jordan's suggestion

The IHM_ prefix was a fairly gross abbreviation to try to hit three
characters for uniqueness.

Modified:
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/lib/AST/MicrosoftCXXABI.cpp

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=178551&r1=178550&r2=178551&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Apr  2 12:40:19 2013
@@ -2094,10 +2094,10 @@ public:
 
 /// The inheritance model to use for this member pointer.
 enum MSInheritanceModel {
-  IHM_Single,
-  IHM_Multiple,
-  IHM_Virtual,
-  IHM_Unspecified
+  MSIM_Single,
+  MSIM_Multiple,
+  MSIM_Virtual,
+  MSIM_Unspecified
 };
 
 /// MemberPointerType - C++ 8.3.3 - Pointers to members

Modified: cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftCXXABI.cpp?rev=178551&r1=178550&r2=178551&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftCXXABI.cpp Tue Apr  2 12:40:19 2013
@@ -73,10 +73,10 @@ bool usesMultipleInheritanceModel(const
 MSInheritanceModel MSInheritanceAttrToModel(attr::Kind Kind) {
   switch (Kind) {
   default: llvm_unreachable("expected MS inheritance attribute");
-  case attr::SingleInheritance:      return IHM_Single;
-  case attr::MultipleInheritance:    return IHM_Multiple;
-  case attr::VirtualInheritance:     return IHM_Virtual;
-  case attr::UnspecifiedInheritance: return IHM_Unspecified;
+  case attr::SingleInheritance:      return MSIM_Single;
+  case attr::MultipleInheritance:    return MSIM_Multiple;
+  case attr::VirtualInheritance:     return MSIM_Virtual;
+  case attr::UnspecifiedInheritance: return MSIM_Unspecified;
   }
 }
 
@@ -87,10 +87,10 @@ MSInheritanceModel CXXRecordDecl::getMSI
   // If there was no explicit attribute, the record must be defined already, and
   // we can figure out the inheritance model from its other properties.
   if (this->getNumVBases() > 0)
-    return IHM_Virtual;
+    return MSIM_Virtual;
   if (usesMultipleInheritanceModel(this))
-    return IHM_Multiple;
-  return IHM_Single;
+    return MSIM_Multiple;
+  return MSIM_Single;
 }
 
 // Returns the number of pointer and integer slots used to represent a member
@@ -134,22 +134,20 @@ std::pair<unsigned, unsigned> MemberPoin
     // the 'this' pointer.
     Ptrs = 1;  // First slot is always a function pointer.
     switch (Inheritance) {
-    default: llvm_unreachable("unknown inheritance model");
-    case IHM_Unspecified: ++Ints;  // VBTableOffset
-    case IHM_Virtual:     ++Ints;  // VirtualBaseAdjustmentOffset
-    case IHM_Multiple:    ++Ints;  // NonVirtualBaseAdjustment
-    case IHM_Single:      break;   // Nothing
+    case MSIM_Unspecified: ++Ints;  // VBTableOffset
+    case MSIM_Virtual:     ++Ints;  // VirtualBaseAdjustmentOffset
+    case MSIM_Multiple:    ++Ints;  // NonVirtualBaseAdjustment
+    case MSIM_Single:      break;   // Nothing
     }
   } else {
     // Data pointers are an aggregate of ints.  The first int is an offset
     // followed by vbtable-related offsets.
     Ptrs = 0;
     switch (Inheritance) {
-    default: llvm_unreachable("unknown inheritance model");
-    case IHM_Unspecified: ++Ints;  // VBTableOffset
-    case IHM_Virtual:     ++Ints;  // VirtualBaseAdjustmentOffset
-    case IHM_Multiple:             // Nothing
-    case IHM_Single:      ++Ints;  // Field offset
+    case MSIM_Unspecified: ++Ints;  // VBTableOffset
+    case MSIM_Virtual:     ++Ints;  // VirtualBaseAdjustmentOffset
+    case MSIM_Multiple:             // Nothing
+    case MSIM_Single:      ++Ints;  // Field offset
     }
   }
   return std::make_pair(Ptrs, Ints);





More information about the cfe-commits mailing list