<div dir="ltr">Ping on this layering violation. A simple way to demonstrate this is to move the definition of clang::Type::getTypeClass out of line: This results in an unresolved symbol due to incorrect/broken dependencies.<br><br>Richard? Anyone else? Ideas on how to address this layering violation?<br><br>Anastasia: Could you explain more what you mean by "A large logical dependency" - which bits of code expose/demonstrate that dependency? (I know very little about this code, I came across the layering violation while trying to build more of Clang & LLVM with modular code generation)<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 12, 2017 at 6:51 AM Anastasia Stulova via Phabricator via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anastasia added inline comments.<br>
<br>
<br>
================<br>
Comment at: cfe/trunk/lib/Basic/TargetInfo.cpp:351<br>
<br>
+LangAS::ID TargetInfo::getOpenCLTypeAddrSpace(const Type *T) const {<br>
+ auto BT = dyn_cast<BuiltinType>(T);<br>
----------------<br>
chapuni wrote:<br>
> Excuse me for old commit, I think it might be layering violation.<br>
> Could we avoid using AST/Type here?<br>
One of the problems is that even if we could write another layer of enums to map OpenCL specific AST types into the TargetInfo representation it doesn't really help creating a layered structure between AST and Basic libs. They seem to have a large logical dependence despite not including the library headers physically. So modification in AST would require modifications in Basic anyway resulting in overhead of changing 2 places instead of 1. So I am wondering if there is any better approach here e.g. revisiting the library dependencies or what classes they should contain?<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D33989" rel="noreferrer" target="_blank">https://reviews.llvm.org/D33989</a><br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>