Reland "[Attr] support btf_type_tag attribute"
This is to revert commit f95bd18b (Revert "[Attr] support btf_type_tag attribute") plus a bug fix. Previous change failed to handle cases like below: $ cat reduced.c void a(*); void a() {} $ clang -c reduced.c -O2 -g In such cases, during clang IR generation, for function a(), CGCodeGen has numParams = 1 for FunctionType. But for FunctionTypeLoc we have FuncTypeLoc.NumParams = 0. By using FunctionType.numParams as the bound to access FuncTypeLoc params, a random crash is triggered. The bug fix is to check against FuncTypeLoc.NumParams before accessing FuncTypeLoc.getParam(Idx). Differential Revision: https://reviews.llvm.org/D111199
Loading
Please sign in to comment