mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	Make functions with an "asm" name propagate that asm name into the cbe.c file.
This fixes link errors on programs with these on targets with prefixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -921,6 +921,7 @@ static void generateCompilerSpecificCode(std::ostream& Out) { | ||||
|                               "__builtin_prefetch(addr,rw,locality)\n" | ||||
|       << "#define __ATTRIBUTE_CTOR__ __attribute__((constructor))\n" | ||||
|       << "#define __ATTRIBUTE_DTOR__ __attribute__((destructor))\n" | ||||
|       << "#define LLVM_ASM           __asm__\n" | ||||
|       << "#else\n" | ||||
|       << "#define LLVM_NAN(NanStr)   ((double)0.0)           /* Double */\n" | ||||
|       << "#define LLVM_NANF(NanStr)  0.0F                    /* Float */\n" | ||||
| @@ -931,6 +932,7 @@ static void generateCompilerSpecificCode(std::ostream& Out) { | ||||
|       << "#define LLVM_PREFETCH(addr,rw,locality)            /* PREFETCH */\n" | ||||
|       << "#define __ATTRIBUTE_CTOR__\n" | ||||
|       << "#define __ATTRIBUTE_DTOR__\n" | ||||
|       << "#define LLVM_ASM(X)\n" | ||||
|       << "#endif\n\n"; | ||||
|  | ||||
|   // Output target-specific code that should be inserted into main. | ||||
| @@ -1072,6 +1074,10 @@ bool CWriter::doInitialization(Module &M) { | ||||
|         Out << " __ATTRIBUTE_CTOR__"; | ||||
|       if (StaticDtors.count(I)) | ||||
|         Out << " __ATTRIBUTE_DTOR__"; | ||||
|        | ||||
|       if (I->hasName() && I->getName()[0] == 1) | ||||
|         Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")"; | ||||
|            | ||||
|       Out << ";\n"; | ||||
|     } | ||||
|   } | ||||
|   | ||||
| @@ -921,6 +921,7 @@ static void generateCompilerSpecificCode(std::ostream& Out) { | ||||
|                               "__builtin_prefetch(addr,rw,locality)\n" | ||||
|       << "#define __ATTRIBUTE_CTOR__ __attribute__((constructor))\n" | ||||
|       << "#define __ATTRIBUTE_DTOR__ __attribute__((destructor))\n" | ||||
|       << "#define LLVM_ASM           __asm__\n" | ||||
|       << "#else\n" | ||||
|       << "#define LLVM_NAN(NanStr)   ((double)0.0)           /* Double */\n" | ||||
|       << "#define LLVM_NANF(NanStr)  0.0F                    /* Float */\n" | ||||
| @@ -931,6 +932,7 @@ static void generateCompilerSpecificCode(std::ostream& Out) { | ||||
|       << "#define LLVM_PREFETCH(addr,rw,locality)            /* PREFETCH */\n" | ||||
|       << "#define __ATTRIBUTE_CTOR__\n" | ||||
|       << "#define __ATTRIBUTE_DTOR__\n" | ||||
|       << "#define LLVM_ASM(X)\n" | ||||
|       << "#endif\n\n"; | ||||
|  | ||||
|   // Output target-specific code that should be inserted into main. | ||||
| @@ -1072,6 +1074,10 @@ bool CWriter::doInitialization(Module &M) { | ||||
|         Out << " __ATTRIBUTE_CTOR__"; | ||||
|       if (StaticDtors.count(I)) | ||||
|         Out << " __ATTRIBUTE_DTOR__"; | ||||
|        | ||||
|       if (I->hasName() && I->getName()[0] == 1) | ||||
|         Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")"; | ||||
|            | ||||
|       Out << ";\n"; | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user