mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -132,7 +132,7 @@ void CompileUnit::addSourceLine(DIE *Die, DIVariable V) {
|
|||||||
// Verify variable.
|
// Verify variable.
|
||||||
if (!V.Verify())
|
if (!V.Verify())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned Line = V.getLineNumber();
|
unsigned Line = V.getLineNumber();
|
||||||
if (Line == 0)
|
if (Line == 0)
|
||||||
return;
|
return;
|
||||||
@ -231,9 +231,9 @@ void CompileUnit::addSourceLine(DIE *Die, DINameSpace NS) {
|
|||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// addVariableAddress - Add DW_AT_location attribute for a
|
/// addVariableAddress - Add DW_AT_location attribute for a
|
||||||
/// DbgVariable based on provided MachineLocation.
|
/// DbgVariable based on provided MachineLocation.
|
||||||
void CompileUnit::addVariableAddress(DbgVariable *&DV, DIE *Die,
|
void CompileUnit::addVariableAddress(DbgVariable *&DV, DIE *Die,
|
||||||
MachineLocation Location) {
|
MachineLocation Location) {
|
||||||
if (DV->variableHasComplexAddress())
|
if (DV->variableHasComplexAddress())
|
||||||
addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
|
addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
|
||||||
@ -492,7 +492,7 @@ bool CompileUnit::addConstantValue(DIE *Die, const MachineOperand &MO,
|
|||||||
case 64: Form = dwarf::DW_FORM_data8; break;
|
case 64: Form = dwarf::DW_FORM_data8; break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
SignedConstant ? addSInt(Block, 0, Form, MO.getImm())
|
SignedConstant ? addSInt(Block, 0, Form, MO.getImm())
|
||||||
: addUInt(Block, 0, Form, MO.getImm());
|
: addUInt(Block, 0, Form, MO.getImm());
|
||||||
|
|
||||||
addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
|
addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
|
||||||
@ -535,7 +535,7 @@ bool CompileUnit::addConstantValue(DIE *Die, const ConstantInt *CI,
|
|||||||
case 16: form = dwarf::DW_FORM_data2; break;
|
case 16: form = dwarf::DW_FORM_data2; break;
|
||||||
case 32: form = dwarf::DW_FORM_data4; break;
|
case 32: form = dwarf::DW_FORM_data4; break;
|
||||||
case 64: form = dwarf::DW_FORM_data8; break;
|
case 64: form = dwarf::DW_FORM_data8; break;
|
||||||
default:
|
default:
|
||||||
form = Unsigned ? dwarf::DW_FORM_udata : dwarf::DW_FORM_sdata;
|
form = Unsigned ? dwarf::DW_FORM_udata : dwarf::DW_FORM_sdata;
|
||||||
}
|
}
|
||||||
if (Unsigned)
|
if (Unsigned)
|
||||||
@ -635,7 +635,7 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
|
|||||||
DwarfAccelTable::eTypeFlagClassIsImplementation : 0;
|
DwarfAccelTable::eTypeFlagClassIsImplementation : 0;
|
||||||
addAccelType(Ty.getName(), std::make_pair(TyDIE, Flags));
|
addAccelType(Ty.getName(), std::make_pair(TyDIE, Flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
addToContextOwner(TyDIE, Ty.getContext());
|
addToContextOwner(TyDIE, Ty.getContext());
|
||||||
return TyDIE;
|
return TyDIE;
|
||||||
}
|
}
|
||||||
@ -670,8 +670,8 @@ void CompileUnit::addType(DIE *Entity, DIType Ty, unsigned Attribute) {
|
|||||||
///
|
///
|
||||||
void CompileUnit::addGlobalType(DIType Ty) {
|
void CompileUnit::addGlobalType(DIType Ty) {
|
||||||
DIDescriptor Context = Ty.getContext();
|
DIDescriptor Context = Ty.getContext();
|
||||||
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
|
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
|
||||||
&& (!Context || Context.isCompileUnit() || Context.isFile()
|
&& (!Context || Context.isCompileUnit() || Context.isFile()
|
||||||
|| Context.isNameSpace()))
|
|| Context.isNameSpace()))
|
||||||
if (DIEEntry *Entry = getDIEEntry(Ty))
|
if (DIEEntry *Entry = getDIEEntry(Ty))
|
||||||
GlobalTypes[Ty.getName()] = Entry->getEntry();
|
GlobalTypes[Ty.getName()] = Entry->getEntry();
|
||||||
@ -830,7 +830,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
else if (SP.isPrivate())
|
else if (SP.isPrivate())
|
||||||
addUInt(ElemDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
addUInt(ElemDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
||||||
dwarf::DW_ACCESS_private);
|
dwarf::DW_ACCESS_private);
|
||||||
else
|
else
|
||||||
addUInt(ElemDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
addUInt(ElemDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
||||||
dwarf::DW_ACCESS_public);
|
dwarf::DW_ACCESS_public);
|
||||||
if (SP.isExplicit())
|
if (SP.isExplicit())
|
||||||
@ -878,7 +878,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
if (Property.isNonAtomicObjCProperty())
|
if (Property.isNonAtomicObjCProperty())
|
||||||
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
|
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
|
||||||
if (PropertyAttributes)
|
if (PropertyAttributes)
|
||||||
addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, 0,
|
addUInt(ElemDie, dwarf::DW_AT_APPLE_property_attribute, 0,
|
||||||
PropertyAttributes);
|
PropertyAttributes);
|
||||||
|
|
||||||
DIEEntry *Entry = getDIEEntry(Element);
|
DIEEntry *Entry = getDIEEntry(Element);
|
||||||
@ -951,7 +951,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE
|
/// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE
|
||||||
/// for the given DITemplateTypeParameter.
|
/// for the given DITemplateTypeParameter.
|
||||||
DIE *
|
DIE *
|
||||||
CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP) {
|
CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP) {
|
||||||
@ -965,7 +965,7 @@ CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP) {
|
|||||||
return ParamDIE;
|
return ParamDIE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getOrCreateTemplateValueParameterDIE - Find existing DIE or create new DIE
|
/// getOrCreateTemplateValueParameterDIE - Find existing DIE or create new DIE
|
||||||
/// for the given DITemplateValueParameter.
|
/// for the given DITemplateValueParameter.
|
||||||
DIE *
|
DIE *
|
||||||
CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TPV){
|
CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TPV){
|
||||||
@ -977,7 +977,7 @@ CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TPV){
|
|||||||
addType(ParamDIE, TPV.getType());
|
addType(ParamDIE, TPV.getType());
|
||||||
if (!TPV.getName().empty())
|
if (!TPV.getName().empty())
|
||||||
addString(ParamDIE, dwarf::DW_AT_name, TPV.getName());
|
addString(ParamDIE, dwarf::DW_AT_name, TPV.getName());
|
||||||
addUInt(ParamDIE, dwarf::DW_AT_const_value, dwarf::DW_FORM_udata,
|
addUInt(ParamDIE, dwarf::DW_AT_const_value, dwarf::DW_FORM_udata,
|
||||||
TPV.getValue());
|
TPV.getValue());
|
||||||
return ParamDIE;
|
return ParamDIE;
|
||||||
}
|
}
|
||||||
@ -1095,7 +1095,7 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
|||||||
|
|
||||||
if (!SP.isDefinition()) {
|
if (!SP.isDefinition()) {
|
||||||
addFlag(SPDie, dwarf::DW_AT_declaration);
|
addFlag(SPDie, dwarf::DW_AT_declaration);
|
||||||
|
|
||||||
// Add arguments. Do not add arguments for subprogram definition. They will
|
// Add arguments. Do not add arguments for subprogram definition. They will
|
||||||
// be handled while processing variables.
|
// be handled while processing variables.
|
||||||
DICompositeType SPTy = SP.getType();
|
DICompositeType SPTy = SP.getType();
|
||||||
@ -1213,7 +1213,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
|
|||||||
} else {
|
} else {
|
||||||
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
||||||
}
|
}
|
||||||
} else if (const ConstantInt *CI =
|
} else if (const ConstantInt *CI =
|
||||||
dyn_cast_or_null<ConstantInt>(GV.getConstant()))
|
dyn_cast_or_null<ConstantInt>(GV.getConstant()))
|
||||||
addConstantValue(VariableDIE, CI, GTy.isUnsignedDIType());
|
addConstantValue(VariableDIE, CI, GTy.isUnsignedDIType());
|
||||||
else if (const ConstantExpr *CE = getMergedGlobalExpr(N->getOperand(11))) {
|
else if (const ConstantExpr *CE = getMergedGlobalExpr(N->getOperand(11))) {
|
||||||
@ -1226,7 +1226,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
|
|||||||
Asm->Mang->getSymbol(cast<GlobalValue>(Ptr)));
|
Asm->Mang->getSymbol(cast<GlobalValue>(Ptr)));
|
||||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
|
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
|
||||||
SmallVector<Value*, 3> Idx(CE->op_begin()+1, CE->op_end());
|
SmallVector<Value*, 3> Idx(CE->op_begin()+1, CE->op_end());
|
||||||
addUInt(Block, 0, dwarf::DW_FORM_udata,
|
addUInt(Block, 0, dwarf::DW_FORM_udata,
|
||||||
Asm->getDataLayout().getIndexedOffset(Ptr->getType(), Idx));
|
Asm->getDataLayout().getIndexedOffset(Ptr->getType(), Idx));
|
||||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_plus);
|
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_plus);
|
||||||
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
||||||
@ -1255,7 +1255,7 @@ void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
|
|||||||
|
|
||||||
// The L value defines the lower bounds which is typically zero for C/C++. The
|
// The L value defines the lower bounds which is typically zero for C/C++. The
|
||||||
// H value is the upper bounds. Values are 64 bit. H - L + 1 is the size
|
// H value is the upper bounds. Values are 64 bit. H - L + 1 is the size
|
||||||
// of the array. If L > H then do not emit DW_AT_lower_bound and
|
// of the array. If L > H then do not emit DW_AT_lower_bound and
|
||||||
// DW_AT_upper_bound attributes. If L is zero and H is also zero then the
|
// DW_AT_upper_bound attributes. If L is zero and H is also zero then the
|
||||||
// array has one element and in such case do not emit lower bound.
|
// array has one element and in such case do not emit lower bound.
|
||||||
|
|
||||||
@ -1376,20 +1376,20 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable *DV, bool isScopeAbstract) {
|
|||||||
TRI->getFrameRegister(*Asm->MF) == RegOp.getReg()) {
|
TRI->getFrameRegister(*Asm->MF) == RegOp.getReg()) {
|
||||||
unsigned FrameReg = 0;
|
unsigned FrameReg = 0;
|
||||||
const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
|
const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
|
||||||
int Offset =
|
int Offset =
|
||||||
TFI->getFrameIndexReference(*Asm->MF,
|
TFI->getFrameIndexReference(*Asm->MF,
|
||||||
DVInsn->getOperand(1).getImm(),
|
DVInsn->getOperand(1).getImm(),
|
||||||
FrameReg);
|
FrameReg);
|
||||||
MachineLocation Location(FrameReg, Offset);
|
MachineLocation Location(FrameReg, Offset);
|
||||||
addVariableAddress(DV, VariableDie, Location);
|
addVariableAddress(DV, VariableDie, Location);
|
||||||
|
|
||||||
} else if (RegOp.getReg())
|
} else if (RegOp.getReg())
|
||||||
addVariableAddress(DV, VariableDie,
|
addVariableAddress(DV, VariableDie,
|
||||||
MachineLocation(RegOp.getReg()));
|
MachineLocation(RegOp.getReg()));
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
else if (DVInsn->getOperand(0).isImm())
|
else if (DVInsn->getOperand(0).isImm())
|
||||||
updated =
|
updated =
|
||||||
addConstantValue(VariableDie, DVInsn->getOperand(0),
|
addConstantValue(VariableDie, DVInsn->getOperand(0),
|
||||||
DV->getType());
|
DV->getType());
|
||||||
else if (DVInsn->getOperand(0).isFPImm())
|
else if (DVInsn->getOperand(0).isFPImm())
|
||||||
@ -1397,11 +1397,11 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable *DV, bool isScopeAbstract) {
|
|||||||
addConstantFPValue(VariableDie, DVInsn->getOperand(0));
|
addConstantFPValue(VariableDie, DVInsn->getOperand(0));
|
||||||
else if (DVInsn->getOperand(0).isCImm())
|
else if (DVInsn->getOperand(0).isCImm())
|
||||||
updated =
|
updated =
|
||||||
addConstantValue(VariableDie,
|
addConstantValue(VariableDie,
|
||||||
DVInsn->getOperand(0).getCImm(),
|
DVInsn->getOperand(0).getCImm(),
|
||||||
DV->getType().isUnsignedDIType());
|
DV->getType().isUnsignedDIType());
|
||||||
} else {
|
} else {
|
||||||
addVariableAddress(DV, VariableDie,
|
addVariableAddress(DV, VariableDie,
|
||||||
Asm->getDebugValueLocation(DVInsn));
|
Asm->getDebugValueLocation(DVInsn));
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
@ -1419,7 +1419,7 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable *DV, bool isScopeAbstract) {
|
|||||||
if (FI != ~0) {
|
if (FI != ~0) {
|
||||||
unsigned FrameReg = 0;
|
unsigned FrameReg = 0;
|
||||||
const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
|
const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
|
||||||
int Offset =
|
int Offset =
|
||||||
TFI->getFrameIndexReference(*Asm->MF, FI, FrameReg);
|
TFI->getFrameIndexReference(*Asm->MF, FI, FrameReg);
|
||||||
MachineLocation Location(FrameReg, Offset);
|
MachineLocation Location(FrameReg, Offset);
|
||||||
addVariableAddress(DV, VariableDie, Location);
|
addVariableAddress(DV, VariableDie, Location);
|
||||||
@ -1499,7 +1499,7 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
|
|||||||
addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
||||||
dwarf::DW_ACCESS_private);
|
dwarf::DW_ACCESS_private);
|
||||||
// Otherwise C++ member and base classes are considered public.
|
// Otherwise C++ member and base classes are considered public.
|
||||||
else
|
else
|
||||||
addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_data1,
|
||||||
dwarf::DW_ACCESS_public);
|
dwarf::DW_ACCESS_public);
|
||||||
if (DT.isVirtual())
|
if (DT.isVirtual())
|
||||||
@ -1509,7 +1509,7 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
|
|||||||
// Objective-C properties.
|
// Objective-C properties.
|
||||||
if (MDNode *PNode = DT.getObjCProperty())
|
if (MDNode *PNode = DT.getObjCProperty())
|
||||||
if (DIEEntry *PropertyDie = getDIEEntry(PNode))
|
if (DIEEntry *PropertyDie = getDIEEntry(PNode))
|
||||||
MemberDie->addValue(dwarf::DW_AT_APPLE_property, dwarf::DW_FORM_ref4,
|
MemberDie->addValue(dwarf::DW_AT_APPLE_property, dwarf::DW_FORM_ref4,
|
||||||
PropertyDie);
|
PropertyDie);
|
||||||
|
|
||||||
// This is only for backward compatibility.
|
// This is only for backward compatibility.
|
||||||
@ -1536,7 +1536,7 @@ DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
|
|||||||
if (DT.isNonAtomicObjCProperty())
|
if (DT.isNonAtomicObjCProperty())
|
||||||
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
|
PropertyAttributes |= dwarf::DW_APPLE_PROPERTY_nonatomic;
|
||||||
if (PropertyAttributes)
|
if (PropertyAttributes)
|
||||||
addUInt(MemberDie, dwarf::DW_AT_APPLE_property_attribute, 0,
|
addUInt(MemberDie, dwarf::DW_AT_APPLE_property_attribute, 0,
|
||||||
PropertyAttributes);
|
PropertyAttributes);
|
||||||
}
|
}
|
||||||
return MemberDie;
|
return MemberDie;
|
||||||
|
Reference in New Issue
Block a user