[LLVMdev] clang and static functions

Arvind Sudarsanam arvind.sudarsanam at aggiemail.usu.edu
Mon Dec 14 12:18:37 PST 2009


Hi,

Sorry for not being specific. I just wanted to know if there is any
way at all to force clang to generate intermediate code for static
functions when they are not being called anywhere inside the current
module. Other compilers seem to generate intermediate code (lcc, for
instance).

Thanks for your reply..Olivier.

Sincerely
Arvind

On Mon, Dec 14, 2009 at 1:10 PM, Olivier Meurant
<meurant.olivier at gmail.com> wrote:
> Hi Arvind,
>
> you need to use it effectively :
>
>
> static int add(int a, int b) {
>         return a+b;
> }
> int use() {
>         return add(4,5);
> }
>
> ==>
>
> ; ModuleID = '<stdin>'
> target datalayout =
> "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
> target triple = "i386-pc-linux-gnu"
>
> define i32 @use() nounwind {
> [...]
> }
>
> define internal i32 @add(i32 %a, i32 %b) nounwind {
> [...]
> }
>
> Olivier.
>
>
> On Mon, Dec 14, 2009 at 8:49 PM, Arvind Sudarsanam
> <arvind.sudarsanam at aggiemail.usu.edu> wrote:
>>
>> Hi,
>>
>> I am trying to compile a single module (dgemm.c) using clang and
>> generate dgemm.ll.
>> Command: clang -emit-llvm dgemm.c -S -o dgemm.ll
>> Some of the functions are declared as static and clang ignores these
>> functions:
>>
>> One of the functions is:
>> static void innerloop(double a, const double* b, double* c, double beta)
>> {
>>  *b = a*beta;
>>   return;
>> }
>>
>> Is there any way to make clang generate llvm code for the static
>> functions?
>>
>> Thanks
>> Sincerely
>> Arvind
>>
>> --
>> Arvind Sudarsanam
>> Utah State University
>> Phone: (435) 512-7769
>> E-mail: theonemorpheus at gmail.com
>> Web-site: http://cc.usu.edu/~asudarsanam
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>



-- 
Arvind Sudarsanam
Utah State University
Phone: (435) 512-7769
E-mail: theonemorpheus at gmail.com
Web-site: http://cc.usu.edu/~asudarsanam




More information about the llvm-dev mailing list