forked from OSchip/llvm-project
				
			
							parent
							
								
									16d33f36d5
								
							
						
					
					
						commit
						3cc90fe5a5
					
				| 
						 | 
					@ -30,7 +30,8 @@ static Constant *GetTagConstant(LLVMContext &VMContext, unsigned Tag) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DIBuilder::DIBuilder(Module &m)
 | 
					DIBuilder::DIBuilder(Module &m)
 | 
				
			||||||
  : M(m), VMContext(M.getContext()), TheCU(0), TempEnumTypes(0),
 | 
					  : M(m), VMContext(M.getContext()), TheCU(0), TempEnumTypes(0),
 | 
				
			||||||
    TempRetainTypes(0), TempSubprograms(0), TempGVs(0), DeclareFn(0), ValueFn(0)
 | 
					    TempRetainTypes(0), TempSubprograms(0), TempGVs(0), DeclareFn(0),
 | 
				
			||||||
 | 
					    ValueFn(0)
 | 
				
			||||||
{}
 | 
					{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// finalize - Construct any deferred debug info descriptors.
 | 
					/// finalize - Construct any deferred debug info descriptors.
 | 
				
			||||||
| 
						 | 
					@ -61,7 +62,8 @@ void DIBuilder::finalize() {
 | 
				
			||||||
  DIType(TempGVs).replaceAllUsesWith(GVs);
 | 
					  DIType(TempGVs).replaceAllUsesWith(GVs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return N.
 | 
					/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return
 | 
				
			||||||
 | 
					/// N.
 | 
				
			||||||
static MDNode *getNonCompileUnitScope(MDNode *N) {
 | 
					static MDNode *getNonCompileUnitScope(MDNode *N) {
 | 
				
			||||||
  if (DIDescriptor(N).isCompileUnit())
 | 
					  if (DIDescriptor(N).isCompileUnit())
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
| 
						 | 
					@ -203,7 +205,7 @@ DIType DIBuilder::createReferenceType(DIType RTy) {
 | 
				
			||||||
  // References are encoded in DIDerivedType format.
 | 
					  // References are encoded in DIDerivedType format.
 | 
				
			||||||
  Value *Elts[] = {
 | 
					  Value *Elts[] = {
 | 
				
			||||||
    GetTagConstant(VMContext, dwarf::DW_TAG_reference_type),
 | 
					    GetTagConstant(VMContext, dwarf::DW_TAG_reference_type),
 | 
				
			||||||
    NULL, //TheCU,
 | 
					    NULL, // TheCU,
 | 
				
			||||||
    NULL, // Name
 | 
					    NULL, // Name
 | 
				
			||||||
    NULL, // Filename
 | 
					    NULL, // Filename
 | 
				
			||||||
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
 | 
					    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
 | 
				
			||||||
| 
						 | 
					@ -468,7 +470,8 @@ DIType DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) {
 | 
				
			||||||
DIType DIBuilder::createEnumerationType(DIDescriptor Scope, StringRef Name,
 | 
					DIType DIBuilder::createEnumerationType(DIDescriptor Scope, StringRef Name,
 | 
				
			||||||
                                        DIFile File, unsigned LineNumber,
 | 
					                                        DIFile File, unsigned LineNumber,
 | 
				
			||||||
                                        uint64_t SizeInBits,
 | 
					                                        uint64_t SizeInBits,
 | 
				
			||||||
                                        uint64_t AlignInBits, DIArray Elements) {
 | 
					                                        uint64_t AlignInBits,
 | 
				
			||||||
 | 
										DIArray Elements) {
 | 
				
			||||||
  // TAG_enumeration_type is encoded in DICompositeType format.
 | 
					  // TAG_enumeration_type is encoded in DICompositeType format.
 | 
				
			||||||
  Value *Elts[] = {
 | 
					  Value *Elts[] = {
 | 
				
			||||||
    GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
 | 
					    GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
 | 
				
			||||||
| 
						 | 
					@ -705,7 +708,8 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
 | 
				
			||||||
  Elts.push_back(getNonCompileUnitScope(Scope)),
 | 
					  Elts.push_back(getNonCompileUnitScope(Scope)),
 | 
				
			||||||
  Elts.push_back(MDString::get(VMContext, Name));
 | 
					  Elts.push_back(MDString::get(VMContext, Name));
 | 
				
			||||||
  Elts.push_back(F);
 | 
					  Elts.push_back(F);
 | 
				
			||||||
  Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))));
 | 
					  Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext),
 | 
				
			||||||
 | 
									  (LineNo | (ArgNo << 24))));
 | 
				
			||||||
  Elts.push_back(Ty);
 | 
					  Elts.push_back(Ty);
 | 
				
			||||||
  Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
 | 
					  Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
 | 
				
			||||||
  Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
 | 
					  Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
 | 
				
			||||||
| 
						 | 
					@ -892,4 +896,3 @@ Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V, uint64_t Offset,
 | 
				
			||||||
                    VarInfo };
 | 
					                    VarInfo };
 | 
				
			||||||
  return CallInst::Create(ValueFn, Args, "", InsertAtEnd);
 | 
					  return CallInst::Create(ValueFn, Args, "", InsertAtEnd);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue