mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
No functionality changes, primarily just changing tab indentation to space
indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -567,29 +567,28 @@ void CWriter::printModule(Module *M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// printSymbolTable - Run through symbol table looking for named constants
|
/// printSymbolTable - Run through symbol table looking for named constants
|
||||||
// if a named constant is found, emit it's declaration...
|
/// if a named constant is found, emit it's declaration...
|
||||||
// Assuming that symbol table has only types and constants.
|
/// Assuming that symbol table has only types and constants.
|
||||||
|
///
|
||||||
void CWriter::printSymbolTable(const SymbolTable &ST) {
|
void CWriter::printSymbolTable(const SymbolTable &ST) {
|
||||||
for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) {
|
for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) {
|
||||||
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
||||||
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
||||||
|
|
||||||
for (; I != End; ++I){
|
for (; I != End; ++I) {
|
||||||
const Value *V = I->second;
|
const Value *V = I->second;
|
||||||
if (const Type *Ty = dyn_cast<Type>(V)) {
|
if (const Type *Ty = dyn_cast<Type>(V))
|
||||||
if (const Type *STy = dyn_cast<StructType>(V)) {
|
if (const Type *STy = dyn_cast<StructType>(Ty)) {
|
||||||
string Name = "struct l_" + makeNameProper(I->first);
|
string Name = "struct l_" + makeNameProper(I->first);
|
||||||
Out << Name << ";\n";
|
Out << Name << ";\n";
|
||||||
TypeNames.insert(std::make_pair(STy, Name));
|
TypeNames.insert(std::make_pair(STy, Name));
|
||||||
}
|
} else {
|
||||||
else {
|
string Name = "l_" + makeNameProper(I->first);
|
||||||
string Name = "l_" + makeNameProper(I->first);
|
Out << "typedef ";
|
||||||
Out << "typedef ";
|
printType(Ty, Name, true);
|
||||||
printType(Ty, Name, true);
|
Out << ";\n";
|
||||||
Out << ";\n";
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,10 +600,9 @@ void CWriter::printSymbolTable(const SymbolTable &ST) {
|
|||||||
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
||||||
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
||||||
|
|
||||||
for (; I != End; ++I) {
|
for (; I != End; ++I)
|
||||||
if (const StructType *STy = dyn_cast<StructType>(I->second))
|
if (const StructType *STy = dyn_cast<StructType>(I->second))
|
||||||
parseStruct(STy);
|
parseStruct(STy);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,14 +612,14 @@ void CWriter::parseStruct(const Type *Ty) {
|
|||||||
if (const StructType *STy = dyn_cast<StructType>(Ty)){
|
if (const StructType *STy = dyn_cast<StructType>(Ty)){
|
||||||
//Check to see if we have already printed this struct
|
//Check to see if we have already printed this struct
|
||||||
if (StructPrinted.find(STy) == StructPrinted.end()){
|
if (StructPrinted.find(STy) == StructPrinted.end()){
|
||||||
for (StructType::ElementTypes::const_iterator
|
for (StructType::ElementTypes::const_iterator
|
||||||
I = STy->getElementTypes().begin(),
|
I = STy->getElementTypes().begin(),
|
||||||
E = STy->getElementTypes().end(); I != E; ++I) {
|
E = STy->getElementTypes().end(); I != E; ++I) {
|
||||||
const Type *Ty1 = dyn_cast<Type>(I->get());
|
const Type *Ty1 = dyn_cast<Type>(I->get());
|
||||||
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
||||||
parseStruct(Ty1);
|
parseStruct(Ty1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Print struct
|
//Print struct
|
||||||
StructPrinted.insert(STy);
|
StructPrinted.insert(STy);
|
||||||
string Name = TypeNames[STy];
|
string Name = TypeNames[STy];
|
||||||
@@ -629,7 +627,8 @@ void CWriter::parseStruct(const Type *Ty) {
|
|||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If it is an array check it's type and continue
|
|
||||||
|
// If it is an array, check it's type and continue
|
||||||
else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)){
|
else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)){
|
||||||
const Type *Ty1 = ATy->getElementType();
|
const Type *Ty1 = ATy->getElementType();
|
||||||
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
||||||
|
@@ -567,29 +567,28 @@ void CWriter::printModule(Module *M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// printSymbolTable - Run through symbol table looking for named constants
|
/// printSymbolTable - Run through symbol table looking for named constants
|
||||||
// if a named constant is found, emit it's declaration...
|
/// if a named constant is found, emit it's declaration...
|
||||||
// Assuming that symbol table has only types and constants.
|
/// Assuming that symbol table has only types and constants.
|
||||||
|
///
|
||||||
void CWriter::printSymbolTable(const SymbolTable &ST) {
|
void CWriter::printSymbolTable(const SymbolTable &ST) {
|
||||||
for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) {
|
for (SymbolTable::const_iterator TI = ST.begin(); TI != ST.end(); ++TI) {
|
||||||
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
||||||
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
||||||
|
|
||||||
for (; I != End; ++I){
|
for (; I != End; ++I) {
|
||||||
const Value *V = I->second;
|
const Value *V = I->second;
|
||||||
if (const Type *Ty = dyn_cast<Type>(V)) {
|
if (const Type *Ty = dyn_cast<Type>(V))
|
||||||
if (const Type *STy = dyn_cast<StructType>(V)) {
|
if (const Type *STy = dyn_cast<StructType>(Ty)) {
|
||||||
string Name = "struct l_" + makeNameProper(I->first);
|
string Name = "struct l_" + makeNameProper(I->first);
|
||||||
Out << Name << ";\n";
|
Out << Name << ";\n";
|
||||||
TypeNames.insert(std::make_pair(STy, Name));
|
TypeNames.insert(std::make_pair(STy, Name));
|
||||||
}
|
} else {
|
||||||
else {
|
string Name = "l_" + makeNameProper(I->first);
|
||||||
string Name = "l_" + makeNameProper(I->first);
|
Out << "typedef ";
|
||||||
Out << "typedef ";
|
printType(Ty, Name, true);
|
||||||
printType(Ty, Name, true);
|
Out << ";\n";
|
||||||
Out << ";\n";
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,10 +600,9 @@ void CWriter::printSymbolTable(const SymbolTable &ST) {
|
|||||||
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
SymbolTable::type_const_iterator I = ST.type_begin(TI->first);
|
||||||
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
SymbolTable::type_const_iterator End = ST.type_end(TI->first);
|
||||||
|
|
||||||
for (; I != End; ++I) {
|
for (; I != End; ++I)
|
||||||
if (const StructType *STy = dyn_cast<StructType>(I->second))
|
if (const StructType *STy = dyn_cast<StructType>(I->second))
|
||||||
parseStruct(STy);
|
parseStruct(STy);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,14 +612,14 @@ void CWriter::parseStruct(const Type *Ty) {
|
|||||||
if (const StructType *STy = dyn_cast<StructType>(Ty)){
|
if (const StructType *STy = dyn_cast<StructType>(Ty)){
|
||||||
//Check to see if we have already printed this struct
|
//Check to see if we have already printed this struct
|
||||||
if (StructPrinted.find(STy) == StructPrinted.end()){
|
if (StructPrinted.find(STy) == StructPrinted.end()){
|
||||||
for (StructType::ElementTypes::const_iterator
|
for (StructType::ElementTypes::const_iterator
|
||||||
I = STy->getElementTypes().begin(),
|
I = STy->getElementTypes().begin(),
|
||||||
E = STy->getElementTypes().end(); I != E; ++I) {
|
E = STy->getElementTypes().end(); I != E; ++I) {
|
||||||
const Type *Ty1 = dyn_cast<Type>(I->get());
|
const Type *Ty1 = dyn_cast<Type>(I->get());
|
||||||
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
||||||
parseStruct(Ty1);
|
parseStruct(Ty1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Print struct
|
//Print struct
|
||||||
StructPrinted.insert(STy);
|
StructPrinted.insert(STy);
|
||||||
string Name = TypeNames[STy];
|
string Name = TypeNames[STy];
|
||||||
@@ -629,7 +627,8 @@ void CWriter::parseStruct(const Type *Ty) {
|
|||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If it is an array check it's type and continue
|
|
||||||
|
// If it is an array, check it's type and continue
|
||||||
else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)){
|
else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)){
|
||||||
const Type *Ty1 = ATy->getElementType();
|
const Type *Ty1 = ATy->getElementType();
|
||||||
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
|
||||||
|
Reference in New Issue
Block a user