[cfe-commits] r117928 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h
Devang Patel
dpatel at apple.com
Mon Nov 1 09:52:40 PDT 2010
Author: dpatel
Date: Mon Nov 1 11:52:40 2010
New Revision: 117928
URL: http://llvm.org/viewvc/llvm-project?rev=117928&view=rev
Log:
Simplify. Builtin types' context is always implied.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=117928&r1=117927&r2=117928&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Nov 1 11:52:40 2010
@@ -269,8 +269,7 @@
/// CreateType - Get the Basic type from the cache or create a new
/// one if necessary.
-llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
- llvm::DIFile Unit) {
+llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
unsigned Encoding = 0;
const char *BTName = NULL;
switch (BT->getKind()) {
@@ -279,7 +278,8 @@
return llvm::DIType();
case BuiltinType::ObjCClass:
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_structure_type,
- Unit, "objc_class", Unit, 0, 0, 0,
+ TheCU, "objc_class",
+ getOrCreateMainFile(), 0, 0, 0,
0, llvm::DIDescriptor::FlagFwdDecl,
llvm::DIType(), llvm::DIArray());
case BuiltinType::ObjCId: {
@@ -290,29 +290,31 @@
llvm::DIType OCTy =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_structure_type,
- Unit, "objc_class", Unit, 0, 0, 0, 0,
+ TheCU, "objc_class",
+ getOrCreateMainFile(), 0, 0, 0, 0,
llvm::DIDescriptor::FlagFwdDecl,
llvm::DIType(), llvm::DIArray());
unsigned Size = CGM.getContext().getTypeSize(CGM.getContext().VoidPtrTy);
llvm::DIType ISATy =
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
- Unit, "", Unit,
+ TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
llvm::DIType FieldTy =
- DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, Unit,
- "isa", Unit,
+ DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, TheCU,
+ "isa", getOrCreateMainFile(),
0,Size, 0, 0, 0, ISATy);
EltTys.push_back(FieldTy);
llvm::DIArray Elements =
DebugFactory.GetOrCreateArray(EltTys.data(), EltTys.size());
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_structure_type,
- Unit, "objc_object", Unit, 0, 0, 0,
- 0, 0,
+ TheCU, "objc_object",
+ getOrCreateMainFile(),
+ 0, 0, 0, 0, 0,
llvm::DIType(), Elements);
}
case BuiltinType::UChar:
@@ -348,8 +350,7 @@
uint64_t Offset = 0;
llvm::DIType DbgTy =
DebugFactory.CreateBasicType(TheCU, BTName, getOrCreateMainFile(),
- 0, Size, Align,
- Offset, /*flags*/ 0, Encoding);
+ 0, Size, Align, Offset, /*flags*/ 0, Encoding);
return DbgTy;
}
@@ -1486,7 +1487,7 @@
return CreateType(cast<ObjCObjectType>(Ty), Unit);
case Type::ObjCInterface:
return CreateType(cast<ObjCInterfaceType>(Ty), Unit);
- case Type::Builtin: return CreateType(cast<BuiltinType>(Ty), Unit);
+ case Type::Builtin: return CreateType(cast<BuiltinType>(Ty));
case Type::Complex: return CreateType(cast<ComplexType>(Ty), Unit);
case Type::Pointer: return CreateType(cast<PointerType>(Ty), Unit);
case Type::BlockPointer:
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=117928&r1=117927&r2=117928&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Mon Nov 1 11:52:40 2010
@@ -74,7 +74,7 @@
llvm::DenseMap<const NamespaceDecl *, llvm::WeakVH> NameSpaceCache;
/// Helper functions for getOrCreateType.
- llvm::DIType CreateType(const BuiltinType *Ty, llvm::DIFile F);
+ llvm::DIType CreateType(const BuiltinType *Ty);
llvm::DIType CreateType(const ComplexType *Ty, llvm::DIFile F);
llvm::DIType CreateQualifiedType(QualType Ty, llvm::DIFile F);
llvm::DIType CreateType(const TypedefType *Ty, llvm::DIFile F);
More information about the cfe-commits
mailing list