mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Keep track of DIType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -643,6 +643,9 @@ namespace llvm {
|
|||||||
// addSubprogram - Add subprgoram into SPs.
|
// addSubprogram - Add subprgoram into SPs.
|
||||||
bool addSubprogram(DISubprogram SP);
|
bool addSubprogram(DISubprogram SP);
|
||||||
|
|
||||||
|
/// addType - Add type into Tys.
|
||||||
|
bool addType(DIType DT);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef SmallVector<GlobalVariable *, 8>::iterator iterator;
|
typedef SmallVector<GlobalVariable *, 8>::iterator iterator;
|
||||||
iterator compile_unit_begin() { return CUs.begin(); }
|
iterator compile_unit_begin() { return CUs.begin(); }
|
||||||
@ -651,15 +654,19 @@ namespace llvm {
|
|||||||
iterator subprogram_end() { return SPs.end(); }
|
iterator subprogram_end() { return SPs.end(); }
|
||||||
iterator global_variable_begin() { return GVs.begin(); }
|
iterator global_variable_begin() { return GVs.begin(); }
|
||||||
iterator global_variable_end() { return GVs.end(); }
|
iterator global_variable_end() { return GVs.end(); }
|
||||||
|
iterator type_begin() { return TYs.begin(); }
|
||||||
|
iterator type_end() { return TYs.end(); }
|
||||||
|
|
||||||
unsigned compile_unit_count() { return CUs.size(); }
|
unsigned compile_unit_count() { return CUs.size(); }
|
||||||
unsigned global_variable_count() { return GVs.size(); }
|
unsigned global_variable_count() { return GVs.size(); }
|
||||||
unsigned subprogram_count() { return SPs.size(); }
|
unsigned subprogram_count() { return SPs.size(); }
|
||||||
|
unsigned type_count() { return TYs.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SmallVector<GlobalVariable *, 8> CUs; // Compile Units
|
SmallVector<GlobalVariable *, 8> CUs; // Compile Units
|
||||||
SmallVector<GlobalVariable *, 8> SPs; // Subprograms
|
SmallVector<GlobalVariable *, 8> SPs; // Subprograms
|
||||||
SmallVector<GlobalVariable *, 8> GVs; // Global Variables;
|
SmallVector<GlobalVariable *, 8> GVs; // Global Variables
|
||||||
|
SmallVector<GlobalVariable *, 8> TYs; // Types
|
||||||
SmallPtrSet<GlobalVariable *, 64> NodesSeen;
|
SmallPtrSet<GlobalVariable *, 64> NodesSeen;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -955,9 +955,7 @@ void DebugInfoFinder::processModule(Module &M) {
|
|||||||
|
|
||||||
/// processType - Process DIType.
|
/// processType - Process DIType.
|
||||||
void DebugInfoFinder::processType(DIType DT) {
|
void DebugInfoFinder::processType(DIType DT) {
|
||||||
if (DT.isNull())
|
if (!addType(DT))
|
||||||
return;
|
|
||||||
if (!NodesSeen.insert(DT.getGV()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
addCompileUnit(DT.getCompileUnit());
|
addCompileUnit(DT.getCompileUnit());
|
||||||
@ -1028,6 +1026,18 @@ void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) {
|
|||||||
processType(DV.getType());
|
processType(DV.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// addType - Add type into Tys.
|
||||||
|
bool DebugInfoFinder::addType(DIType DT) {
|
||||||
|
if (DT.isNull())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!NodesSeen.insert(DT.getGV()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
TYs.push_back(DT.getGV());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// addCompileUnit - Add compile unit into CUs.
|
/// addCompileUnit - Add compile unit into CUs.
|
||||||
bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
|
bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
|
||||||
if (CU.isNull())
|
if (CU.isNull())
|
||||||
|
Reference in New Issue
Block a user