http://llvm.org/bugs/show_bug.cgi?id=14961

             Bug #: 14961
           Summary: Please use more explicit parameter names in headers
           Product: new-bugs
           Version: 3.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


As someone relatively new to LLVM, I find some things confusing. In this
instance, I'm using the Kaleidoscope Chapter 3 tutorial as a guide to how to
use LLVM in my own project. I looked at Type.h, line 395 (release_32):


  static PointerType *getInt8PtrTy(LLVMContext &C, unsigned AS = 0);

There are many lines like that. Note the names of the parameters, "C" and "AS".
While C's purpose is fairly easily inferred from its type, AS's purpose was
not. If instead the parameter name was "AddressSpace", it would've been
immediately apparent.

Similarly, on line 375:

  static IntegerType *getIntNTy(LLVMContext &C, unsigned N);

"N" is much more clear when written as "BitWidth" or something like that.

Note that although "C" is clear in the parameter declaration, it's probably
much less clear in the implementation, where it may appear several lines away
from the declaration. By convention, one can learn that "C" means "Context",
but using something a little more apparent, like "Context" or "CTX" makes
perusing the code a lot easier.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to