]> granicus.if.org Git - clang/commitdiff
Minor cleanup, mostly reindenting. Remove one helper function that just called
authorNick Lewycky <nicholas@mxc.ca>
Wed, 9 Nov 2011 04:25:21 +0000 (04:25 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 9 Nov 2011 04:25:21 +0000 (04:25 +0000)
the other helper functions, since we already differentiated the cases it was
testing between. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144167 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index 920eb5578e46e466f20cf40f35b52ad3680fc62d..360516b24c55aa286c39a924333f65b76750efe7 100644 (file)
@@ -754,7 +754,7 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
       unsigned AS = CGM.getContext().getTargetAddressSpace(PointeeTy);
       uint64_t Size = CGM.getContext().getTargetInfo().getPointerWidth(AS);
       uint64_t Align = CGM.getContext().getTypeAlign(ThisPtrTy);
-      llvm::DIType PointeeType =  getOrCreateType(PointeeTy, Unit);
+      llvm::DIType PointeeType = getOrCreateType(PointeeTy, Unit);
       llvm::DIType ThisPtrType =
         DBuilder.createArtificialType
         (DBuilder.createPointerType(PointeeType, Size, Align));
@@ -786,8 +786,8 @@ static bool isFunctionLocalClass(const CXXRecordDecl *RD) {
   else if (isa<FunctionDecl>(RD->getDeclContext()))
     return true;
   return false;
-  
 }
+
 /// CreateCXXMemberFunction - A helper function to create a DISubprogram for
 /// a single member function GlobalDecl.
 llvm::DISubprogram
@@ -1051,7 +1051,7 @@ CollectVTableInfo(const CXXRecordDecl *RD, llvm::DIFile Unit,
 /// getOrCreateRecordType - Emit record type's standalone debug info. 
 llvm::DIType CGDebugInfo::getOrCreateRecordType(QualType RTy, 
                                                 SourceLocation Loc) {
-  llvm::DIType T =  getOrCreateType(RTy, getOrCreateFile(Loc));
+  llvm::DIType T = getOrCreateType(RTy, getOrCreateFile(Loc));
   DBuilder.retainType(T);
   return T;
 }
@@ -1351,17 +1351,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
   return RealDecl;
 }
 
-llvm::DIType CGDebugInfo::CreateType(const TagType *Ty) {
-  if (const RecordType *RT = dyn_cast<RecordType>(Ty))
-    return CreateType(RT);
-  else if (const EnumType *ET = dyn_cast<EnumType>(Ty))
-    return CreateEnumType(ET->getDecl());
-
-  return llvm::DIType();
-}
-
-llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty,
-                                     llvm::DIFile Unit) {
+llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty, llvm::DIFile Unit) {
   llvm::DIType ElementTy = getOrCreateType(Ty->getElementType(), Unit);
   int64_t NumElems = Ty->getNumElements();
   int64_t LowerBound = 0;
@@ -1627,15 +1617,20 @@ llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty,
     return CreateType(cast<ObjCObjectType>(Ty), Unit);
   case Type::ObjCInterface:
     return CreateType(cast<ObjCInterfaceType>(Ty), Unit);
-  case Type::Builtin: return CreateType(cast<BuiltinType>(Ty));
-  case Type::Complex: return CreateType(cast<ComplexType>(Ty));
-  case Type::Pointer: return CreateType(cast<PointerType>(Ty), Unit);
+  case Type::Builtin:
+    return CreateType(cast<BuiltinType>(Ty));
+  case Type::Complex:
+    return CreateType(cast<ComplexType>(Ty));
+  case Type::Pointer:
+    return CreateType(cast<PointerType>(Ty), Unit);
   case Type::BlockPointer:
     return CreateType(cast<BlockPointerType>(Ty), Unit);
-  case Type::Typedef: return CreateType(cast<TypedefType>(Ty), Unit);
+  case Type::Typedef:
+    return CreateType(cast<TypedefType>(Ty), Unit);
   case Type::Record:
+    return CreateType(cast<RecordType>(Ty));
   case Type::Enum:
-    return CreateType(cast<TagType>(Ty));
+    return CreateEnumType(cast<EnumType>(Ty)->getDecl());
   case Type::FunctionProto:
   case Type::FunctionNoProto:
     return CreateType(cast<FunctionType>(Ty), Unit);
@@ -2321,7 +2316,6 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block,
 /// EmitGlobalVariable - Emit information about a global variable.
 void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
                                      const VarDecl *D) {
-  
   // Create global variable debug descriptor.
   llvm::DIFile Unit = getOrCreateFile(D->getLocation());
   unsigned LineNo = getLineNumber(D->getLocation());
@@ -2338,7 +2332,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
     QualType ET = CGM.getContext().getAsArrayType(T)->getElementType();
 
     T = CGM.getContext().getConstantArrayType(ET, ConstVal,
-                                           ArrayType::Normal, 0);
+                                              ArrayType::Normal, 0);
   }
   StringRef DeclName = D->getName();
   StringRef LinkageName;
index a4533a83d57932085e8f5bdeafda32e8d4fb3c95..087cdd08a49d116402e31d86d5afb01bd8743d7e 100644 (file)
@@ -83,7 +83,6 @@ class CGDebugInfo {
   llvm::DIType CreateType(const PointerType *Ty, llvm::DIFile F);
   llvm::DIType CreateType(const BlockPointerType *Ty, llvm::DIFile F);
   llvm::DIType CreateType(const FunctionType *Ty, llvm::DIFile F);
-  llvm::DIType CreateType(const TagType *Ty);
   llvm::DIType CreateType(const RecordType *Ty);
   llvm::DIType CreateType(const ObjCInterfaceType *Ty, llvm::DIFile F);
   llvm::DIType CreateType(const ObjCObjectType *Ty, llvm::DIFile F);