mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -156,8 +156,8 @@ static string makeNameProper(string x) {
|
|||||||
string CWriter::getValueName(const Value *V) {
|
string CWriter::getValueName(const Value *V) {
|
||||||
if (V->hasName()) { // Print out the label if it exists...
|
if (V->hasName()) { // Print out the label if it exists...
|
||||||
if (isa<GlobalValue>(V) && // Do not mangle globals...
|
if (isa<GlobalValue>(V) && // Do not mangle globals...
|
||||||
cast<GlobalValue>(V)->hasExternalLinkage() && // Unless it's internal or
|
cast<GlobalValue>(V)->hasExternalLinkage())// && // Unless it's internal or
|
||||||
!MangledGlobals.count(V)) // Unless the name would collide if we don't
|
//!MangledGlobals.count(V)) // Unless the name would collide if we don't
|
||||||
return makeNameProper(V->getName());
|
return makeNameProper(V->getName());
|
||||||
|
|
||||||
return "l" + utostr(V->getType()->getUniqueID()) + "_" +
|
return "l" + utostr(V->getType()->getUniqueID()) + "_" +
|
||||||
@@ -567,10 +567,14 @@ void CWriter::printModule(Module *M) {
|
|||||||
Out << "\n/* Function Declarations */\n";
|
Out << "\n/* Function Declarations */\n";
|
||||||
needsMalloc = true;
|
needsMalloc = true;
|
||||||
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
||||||
|
// If the function is external and the name collides don't print it.
|
||||||
|
// Sometimes the bytecode likes to have multiple "declerations" for external functions
|
||||||
|
if (I->hasInternalLinkage() || !MangledGlobals.count(I)){
|
||||||
printFunctionSignature(I, true);
|
printFunctionSignature(I, true);
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Print Malloc prototype if needed
|
// Print Malloc prototype if needed
|
||||||
if (needsMalloc){
|
if (needsMalloc){
|
||||||
|
@@ -156,8 +156,8 @@ static string makeNameProper(string x) {
|
|||||||
string CWriter::getValueName(const Value *V) {
|
string CWriter::getValueName(const Value *V) {
|
||||||
if (V->hasName()) { // Print out the label if it exists...
|
if (V->hasName()) { // Print out the label if it exists...
|
||||||
if (isa<GlobalValue>(V) && // Do not mangle globals...
|
if (isa<GlobalValue>(V) && // Do not mangle globals...
|
||||||
cast<GlobalValue>(V)->hasExternalLinkage() && // Unless it's internal or
|
cast<GlobalValue>(V)->hasExternalLinkage())// && // Unless it's internal or
|
||||||
!MangledGlobals.count(V)) // Unless the name would collide if we don't
|
//!MangledGlobals.count(V)) // Unless the name would collide if we don't
|
||||||
return makeNameProper(V->getName());
|
return makeNameProper(V->getName());
|
||||||
|
|
||||||
return "l" + utostr(V->getType()->getUniqueID()) + "_" +
|
return "l" + utostr(V->getType()->getUniqueID()) + "_" +
|
||||||
@@ -567,10 +567,14 @@ void CWriter::printModule(Module *M) {
|
|||||||
Out << "\n/* Function Declarations */\n";
|
Out << "\n/* Function Declarations */\n";
|
||||||
needsMalloc = true;
|
needsMalloc = true;
|
||||||
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
||||||
|
// If the function is external and the name collides don't print it.
|
||||||
|
// Sometimes the bytecode likes to have multiple "declerations" for external functions
|
||||||
|
if (I->hasInternalLinkage() || !MangledGlobals.count(I)){
|
||||||
printFunctionSignature(I, true);
|
printFunctionSignature(I, true);
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Print Malloc prototype if needed
|
// Print Malloc prototype if needed
|
||||||
if (needsMalloc){
|
if (needsMalloc){
|
||||||
|
Reference in New Issue
Block a user