<div dir="auto">Well, i removed the vtable from Value and Instruction recently, so that shouldn't be a problem anymore.</div><div class="gmail_extra"><br><div class="gmail_quote">On May 23, 2017 5:30 AM, "David Chisnall via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 23 May 2017, at 13:18, Jajoo, Malhar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi everyone,<br>
><br>
> I just had a question -<br>
><br>
> I am aware that LLVM supports it's own form of RTTI ( using dyn_cast<>() ,etc) but<br>
> I wish to use C++ RTTI currently.<br>
><br>
> I have tried building with  "cmake -G "Unix Makefiles" -LLVM_ENABLE_RTTI=ON"<br>
> but that doesnt seem to remove the "fno-rtti" flag from llvm-config<br>
> and I still get an error when I try using "dynamic_cast<>" from C++ RTTI.<br>
<br>
You missed the D.  All CMake definition flags need this.  Try:<br>
<br>
 -DLLVM_ENABLE_RTTI=ON<br>
<br>
Also, I’d recommend using Ninja not Unix Makefiles.<br>
<br>
Note that LLVM did work quite well with programs using RTTI without enabling RTTI for LLVM until someone broke IR/Instructions.h about a year ago to remove the out-of-line definitions and force the vtable for several instructions to be emitted in every compilation unit including this file (i.e. a lot of them).  This means that any file using RTTI that includes this header tries to emit a vtable with type info that refers to superclass objects defined elsewhere.  Fixing this would make LLVM significantly more useful as a library.<br>
<br>
David<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>