Hello, I don't know if anyone gets familiar with the llvm Chapel front end, it's version 3.3 and comes within Chapel source package. I'm trying to parse the .bc code generated from a simple helloworld chapel program. Just run a basic Hello pass on the code (default one in the llvm source code) that prints out all the function names in the module. However, it prints a bunch of functions (hundreds with weird names) for a simple hello world chapel program (it should be just "main" or null since Chapel programs doesn't necessarily need a function definition inside). SO why did "weird" functions come out and how can I remove them from what I need (only functions from the source Chapel program) ??? thanks !!! -- Best regards Hui Zhang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141001/9f1209d7/attachment.html>
Hello, All Does anyone know about the LLVM support for Chapel project ? I couldn't find any useful document online so if anyone can give me some sort of information, I really appreciate that. thanks ! On Wed, Oct 1, 2014 at 2:59 PM, Hui Zhang <wayne.huizhang at gmail.com> wrote:> Hello, > > I don't know if anyone gets familiar with the llvm Chapel front end, it's > version 3.3 and comes within Chapel source package. I'm trying to parse the > .bc code generated from a simple helloworld chapel program. > > Just run a basic Hello pass on the code (default one in the llvm source > code) that prints out all the function names in the module. However, it > prints a bunch of functions (hundreds with weird names) for a simple hello > world chapel program (it should be just "main" or null since Chapel > programs doesn't necessarily need a function definition inside). SO why > did "weird" functions come out and how can I remove them from what I need > (only functions from the source Chapel program) ??? > > thanks !!! > > -- > Best regards > > > Hui Zhang >-- Best regards Hui Zhang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141002/0042d953/attachment.html>
Dear Hui, I'm not familiar with the Chapel LLVM front-end. However, I suspect the weird functions that you are seeing are either function declarations for functions within Chapel's run-time library (i.e., functions that implement part of the language's functionality) or constructor functions for the language. All code in the LLVM IR needs to be inside of a function, and so the Chapel compiler will need to put any code it generates into an LLVM function. As to your question of how to determine which functions are from the source code and which are not, that can be a bit tricky. You can probably ignore any function declarations (functions which have no basic blocks). As to whether the remaining functions are from the Chapel source code, there is no really good way to do that. One option is to use debug metadata to figure it out; another option is to look at the Chapel front-end and see if the functions it adds have names that your pass can recognize. All that said, your pass probably doesn't need to worry about whether a function is from the source code or added "behind the scenes" by the front-end compiler. Most analyses and optimizations treat them the same way. Hope that helps, John Criswell On 10/1/14, 2:59 PM, Hui Zhang wrote:> Hello, > > I don't know if anyone gets familiar with the llvm Chapel front end, > it's version 3.3 and comes within Chapel source package. I'm trying to > parse the .bc code generated from a simple helloworld chapel program. > > Just run a basic Hello pass on the code (default one in the llvm > source code) that prints out all the function names in the module. > However, it prints a bunch of functions (hundreds with weird names) > for a simple hello world chapel program (it should be just "main" or > null since Chapel programs doesn't necessarily need a function > definition inside). SO why did "weird" functions come out and how can > I remove them from what I need (only functions from the source Chapel > program) ??? > > thanks !!! > > -- > Best regards > > > Hui Zhang > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141002/45e99923/attachment.html>
Hi Hui Zhang, I have no clue about the Chapel project but I see that they have a sourceforge page and their own mailinglist. Maybe you'll have more luck if you try asking your question there. http://sourceforge.net/projects/chapel/ Cheers, Roel On 02/10/14 17:23, Hui Zhang wrote:> Hello, All > > Does anyone know about the LLVM support for Chapel project ? I couldn't > find any useful document online so if anyone can give me some sort of > information, I really appreciate that. > > thanks ! > > On Wed, Oct 1, 2014 at 2:59 PM, Hui Zhang <wayne.huizhang at gmail.com > <mailto:wayne.huizhang at gmail.com>> wrote: > > Hello, > > I don't know if anyone gets familiar with the llvm Chapel front end, > it's version 3.3 and comes within Chapel source package. I'm trying > to parse the .bc code generated from a simple helloworld chapel > program. > > Just run a basic Hello pass on the code (default one in the llvm > source code) that prints out all the function names in the module. > However, it prints a bunch of functions (hundreds with weird names) > for a simple hello world chapel program (it should be just "main" or > null since Chapel programs doesn't necessarily need a function > definition inside). SO why did "weird" functions come out and how > can I remove them from what I need (only functions from the source > Chapel program) ??? > > thanks !!! > > -- > Best regards > > > Hui Zhang > > > > > -- > Best regards > > > Hui Zhang > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >