[cfe-dev] how to replace function call with actual code of function body?

Yonggang Chen via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 22 21:03:24 PDT 2017


Hello all,

 

int main()

{

    auto n = 9;

    auto x = cacul(n);

return 0;
}

 

int cacul(int x)

{

         return x * x + 3;

}

 

Suppose I have function main(), in which cacul(int x) is called.

Now I want Clang help me do this:

 

int main()

{

    auto n = 9;

    auto x = n * n + 3;

return 0;
}

 

int cacul(int x)

{

         return x * x + 3;

}

 

That's to say, remove reference to cacul. Can Clang help me do that? If so,
how to do it?

 

Best regards

Yonggang Chen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170623/c059863c/attachment.html>


More information about the cfe-dev mailing list