[PATCH] D153557: [clang][ExtractAPI] Add support for C++ classes

Haowei Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 11:29:32 PDT 2023


haowei added a comment.

Hi, we are seeing a test error on `Clang :: ExtractAPI/constructor_destructor.cpp` after this patch was landed. Error message:

  Script:
  --
  : 'RUN: at line 1';   rm -rf /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp
  : 'RUN: at line 2';   split-file /b/s/w/ir/x/w/llvm-llvm-project/clang/test/ExtractAPI/constructor_destructor.cpp /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp
  : 'RUN: at line 3';   sed -e "s at INPUT_DIR@/b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp at g"  /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/reference.output.json.in >> /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/reference.output.json
  : 'RUN: at line 5';   /b/s/w/ir/x/w/llvm_build/bin/clang++ -extract-api -target arm64-apple-macosx -x c++-header  /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/input.h -o /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/output.json -Xclang -verify
  : 'RUN: at line 9';   sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g"  /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/output.json >> /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/output-normalized.json
  : 'RUN: at line 11';   diff /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/reference.output.json /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/output-normalized.json
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  clang++: llvm/include/llvm/Support/JSON.h:317: llvm::json::Value::Value(std::string): Assertion `false && "Invalid UTF-8 in value used as JSON"' failed.
  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.	Program arguments: /b/s/w/ir/x/w/llvm_build/bin/clang++ -extract-api -target arm64-apple-macosx -x c++-header /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/input.h -o /b/s/w/ir/x/w/llvm_build/tools/clang/test/ExtractAPI/Output/constructor_destructor.cpp.tmp/output.json -Xclang -verify
  #0 0x000055a2ec85c458 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/s/w/ir/x/w/llvm_build/bin/clang+++0x83e5458)
  clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
  Fuchsia clang version 18.0.0 (https://llvm.googlesource.com/llvm-project dad9de0ae5360b18c890985d212bec266bf8c122)
  Target: arm64-apple-macosx
  Thread model: posix
  InstalledDir: /b/s/w/ir/x/w/llvm_build/bin
  clang++: note: diagnostic msg: 
  ********************
  
  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
  Preprocessed source(s) and associated run script(s) are located at:
  clang++: note: diagnostic msg: /b/s/w/ir/x/t/lit-tmp-0iloyqe3/input-5086dc.hh
  clang++: note: diagnostic msg: /b/s/w/ir/x/t/lit-tmp-0iloyqe3/input-5086dc.sh
  clang++: note: diagnostic msg: 
  
  ********************
  
  --

Link to the builder: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8773854265208228753/overview

It looks like it triggers an assertion error in llvm's JSON library. Could you take a look please? If it takes some time to fix, could you revert your change please? Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153557



More information about the cfe-commits mailing list