[PATCH] D151938: [clang][index] NFCI: Make `CXFile` a `FileEntryRef`

Jake Egan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 29 19:59:03 PDT 2023


Jake-Egan added a comment.

Sorry for the late response @jansvoboda11, when `lookupModuleFile` is called, the file `build/tools/clang/test/Index/Core/Output/index-with-module.m.tmp.mcp/A03A61VI43WA/ModA-21USRMHJNU3PG.pcm` doesn't exist. So it seems there's some issue with the creation of the file.

The backtrace is:

  #0  0x09000000005cefe4 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5_64.o)
  #1  0x09000000005ce808 in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5_64.o)
  #2  0x090000000004130c in raise () from /usr/lib/libc.a(shr_64.o)
  #3  0x090000000005f49c in abort () from /usr/lib/libc.a(shr_64.o)
  #4  0x0900000006cb4e30 in llvm::llvm_unreachable_internal (msg=<optimized out>, 
      file=0x8001000a0014bee <L.._MergedGlobals.658+12910> "/llvm-project/llvm/include/llvm/Support/Error.h", line=755) at /llvm-project/llvm/lib/Support/ErrorHandling.cpp:212
  #5  0x0900000006ccc5ec in llvm::cantFail (Err=..., Msg=
      0x0 <clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind)>)
      at /llvm-project/llvm/include/llvm/Support/Error.h:755
  #6  llvm::handleAllErrors<llvm::consumeError(llvm::Error)::{lambda(llvm::ErrorInfoBase const&)#1}>(llvm::Error, llvm::consumeError(llvm::Error)::{lambda(llvm::ErrorInfoBase const&)#1}&&) (E=..., Handlers=...)
      at /llvm-project/llvm/include/llvm/Support/Error.h:967
  #7  0x0900000006d0ef30 in llvm::consumeError (Err=...)
      at /llvm-project/llvm/include/llvm/Support/Error.h:1044
  #8  llvm::expectedToOptional<clang::FileEntryRef> (E=...)
      at /llvm-project/llvm/include/llvm/Support/Error.h:1057
  #9  0x0000000102dc03a0 in clang::serialization::ModuleManager::lookupModuleFile (this=<optimized out>, FileName=..., 
      ExpectedSize=576478347173894528, ExpectedModTime=0, File=...)
      at /llvm-project/clang/lib/Serialization/ModuleManager.cpp:451
  #10 0x0000000102dbf380 in clang::serialization::ModuleManager::addModule (this=0x110950d40, FileName=..., 
      Type=clang::serialization::MK_ExplicitModule, ImportLoc=..., 
      ImportedBy=0x0 <clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind)>, 
      Generation=67, ExpectedSize=-1, ExpectedModTime=-1, ExpectedSignature=..., 
      ReadSignature=@0x11071e1a8: 0x102dbd514 <readASTFileSignature(llvm::StringRef)>, 
      Module=@0xfffffffffffd678: 0x0 <clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind)>, ErrorStr=...) at /llvm-project/clang/lib/Serialization/ModuleManager.cpp:121
  #11 0x0000000102dbc2a8 in clang::ASTReader::ReadASTCore (this=0x110950cb0, FileName=..., 
      Type=clang::serialization::MK_ImplicitModule, ImportLoc=..., 
      ImportedBy=0x0 <clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind)>, 
      Loaded=..., ExpectedSize=-1, ExpectedModTime=0, ExpectedSignature=..., ClientLoadCapabilities=19)
      at /llvm-project/clang/lib/Serialization/ASTReader.cpp:4584
  #12 0x0000000102dbad14 in clang::ASTReader::ReadAST(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, unsigned int, llvm::SmallVectorImpl<clang::ASTReader::ImportedSubmodule>*) ()
  #13 0x0000000102c826a8 in clang::CompilerInstance::findOrCompileModuleAndReadAST(llvm::StringRef, clang::SourceLocation, clang::SourceLocation, bool) ()
  #14 0x0000000102c7e75c in clang::CompilerInstance::loadModule (this=0x110950cc8, ImportLoc=..., Path=..., 
      Visibility=(clang::Module::AllVisible | unknown: 0x12), IsInclusionDirective=<optimized out>)
      at /llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1995
  #15 0x00000001001143ac in clang::Preprocessor::LexAfterModuleImport (this=0x1108ee6c8, Result=...)
      at /llvm-project/clang/lib/Lex/Preprocessor.cpp:1323
  #16 0x00000001001132e4 in clang::Preprocessor::Lex (
  this=0x110981100, Result=...) at /llvm-project/clang/lib/Lex/Preprocessor.cpp:899
  #17 0x000000010271eb1c in clang::Parser::ConsumeToken (this=0x1109810f0)
      at /llvm-project/clang/include/clang/Parse/Parser.h:504
  #18 clang::Parser::ParseModuleName (this=0x1109810f0, UseLoc=..., Path=..., IsImport=<optimized out>)
      at /llvm-project/clang/lib/Parse/Parser.cpp:2638
  #19 0x000000010271de04 in clang::Parser::ParseModuleImport (this=0x1109810f0, AtLoc=..., 
      ImportState=@0x1: clang::Sema::FirstDecl) at /llvm-project/clang/lib/Parse/Parser.cpp:2526
  #20 0x000000010296637c in clang::Parser::ParseObjCAtDirectives (this=0x1109810f0, DeclAttrs=..., DeclSpecAttrs=...)
      at /llvm-project/clang/lib/Parse/ParseObjc.cpp:99
  #21 0x0000000102842e58 in clang::Parser::ParseExternalDeclaration (this=0x1109810f0, Attrs=..., DeclSpecAttrs=..., 
      DS=0x0 <clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind)>)
      at /llvm-project/clang/lib/Parse/Parser.cpp:908
  #22 0x000000010271a934 in clang::Parser::ParseTopLevelDecl (this=0x1109810f0, Result=..., 
      ImportState=@0xfffffffffffeef8: clang::Sema::FirstDecl)
      at /llvm-project/clang/lib/Parse/Parser.cpp:742
  #23 0x0000000102719524 in clang::Parser::ParseFirstTopLevelDecl (this=0xfffffffffffef90, Result=..., 
      ImportState=@0xffffffffffff1e8: clang::Sema::FirstDecl)
      at /llvm-project/clang/lib/Parse/Parser.cpp:594
  #24 0x0000000101693200 in clang::ParseAST (S=..., PrintStats=<optimized out>, SkipFunctionBodies=<optimized out>)
      at /llvm-project/clang/lib/Parse/ParseAST.cpp:162
  #25 0x00000001015f4d80 in clang::ASTFrontendAction::ExecuteAction() ()
  #26 0x0000000102f96d18 in clang::FrontendAction::Execute() ()
      at /opt/IBM/openxlC/17.1.1/bin/../include/c++/v1/optional:957
  #27 0x0000000102c77838 in clang::ASTUnit::LoadFromCompilerInvocationAction (CI=..., PCHContainerOps=..., Diags=..., 
      Action=<optimized out>, Unit=<optimized out>, Persistent=<optimized out>, ResourceFilesPath=..., 
      OnlyLocalDecls=<optimized out>, CaptureDiagnostics=<optimized out>, PrecompilePreambleAfterNParses=<optimized out>, 
      CacheCodeCompletionResults=<optimized out>, UserFilesAreVolatile=<optimized out>, ErrAST=<optimized out>)
      at /llvm-project/clang/lib/Frontend/ASTUnit.cpp:1651
  #28 0x000000010002c1c4 in printSourceSymbols (Executable=<optimized out>, Args=..., indexLocals=<optimized out>, 
      dumpModuleImports=<optimized out>, ignoreMacros=<optimized out>)
      at /llvm-project/clang/tools/c-index-test/core_main.cpp:241
  #29 indextest_core_main (argc=<optimized out>, argv=<optimized out>)
      at /llvm-project/clang/tools/c-index-test/core_main.cpp:370
  #30 0x0000000100000a1c in main (argc=276155128, argv=0xffffffffffff8c0)
      at /llvm-project/clang/tools/c-index-test/c-index-test.c:5142


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151938/new/

https://reviews.llvm.org/D151938



More information about the cfe-commits mailing list