<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 5/23/11 1:05 PM, George Baah wrote:
<blockquote
cite="mid:BANLkTimfqKy7zuztkFLpX8qd1cESx5uD1A@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi,
<div> I am writing a pass which is supposed to ignore library
functions. Is there a way to </div>
<div>distinguish functions declared and defined by a developer
from non-local functions (library functions)? </div>
<div>Thanks.</div>
</blockquote>
<br>
There is no reliable way to do this, but there are several
heuristics that will probably work well in practice.<br>
<br>
When analyzing a program, any function that is defined (i.e., has a
function body) most likely came from the program's source code. The
exception will be functions declared in system header files or C/C++
library header files.<br>
<br>
Any function that is declared but not defined (i.e., has no function
body) is either a function that is defined in another translation
unit (i.e., another source file) or defined in a system or language
library (e.g., libc). It is, in general, not possible to
distinguish between the two situations, although if you've linked
your entire program into a single bitcode file, the only external
functions are coming from library functions.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:BANLkTimfqKy7zuztkFLpX8qd1cESx5uD1A@mail.gmail.com"
type="cite">
<div><br>
</div>
<div>George</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
</body>
</html>