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
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 7fdc060..cbd1360 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -921,6 +921,7 @@
"__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 @@
<< "#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 @@
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";
}
}