[PATCH] D153111: [clang][Serialization][RISCV] Increase the number of reserved predefined type IDs

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 00:48:48 PDT 2023


rogfer01 created this revision.
rogfer01 added reviewers: eopXD, Eugene.Zelenko, craig.topper.
Herald added subscribers: jobnoorman, VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, PkmX, shiva0217, kito-cheng, simoncook, arichardson.
Herald added a project: All.
rogfer01 requested review of this revision.
Herald added subscribers: cfe-commits, wangpc.
Herald added a project: clang.

In https://reviews.llvm.org/D152070 we added many new intrinsic types required for the RISC-V Vector Extension.

This was crashing when loading the AST as those types are intrinsically added to the AST (they don't come from the disk).

  $ touch t.c
  $ clang -cc1 -triple riscv64 -w -emit-pch -o test.pch t.c
  $ clang -cc1 -triple riscv64 -w -x c -include-pch test.pch -ast-dump-all /dev/null

The total number required now by clang seems to go far beyond 300 so increasing the value to 500 seems to solve the problem. This value was already increased in D92715 <https://reviews.llvm.org/D92715> but I assume this has some impact on the on-disk format.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153111

Files:
  clang/include/clang/Serialization/ASTBitCodes.h


Index: clang/include/clang/Serialization/ASTBitCodes.h
===================================================================
--- clang/include/clang/Serialization/ASTBitCodes.h
+++ clang/include/clang/Serialization/ASTBitCodes.h
@@ -1106,7 +1106,7 @@
 ///
 /// Type IDs for non-predefined types will start at
 /// NUM_PREDEF_TYPE_IDs.
-const unsigned NUM_PREDEF_TYPE_IDS = 300;
+const unsigned NUM_PREDEF_TYPE_IDS = 500;
 
 /// Record codes for each kind of type.
 ///


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153111.532016.patch
Type: text/x-patch
Size: 467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230616/2d09741d/attachment.bin>


More information about the cfe-commits mailing list