[llvm] r246268 - Kaleidoscope: Prune __attribute__((used)). Some compilers wouldn't accept one.

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 08:33:50 PDT 2015


> On 2015-Aug-27, at 20:34, NAKAMURA Takumi via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: chapuni
> Date: Thu Aug 27 22:34:33 2015
> New Revision: 246268
> 
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D246268-26view-3Drev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=5CS3COkvNYjd3bC62S2ycxuhn2NWGeVETPNho8Xcvs8&e= 
> Log:
> Kaleidoscope: Prune __attribute__((used)). Some compilers wouldn't accept one.
> 
> Modified:
>    llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp
>    llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp
>    llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp
>    llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp
>    llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_examples_Kaleidoscope_Chapter4_toy.cpp-3Frev-3D246268-26r1-3D246267-26r2-3D246268-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=kJ9SmWss3yPYYTdC-4SKvvmAiSXQLnuqKE_Rd91oVec&e= 
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp Thu Aug 27 22:34:33 2015
> @@ -631,13 +631,13 @@ static void MainLoop() {
> //===----------------------------------------------------------------------===//
> 
> /// putchard - putchar that takes a double and returns 0.
> -__attribute__((used)) extern "C" double putchard(double X) {

Shouldn't this just be changed to `LLVM_ATTRIBUTE_USED`?

> +extern "C" double putchard(double X) {
>   fputc((char)X, stderr);
>   return 0;
> }
> 
> /// printd - printf that takes a double prints it as "%f\n", returning 0.
> -__attribute__((used)) extern "C" double printd(double X) {
> +extern "C" double printd(double X) {
>   fprintf(stderr, "%f\n", X);
>   return 0;
> }
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_examples_Kaleidoscope_Chapter5_toy.cpp-3Frev-3D246268-26r1-3D246267-26r2-3D246268-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=xQG8zj6vlMLUtTep8k9vgo4gZZT6-EF9vNAiZKKiK74&e= 
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp Thu Aug 27 22:34:33 2015
> @@ -905,13 +905,13 @@ static void MainLoop() {
> //===----------------------------------------------------------------------===//
> 
> /// putchard - putchar that takes a double and returns 0.
> -__attribute__((used)) extern "C" double putchard(double X) {
> +extern "C" double putchard(double X) {
>   fputc((char)X, stderr);
>   return 0;
> }
> 
> /// printd - printf that takes a double prints it as "%f\n", returning 0.
> -__attribute__((used)) extern "C" double printd(double X) {
> +extern "C" double printd(double X) {
>   fprintf(stderr, "%f\n", X);
>   return 0;
> }
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_examples_Kaleidoscope_Chapter6_toy.cpp-3Frev-3D246268-26r1-3D246267-26r2-3D246268-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=H74dIbLs4H9ac8YLn6iojVRW36Ol2vsNMuEZOk7NlMU&e= 
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp Thu Aug 27 22:34:33 2015
> @@ -1023,13 +1023,13 @@ static void MainLoop() {
> //===----------------------------------------------------------------------===//
> 
> /// putchard - putchar that takes a double and returns 0.
> -__attribute__((used)) extern "C" double putchard(double X) {
> +extern "C" double putchard(double X) {
>   fputc((char)X, stderr);
>   return 0;
> }
> 
> /// printd - printf that takes a double prints it as "%f\n", returning 0.
> -__attribute__((used)) extern "C" double printd(double X) {
> +extern "C" double printd(double X) {
>   fprintf(stderr, "%f\n", X);
>   return 0;
> }
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_examples_Kaleidoscope_Chapter7_toy.cpp-3Frev-3D246268-26r1-3D246267-26r2-3D246268-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=WhR6UBVjdkAS5J8tqgL0Ak8uxiXumg3atdHa8oBwsJ8&e= 
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp Thu Aug 27 22:34:33 2015
> @@ -1189,13 +1189,13 @@ static void MainLoop() {
> //===----------------------------------------------------------------------===//
> 
> /// putchard - putchar that takes a double and returns 0.
> -__attribute__((used)) extern "C" double putchard(double X) {
> +extern "C" double putchard(double X) {
>   fputc((char)X, stderr);
>   return 0;
> }
> 
> /// printd - printf that takes a double prints it as "%f\n", returning 0.
> -__attribute__((used)) extern "C" double printd(double X) {
> +extern "C" double printd(double X) {
>   fprintf(stderr, "%f\n", X);
>   return 0;
> }
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_examples_Kaleidoscope_Chapter8_toy.cpp-3Frev-3D246268-26r1-3D246267-26r2-3D246268-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=qdqsUgLgv6PX6JCR3AUFlJxFMPsoRYKQlH4C3iZXL2A&e= 
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp Thu Aug 27 22:34:33 2015
> @@ -1383,13 +1383,13 @@ static void MainLoop() {
> //===----------------------------------------------------------------------===//
> 
> /// putchard - putchar that takes a double and returns 0.
> -__attribute__((used)) extern "C" double putchard(double X) {
> +extern "C" double putchard(double X) {
>   fputc((char)X, stderr);
>   return 0;
> }
> 
> /// printd - printf that takes a double prints it as "%f\n", returning 0.
> -__attribute__((used)) extern "C" double printd(double X) {
> +extern "C" double printd(double X) {
>   fprintf(stderr, "%f\n", X);
>   return 0;
> }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=vftFLnHiqThJHdL0qZWd_Vo12qdMVOZDFnNVBhP9GKA&m=9gNvxlCajep7hmuUKbq-S5ocWnvIHy4voIF6DpkAZ-A&s=qWg3XP-AtMSx4UCijzaNUXgv5E3hX6MeVmk6ptRIJ-c&e= 



More information about the llvm-commits mailing list