[llvm-commits] [llvm] r52046 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp
Evan Cheng
evan.cheng at apple.com
Sat Jun 7 00:49:58 PDT 2008
Hi Anton,
This breaks cbe on x86 Mac OS X pretty badly. Lots of tests are
failing with this:
gcc Output/cfrac.cbe.c -o Output/cfrac.cbe -lm -O3 -fno-strict-
aliasing -fno-inline -mdynamic-no-pic -fomit-frame-pointer
Output/cfrac.cbe.c:380: warning: conflicting types for built-in
function 'malloc'
Output/cfrac.cbe.c:385: warning: conflicting types for built-in
function 'sqrtl'
Output/cfrac.cbe.c: In function 'main':
Output/cfrac.cbe.c:2978: warning: return type of 'main' is not 'int'
/var/tmp//ccU4O5JJ.s:8875:FATAL:Symbol LC1 already defined.
make[1]: [Output/cfrac.cbe] Error 1 (ignored)
I'll back it out for now. Please fix.
Thanks,
Evan
On Jun 6, 2008, at 9:08 AM, Anton Korobeynikov wrote:
> Author: asl
> Date: Fri Jun 6 11:08:26 2008
> New Revision: 52046
>
> URL: http://llvm.org/viewvc/llvm-project?rev=52046&view=rev
> Log:
> Handle assembler identifiers specially in CBE. This fixes PR2418.
>
> Modified:
> llvm/trunk/lib/Target/CBackend/CBackend.cpp
>
> Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=52046&r1=52045&r2=52046&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
> +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Fri Jun 6 11:08:26
> 2008
> @@ -1224,6 +1224,10 @@
> Name = "llvm_cbe_" + VarName;
> } else {
> Name = Mang->getValueName(Operand);
> +
> + // Check, if operand has assembler identifier and handle it
> separately
> + if (Operand->getNameStart()[0] == 1)
> + Name = "llvm_cbe_asmname_" + Name;
> }
>
> return Name;
> @@ -1652,6 +1656,11 @@
>
> if (I->hasExternalWeakLinkage())
> Out << " __EXTERNAL_WEAK__";
> +
> + // Special handling for assembler identifiers
> + if (I->getNameStart()[0] == 1)
> + Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")";
> +
> Out << ";\n";
> }
> }
> @@ -1661,7 +1670,7 @@
> Out << "double fmod(double, double);\n"; // Support for FP rem
> Out << "float fmodf(float, float);\n";
> Out << "long double fmodl(long double, long double);\n";
> -
> +
> for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
> // Don't print declarations for intrinsic functions.
> if (!I->isIntrinsic() && I->getName() != "setjmp" &&
> @@ -1669,7 +1678,7 @@
> if (I->hasExternalWeakLinkage())
> Out << "extern ";
> printFunctionSignature(I, true);
> - if (I->hasWeakLinkage() || I->hasLinkOnceLinkage())
> + if (I->hasWeakLinkage() || I->hasLinkOnceLinkage())
> Out << " __ATTRIBUTE_WEAK__";
> if (I->hasExternalWeakLinkage())
> Out << " __EXTERNAL_WEAK__";
> @@ -1679,10 +1688,11 @@
> Out << " __ATTRIBUTE_DTOR__";
> if (I->hasHiddenVisibility())
> Out << " __HIDDEN__";
> -
> - if (I->hasName() && I->getName()[0] == 1)
> +
> + // Special handling for assembler identifiers
> + if (I->getNameStart()[0] == 1)
> Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")";
> -
> +
> Out << ";\n";
> }
> }
> @@ -1719,6 +1729,11 @@
> Out << " __EXTERNAL_WEAK__";
> if (I->hasHiddenVisibility())
> Out << " __HIDDEN__";
> +
> + // Special handling for assembler identifiers
> + if (I->getNameStart()[0] == 1)
> + Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")";
> +
> Out << ";\n";
> }
> }
> @@ -1726,7 +1741,7 @@
> // Output the global variable definitions and contents...
> if (!M.global_empty()) {
> Out << "\n\n/* Global Variable Definitions and Initialization */
> \n";
> - for (Module::global_iterator I = M.global_begin(), E =
> M.global_end();
> + for (Module::global_iterator I = M.global_begin(), E =
> M.global_end();
> I != E; ++I)
> if (!I->isDeclaration()) {
> // Ignore special globals, such as debug info.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list