<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Ah, please disregard - it turns out two jobs were being created because I was passing the input file in two places, one in the <font face="Courier New" class="">source_filename</font> parameter to <font face="Courier New" class="">clang_parseTranslationUnit2</font>, as well as part of the args array created from the command line arguments.<div class=""><br class=""></div><div class="">Thank you,</div><div class=""><br class=""></div><div class="">Neal</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 19, 2021, at 6:01 PM, Neal Sidhwaney via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I’m writing a library that uses libclang, and I’m running into an error when I try to use arguments from a <font face="Courier New" class="">CXCompilationDatabase</font> to call <font face="Courier New" class="">clang_parseTranslationUnit2()</font>. The error I’m getting is <font face="Courier New" class="">CXError_ASTReadError</font>. It seems to start at <a href="https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp#L85" class="">https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp#L85</a>, as far as I can debug (<font face="Courier New" class="">Jobs.size() == 2</font> in this case).</div><div class=""><br class=""></div><div class="">The code I’m working on is here: <a href="https://github.com/nealsid/elclang/blob/main/elclang.c#L148" class="">https://github.com/nealsid/elclang/blob/main/elclang.c#L148</a> - I was wondering if anyone sees anything that I missed. The output from line 142 in that same file is pasted below. Thank you!</div><div class=""><br class=""></div><div class="">Neal</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: --driver-mode=g++</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -DGTEST_HAS_RTTI=0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -DHAVE_ROUND</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -DLLDB_CONFIGURATION_DEBUG</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -D_DEBUG</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -D__STDC_CONSTANT_MACROS</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -D__STDC_FORMAT_MACROS</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -D__STDC_LIMIT_MACROS</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Itools/lldb/source/Host</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Users/nealsid/src/github/llvm-project/lldb/source/Host</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Users/nealsid/src/github/llvm-project/lldb/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Itools/lldb/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Iinclude</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Users/nealsid/src/github/llvm-project/llvm/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Users/nealsid/src/github/llvm-project/llvm/../clang/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Itools/lldb/../clang/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/usr/local/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Users/nealsid/src/github/llvm-project/lldb/source</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Itools/lldb/source</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -isystem</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -fPIC</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -fvisibility-inlines-hidden</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Werror=date-time</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Werror=unguarded-availability-new</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wall</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wextra</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-unused-parameter</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wwrite-strings</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wcast-qual</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wmissing-field-initializers</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -pedantic</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-long-long</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wc++98-compat-extra-semi</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wimplicit-fallthrough</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wcovered-switch-default</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-noexcept-type</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wnon-virtual-dtor</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wdelete-non-virtual-dtor</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wsuggest-override</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wstring-conversion</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wmisleading-indentation</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -fdiagnostics-color</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-deprecated-declarations</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-unknown-pragmas</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-strict-aliasing</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-deprecated-register</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -Wno-vla-extension</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -g</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -isysroot</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -fno-exceptions</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -fno-rtti</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -std=c++14</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -o</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/Editline.cpp.o</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: -c</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Cascadia Mono";" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Arg: /Users/nealsid/src/github/llvm-project/lldb/source/Host/common/Editline.cpp</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>