<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Hui,<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Hope that helps,<br>
<br>
John Criswell<br>
<br>
<br>
<br>
On 10/1/14, 2:59 PM, Hui Zhang wrote:<br>
</div>
<blockquote
cite="mid:CAHUsaREGB0LDc=frF2WTjPg2QDCuwdjUJTDVdS0CQQSFKkKZ5g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:georgia,serif;font-size:large">Hello,<br>
<br>
</div>
<div class="gmail_default"
style="font-family:georgia,serif;font-size:large">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. <br>
<br>
</div>
<div class="gmail_default"
style="font-family:georgia,serif;font-size:large">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) ???<br>
<br>
</div>
<div class="gmail_default"
style="font-family:georgia,serif;font-size:large">thanks !!! <br
clear="all">
</div>
<br>
-- <br>
Best regards<br>
<br>
<br>
Hui Zhang<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>