rjmccall added a comment.

Exposing these operations seems fine, but I'm not thrilled about the APIs.  Of 
course, the APIs are exactly derived from IRGen's internal APIs, but we'd like 
to eventually clean those APIs up, and we certainly don't need to emulate them.



================
Comment at: include/clang/CodeGen/CodeGenABITypes.h:74
 
+llvm::Type *ConvertType(CodeGenModule &CGM, QualType T);
+
----------------
Is this one actually important to expose?  What sorts of future APIs are you 
expecting where clients will interact with IRGen other than in memory?

If we do need this, we should name it something clear so that people don't 
accidentally reach for it by default.  (This has actually been a pain point 
within IRGen for years.)  How about:

llvm;:Type *convertTypeForRValue(CodeGenModule &CGM, QualType type);


================
Comment at: include/clang/CodeGen/CodeGenABITypes.h:78
+                                QualType FT,
+                                const FunctionDecl *FD = nullptr);
+
----------------
Let's make this a specific API for getting the type of a function declaration.

llvm::FunctionType *convertFreeFunctionType(CodeGenModule &CGM, const 
FunctionDecl *FD);


================
Comment at: include/clang/CodeGen/CodeGenABITypes.h:80
+
+llvm::Type *ConvertTypeForMem(CodeGenModule &CGM, QualType T);
+
----------------
llvm::Type *convertTypeForMemory(CodeGenModule &CGM, QualType type);


https://reviews.llvm.org/D35180



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to