r316013 - Sema: use new `getNS{,U}IntegerType` for NS{,U}Integer

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 17 10:39:33 PDT 2017


Author: compnerd
Date: Tue Oct 17 10:39:32 2017
New Revision: 316013

URL: http://llvm.org/viewvc/llvm-project?rev=316013&view=rev
Log:
Sema: use new `getNS{,U}IntegerType` for NS{,U}Integer

Use the new helper methods to get the underlying type for NSUInteger,
NSInteger types.  This avoids spreading the knowledge of the underlying
types in various sites.  For non-LLP64 targets, this has no change.

Modified:
    cfe/trunk/lib/Sema/SemaChecking.cpp

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=316013&r1=316012&r2=316013&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Oct 17 10:39:32 2017
@@ -6168,9 +6168,9 @@ shouldNotPrintDirectly(const ASTContext
   while (const TypedefType *UserTy = TyTy->getAs<TypedefType>()) {
     StringRef Name = UserTy->getDecl()->getName();
     QualType CastTy = llvm::StringSwitch<QualType>(Name)
-      .Case("CFIndex", Context.LongTy)
-      .Case("NSInteger", Context.LongTy)
-      .Case("NSUInteger", Context.UnsignedLongTy)
+      .Case("CFIndex", Context.getNSIntegerType())
+      .Case("NSInteger", Context.getNSIntegerType())
+      .Case("NSUInteger", Context.getNSUIntegerType())
       .Case("SInt32", Context.IntTy)
       .Case("UInt32", Context.UnsignedIntTy)
       .Default(QualType());




More information about the cfe-commits mailing list