Deleted Added
full compact
CGDebugInfo.cpp (195099) CGDebugInfo.cpp (195341)
1//===--- CGDebugInfo.cpp - Emit Debug Information for a Module ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 137 unchanged lines hidden (view full) ---

146 case BuiltinType::Double: Encoding = llvm::dwarf::DW_ATE_float; break;
147 }
148 // Bit size, align and offset of the type.
149 uint64_t Size = M->getContext().getTypeSize(BT);
150 uint64_t Align = M->getContext().getTypeAlign(BT);
151 uint64_t Offset = 0;
152
153 return DebugFactory.CreateBasicType(Unit,
1//===--- CGDebugInfo.cpp - Emit Debug Information for a Module ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 137 unchanged lines hidden (view full) ---

146 case BuiltinType::Double: Encoding = llvm::dwarf::DW_ATE_float; break;
147 }
148 // Bit size, align and offset of the type.
149 uint64_t Size = M->getContext().getTypeSize(BT);
150 uint64_t Align = M->getContext().getTypeAlign(BT);
151 uint64_t Offset = 0;
152
153 return DebugFactory.CreateBasicType(Unit,
154 BT->getName(M->getContext().getLangOptions().CPlusPlus),
154 BT->getName(M->getContext().getLangOptions()),
155 Unit, 0, Size, Align,
156 Offset, /*flags*/ 0, Encoding);
157}
158
159llvm::DIType CGDebugInfo::CreateType(const ComplexType *Ty,
160 llvm::DICompileUnit Unit) {
161 // Bit size, align and offset of the type.
162 unsigned Encoding = llvm::dwarf::DW_ATE_complex_float;

--- 269 unchanged lines hidden (view full) ---

432 TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = FwdDecl;
433
434 // Convert all the elements.
435 llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
436
437 const ASTRecordLayout &RL = M->getContext().getASTRecordLayout(Decl);
438
439 unsigned FieldNo = 0;
155 Unit, 0, Size, Align,
156 Offset, /*flags*/ 0, Encoding);
157}
158
159llvm::DIType CGDebugInfo::CreateType(const ComplexType *Ty,
160 llvm::DICompileUnit Unit) {
161 // Bit size, align and offset of the type.
162 unsigned Encoding = llvm::dwarf::DW_ATE_complex_float;

--- 269 unchanged lines hidden (view full) ---

432 TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = FwdDecl;
433
434 // Convert all the elements.
435 llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
436
437 const ASTRecordLayout &RL = M->getContext().getASTRecordLayout(Decl);
438
439 unsigned FieldNo = 0;
440 for (RecordDecl::field_iterator I = Decl->field_begin(M->getContext()),
441 E = Decl->field_end(M->getContext());
440 for (RecordDecl::field_iterator I = Decl->field_begin(),
441 E = Decl->field_end();
442 I != E; ++I, ++FieldNo) {
443 FieldDecl *Field = *I;
444 llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit);
445
446 std::string FieldName = Field->getNameAsString();
447
448 // Ignore unnamed fields.
449 if (FieldName.empty())

--- 183 unchanged lines hidden (view full) ---

633llvm::DIType CGDebugInfo::CreateType(const EnumType *Ty,
634 llvm::DICompileUnit Unit) {
635 EnumDecl *Decl = Ty->getDecl();
636
637 llvm::SmallVector<llvm::DIDescriptor, 32> Enumerators;
638
639 // Create DIEnumerator elements for each enumerator.
640 for (EnumDecl::enumerator_iterator
442 I != E; ++I, ++FieldNo) {
443 FieldDecl *Field = *I;
444 llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit);
445
446 std::string FieldName = Field->getNameAsString();
447
448 // Ignore unnamed fields.
449 if (FieldName.empty())

--- 183 unchanged lines hidden (view full) ---

633llvm::DIType CGDebugInfo::CreateType(const EnumType *Ty,
634 llvm::DICompileUnit Unit) {
635 EnumDecl *Decl = Ty->getDecl();
636
637 llvm::SmallVector<llvm::DIDescriptor, 32> Enumerators;
638
639 // Create DIEnumerator elements for each enumerator.
640 for (EnumDecl::enumerator_iterator
641 Enum = Decl->enumerator_begin(M->getContext()),
642 EnumEnd = Decl->enumerator_end(M->getContext());
641 Enum = Decl->enumerator_begin(), EnumEnd = Decl->enumerator_end();
643 Enum != EnumEnd; ++Enum) {
644 Enumerators.push_back(DebugFactory.CreateEnumerator(Enum->getNameAsString(),
645 Enum->getInitVal().getZExtValue()));
646 }
647
648 // Return a CompositeType for the enum itself.
649 llvm::DIArray EltArray =
650 DebugFactory.GetOrCreateArray(Enumerators.data(), Enumerators.size());

--- 340 unchanged lines hidden ---
642 Enum != EnumEnd; ++Enum) {
643 Enumerators.push_back(DebugFactory.CreateEnumerator(Enum->getNameAsString(),
644 Enum->getInitVal().getZExtValue()));
645 }
646
647 // Return a CompositeType for the enum itself.
648 llvm::DIArray EltArray =
649 DebugFactory.GetOrCreateArray(Enumerators.data(), Enumerators.size());

--- 340 unchanged lines hidden ---