[clang] [clang][analyzer] Forward CTU-import failure conditions (PR #189064)

Arseniy Zaostrovnykh via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 08:55:30 PDT 2026


================
@@ -649,13 +734,23 @@ CrossTranslationUnitContext::ASTLoader::loadFromSource(
 }
 
 llvm::Expected<InvocationListTy>
-parseInvocationList(StringRef FileContent, llvm::sys::path::Style PathStyle) {
+parseInvocationList(StringRef FileContent, llvm::sys::path::Style PathStyle,
+                    StringRef FilePath) {
   InvocationListTy InvocationList;
 
   /// LLVM YAML parser is used to extract information from invocation list file.
   llvm::SourceMgr SM;
   llvm::yaml::Stream InvocationFile(FileContent, SM);
 
+  auto getLine = [&SM](const llvm::yaml::Node *N) -> int {
+    return N ? SM.FindLineNumber(N->getSourceRange().Start) : 0;
+  };
+  auto wrongFormat = [&](const llvm::yaml::Node *N) {
----------------
necto wrote:

55a7d64982d2 az/ctu-forward-errors [NFC] Rename to WrongFormatError


https://github.com/llvm/llvm-project/pull/189064


More information about the cfe-commits mailing list