[LLVMdev] How to figure out what #includes are needed?
Rodney M. Bates
rodney_bates at lcwb.coop
Mon Dec 22 09:29:47 PST 2014
On 12/18/2014 06:57 AM, Yaron Keren wrote:
> Shouldn't -std=c++11 be there also?
>
>
Well, that introduces a new error:
-----------------------------------------------------------------------------------------------------------------------
In file included from LLVMDIBuilder.cpp:19:
In file included from /usr/local/include/llvm/Support/CBindingWrapping.h:17:
In file included from /usr/local/include/llvm/Support/Casting.h:18:
In file included from /usr/local/include/llvm/Support/type_traits.h:22:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/utility:70:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_pair.h:59:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/move.h:87:5: error: conflicting types for 'forward'
forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
^
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/move.h:76:5: note: previous definition is here
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
^
------------------------------------------------------------------------------------------------------------------------
and doesn't change the first of those I was already getting.
> 2014-12-17 5:15 GMT+02:00 Rodney M. Bates <rodney_bates at lcwb.coop <mailto:rodney_bates at lcwb.coop>>:
>
> This is partly an llvm question, and maybe partly C++.
>
> I am trying to make calls on code in the llvm infrastructure.(3.4.2) I appear
> to be missing some include files, but don't know how to track them down. I get
> compile errors on existing llvm header files, like the following two examples:
> ------------------------------__------------------------------__--------------------
>
> In file included from LLVMDIBuilder.cpp:16:
> In file included from /usr/local/include/llvm/__Support/CBindingWrapping.h:17:
> In file included from /usr/local/include/llvm/__Support/Casting.h:18:
> In file included from /usr/local/include/llvm/__Support/type_traits.h:22:
> In file included from /usr/lib/gcc/x86_64-linux-gnu/__4.8/../../../../include/c++/4.__8/utility:70:
> In file included from /usr/lib/gcc/x86_64-linux-gnu/__4.8/../../../../include/c++/4.__8/bits/stl_pair.h:59:
> /usr/lib/gcc/x86_64-linux-gnu/__4.8/../../../../include/c++/4.__8/bits/move.h:185:5: error: conflicting types for 'swap'
> swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
> ^
> /usr/lib/gcc/x86_64-linux-gnu/__4.8/../../../../include/c++/4.__8/bits/move.h:166:5: note: previous definition is here
> swap(_Tp& __a, _Tp& __b)
>
> ------------------------------__------------------------------__--------------------
> In file included from LLVMDIBuilder.cpp:16:
> In file included from /usr/local/include/llvm/__Support/CBindingWrapping.h:17:
> In file included from /usr/local/include/llvm/__Support/Casting.h:18:
> /usr/local/include/llvm/__Support/type_traits.h:48:33: error: functions that differ only in their return type cannot be overloaded
> template<typename T> double is_class_helper(...);
> ^
> /usr/local/include/llvm/__Support/type_traits.h:47:31: note: previous declaration is here
> template<typename T> char is_class_helper(void(T::*)());
> ^
> ------------------------------__------------------------------__--------------------
>
> Obviously, these files compile when included by the normal llvm build
> process. I have gotten many previous similar errors to go away by rote copying
> in of all the #include lines in the full code listing in the new Kaleidoscope
> Chapter 8 example and all those in core.cpp, but many more remain.
>
> I would have expected missing declarations from missing include files to
> give error messages like "undeclared identifier", but the effect seems to
> be to make types that look different be the same, and vice versa (but
> apparently not different enough to be legal overloads?).
>
> My command line is:
>
> clang++ -g LLVMDIBuilder.cpp `llvm-config --cxxflags --libs all`
>
> $lvm-config --cxxflags --libs all
> -I/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual
> -lLLVMInstrumentation -lLLVMIRReader -lLLVMAsmParser -lLLVMDebugInfo -lLLVMOption -lLLVMLTO -lLLVMLinker -lLLVMipo -lLLVMVectorize -lLLVMBitWriter -lLLVMBitReader -lLLVMTableGen -lLLVMR600CodeGen -lLLVMR600Desc -lLLVMR600Info -lLLVMR600AsmPrinter -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter -lLLVMHexagonCodeGen -lLLVMHexagonAsmPrinter -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAArch64Disassem!
> bler -lLLV
> MAArch64CodeGen -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInterpreter -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport
>
> How do I figure out what to include to fix these?
>
>
>
> --
> Rodney Bates
> rodney.m.bates at acm.org <mailto:rodney.m.bates at acm.org>
> _________________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
--
Rodney Bates
rodney.m.bates at acm.org
More information about the llvm-dev
mailing list