1 Star 0 Fork 25

山竹/bcc

forked from src-anolis-os/bcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bcc-0.19.0-Remove-APInt-APSInt-toString-std-string-variants.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 13:49 . update to bcc-0.19.0-5.el8.src.rpm
From da1f8b4b8389e463e323885e402f96b3bc6ceb35 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 14 Jun 2021 12:49:43 -0700
Subject: [PATCH] Remove APInt/APSInt toString() std::string variants
clang 13+ has removed this in favour of a pair of llvm::toString
() helpers inside StringExtras.h to improve compile speed by avoiding
hits on <string> header
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/cc/json_map_decl_visitor.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/cc/json_map_decl_visitor.cc b/src/cc/json_map_decl_visitor.cc
index eff4d067..53896199 100644
--- a/src/cc/json_map_decl_visitor.cc
+++ b/src/cc/json_map_decl_visitor.cc
@@ -20,6 +20,7 @@
#include <clang/AST/ASTContext.h>
#include <clang/AST/RecordLayout.h>
#include <clang/AST/RecursiveASTVisitor.h>
+#include <llvm/ADT/StringExtras.h>
#include "common.h"
#include "table_desc.h"
@@ -79,7 +80,11 @@ void BMapDeclVisitor::genJSONForField(FieldDecl *F) {
result_ += "[";
TraverseDecl(F);
if (const ConstantArrayType *T = dyn_cast<ConstantArrayType>(F->getType()))
+#if LLVM_MAJOR_VERSION >= 13
+ result_ += ", [" + toString(T->getSize(), 10, false) + "]";
+#else
result_ += ", [" + T->getSize().toString(10, false) + "]";
+#endif
if (F->isBitField())
result_ += ", " + to_string(F->getBitWidthValue(C));
result_ += "], ";
--
2.31.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangpingping000/bcc.git
git@gitee.com:wangpingping000/bcc.git
wangpingping000
bcc
bcc
a8

搜索帮助