[PATCH] D78793: Names for structs are held on the Context, not the Module. Move getTypeByName from Module to Type taking a Context parameter.

Nick Lewycky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 11:47:20 PDT 2020


nickwasmer added inline comments.


================
Comment at: llvm/include/llvm-c/Core.h:873
 
-/**
- * Obtain a Type from a module by its registered name.
- */
+/** Deprecated: Use LLVMGetTypeByName2 instead. */
 LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
----------------
jdoerfert wrote:
> 1) Should we use the deprecated attribute here?
> 2) We cannot use attribute((overrload)) can we?
1. There aren't any other uses of attribute deprecated, or any GNU-style attribute in the C API header files. At a guess, this might be for compatibility with non-GNU compilers.

2. We can't. It would change the symbol name of both of them, which would be an ABI break for the existing `LLVMGetTypeByName`.



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78793/new/

https://reviews.llvm.org/D78793





More information about the llvm-commits mailing list