mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Bug fix: In preventing static global variables from being printed twice,
I also prevented external globals from being printed twice, but they should (extern declaration and definition). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4043 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -563,9 +563,8 @@ void CWriter::printModule(Module *M) {
|
|||||||
if (!M->gempty()) {
|
if (!M->gempty()) {
|
||||||
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
||||||
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
||||||
if (I->hasExternalLinkage())
|
if (I->hasInternalLinkage())
|
||||||
continue; // printed above!
|
Out << "static ";
|
||||||
Out << "static ";
|
|
||||||
printType(I->getType()->getElementType(), getValueName(I));
|
printType(I->getType()->getElementType(), getValueName(I));
|
||||||
|
|
||||||
if (I->hasInitializer()) {
|
if (I->hasInitializer()) {
|
||||||
|
@ -563,9 +563,8 @@ void CWriter::printModule(Module *M) {
|
|||||||
if (!M->gempty()) {
|
if (!M->gempty()) {
|
||||||
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
||||||
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
||||||
if (I->hasExternalLinkage())
|
if (I->hasInternalLinkage())
|
||||||
continue; // printed above!
|
Out << "static ";
|
||||||
Out << "static ";
|
|
||||||
printType(I->getType()->getElementType(), getValueName(I));
|
printType(I->getType()->getElementType(), getValueName(I));
|
||||||
|
|
||||||
if (I->hasInitializer()) {
|
if (I->hasInitializer()) {
|
||||||
|
Reference in New Issue
Block a user