Ideally CompilerType would have no knowledge of clang or any individual
TypeSystem. Decoupling clang is relatively straightforward.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Should we add some sort of convenience function or a ClangCompilerType subclass of CompilerType that reduces the amount of boilerplate needed on the RHS?
I wouldn't mind adding something to reduce boilerplate, but I'm not sure it would actually look too different. A wrapper function or subclass constructor would need to take a ClangASTContext and a clang::QualType so we could avoid calls to getAsOpaquePtr() everywhere but that's about it I think?
Let's pick some random examples:
CompilerType(ClangASTContext::GetASTContext(m_ast_source.m_ast_context), generic_function_type.getAsOpaquePtr())
->
ClangASTContext::GetASTContext(m_ast_source.m_ast_context).GetCompilerType(generic_function_type)
or
CompilerType(this, llvm::cast<clang::AutoType>(qual_type)->getDeducedType().getAsOpaquePtr())
->
GetCompilerType(llvm::cast<clang::AutoType>(qual_type)->getDeducedType())
Perhaps it really doesn't matter too much.