[LLVMdev] Convenience methods in ConstantExpr et al
Talin
viridia at gmail.com
Thu Feb 3 12:41:53 PST 2011
On Thu, Feb 3, 2011 at 12:53 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Talin,
>
> > I find that I call the static methods in ConstantExpr a *lot* without
> going
> > through IRBuilder - hundreds of times in my frontend. My language
> generates a
> > lot of static data - reflection information, trace tables for the garbage
> > collector, dispatch tables, runtime annotations, static object instances,
> and so
> > on. (In fact there's a special helper class "StructBuilder" that
> automates a lot
> > of the work of building constant structs, such as adding the standard
> object
> > header and so on.)
>
> I think it would be better to create a ConstBuilder class rather than add
> stuff
> to ConstantExpr.
>
OK I'll do that. A few questions:
1) Capitalize method names or not? I see both styles - the style guide says
lower case, but it appears that the newer code is using capitalized method
names.
2) Should methods be named "CreateXXX" (like IRBuilder) or "GetXXX" (like
ConstantExpr).
3) Should method comments use @brief or repeat the method name - I see both
styles in the code.
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110203/f3ede04c/attachment.html>
More information about the llvm-dev
mailing list