<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 9, 2015 at 7:58 AM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 9, 2015 at 7:11 AM, Russell Wallace via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Rather than including llvm header files piecemeal on an ongoing basis, I'm looking for a way to include all such header files once and for all. </div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>That's really going to hurt your compile time, btw... if you're interested in building a tool to help here, a tool that uses Clang to find and suggest headers to include (or to remove, to keep the include set minimal to avoid bloating compile time) would probably be good & I know there are some people working on such a thing. But it is more work, of course. (& may benefit from/need C++ modules support)</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">To that end, I wrote a Python script to generate include directives for all .h files in llvm/include and its subdirectories. This almost works, but getting two error messages:<br><br>In file included from src\main.cpp:1:<br>In file included from src/../llvm.h:254:<br>In file included from \llvm\include\llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h:13:<br>In file included from \llvm\include\llvm/DebugInfo/PDB/IPDBEnumChildren.h:13:<br>\llvm\include\llvm/DebugInfo/PDB/PDBTypes.h(444,3) :  error: redefinition of enumerator 'Unknown'<br>  Unknown,<br>  ^<br>\llvm\include\llvm/CodeGen/CallingConvLower.h(189,16) :  note: previous definition is here<br>typedef enum { Unknown, Prologue, Call } ParmContext;<br></div></blockquote></div></div></div></blockquote><div>Try changing PDB_VariantType to be enum class instead of enum.  Everything else in that file is an enum class, it's possible this one just ended up as an enum by accident.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">               ^<br>In file included from src\main.cpp:1:<br>In file included from src/../llvm.h:298:<br>In file included from \llvm\include\llvm/DebugInfo/PDB/DIA/DIADataStream.h:13:<br>\llvm\include\llvm/DebugInfo/PDB/DIA/DIASupport.h(30,10) :  fatal error: 'cvconst.h' file not found<br>#include <cvconst.h><br><br>Are there known fixes for these, or is there something I should be doing differently?<br></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>The first one's probably an outright ODR violation (Zach - perhaps you could take a look at that)<br><br>The second is probably because you're including a header that's only conditionally usable, when you have the right 3rd party package installed (at least I assume that's the case - Zach?)<br><br>Did we actually install that header onto a system without the package available? Or are you pointing your build at an LLVM source tree?</div></div></div></div></blockquote><div><br></div><div>I'm not sure how the source tarball works, but did you run CMake yourself or does the source tarball come with pre-generated CMake build files?  It's only supposed to compile the DIA stuff if it finds DIA is installed on your machine at CMake gen time.</div></div></div>