当前位置: 首页 > news >正文

创意网站 模板网站怎么做音乐外链

创意网站 模板,网站怎么做音乐外链,意大利室内设计网站,网站制作大连1、抛出error信息并终止程序 使用DiagnosticInfoUnsupported可以向用户抛出error信息并且终止程序,效果如同report_fatal_error、Error。后端用法如下: void xxxx::reportErrorMsg(const MachineFunction &MF)const {const Function &F MF.ge…

1、抛出error信息并终止程序

使用DiagnosticInfoUnsupported可以向用户抛出error信息并且终止程序,效果如同report_fatal_error、Error。后端用法如下:

void xxxx::reportErrorMsg(const MachineFunction &MF)const {const Function &F = MF.getFunction();// Diagnostic information for unsupported feature in backend.F.getContext().diagnose(DiagnosticInfoUnsupported{F, "report msg."});
}

2、优化pass中抛出警告信息之OptimizationRemark

使用时clang得加上-Rpass=name,llc得加上–pass-remarks=name才行,后端用法如下:

#include "llvm/Analysis/OptimizationRemarkEmitter.h"void getAnalysisUsage(AnalysisUsage &AU) const override {AU.addRequired<OptimizationRemarkEmitterWrapperPass>();MachineFunctionPass::getAnalysisUsage(AU);}
void xxx::reportWarningMsg(const MachineFunction &MF)const {auto *ORE = &getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();const Function &F = MF.getFunction();// Diagnostic information for applied optimization remarksOptimizationRemark R(DEBUG_TYPE, "replace-spill-register", &F);R << "report msg";ORE->emit(R);
}

3、machine ir抛信息之DiagnosticInfoMIRParser

该接口同样支持DS_Error,DS_Warning,DS_Remark和DS_Note 4种方式,后端用法如下:

#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/Support/SourceMgr.h"
void xxx::reportWarningMsg(const MachineFunction &MF)const {const Function &F = MF.getFunction();// Diagnostic information for machine IR parser.F.getContext().diagnose(DiagnosticInfoMIRParser(DS_Warning,SMDiagnostic(DEBUG_TYPE, SourceMgr::DK_Warning, "report msg")));
}

4、AsmParser之Warning

基本用法如下:

XXXAsmParser &Parser;
void Warning(SMLoc L, const Twine &Msg) { Parser.Warning(L, Msg); }

5、MCContext之reportWarning

基本用法如下:

MCContext &Context;
void MCContext::reportWarning(SMLoc Loc, const Twine &Msg)
Context.reportWarning(MCxxx.getLoc(), Msg);

6、其它类型的信息

包括DiagnosticInfoInlineAsm,DiagnosticInfoResourceLimit,DiagnosticInfoStackSize,DiagnosticInfoOptimizationBase,DiagnosticInfoIROptimization以及debug,Profileing,remarks等。

  1. 其中llvm_unreachable为开发者使用,发布时用户不可见,所看到的信息为segment fatal。
  2. assert由于存在判断开销,一般也不在发布中开启。

7、用例如何检查report_fatal_error

  1. RUN命令需要使用not,用法如下:
// RUN: not %clang --target=xx -mcpu=xxx -O3 -c %s -o - 2>&1 | FileCheck %s --check-prefix=expected-error
....
// expected-error: xxxx
  1. 使用-fsyntax-only -verify,用法如下:
// RUN: %clang_cc1 -triple xxx  -target-feature xx -fsyntax-only -verify %s
// expected-warning{{xxxxxxxx}} expected-error{{xxxxxxxxxxxxxxx}}
http://www.yayakq.cn/news/773628/

相关文章:

  • 广州网站建设推荐乐云seowordpress网站维护页面
  • 视频素材交易网站建设找考卷做要去哪个网站
  • 网站添加icp信息网站建设运营知识
  • 有哪些做的好的网站网站的logo在百度怎么显示不出来
  • 网站建设发展的前景我理解的网络营销是什么
  • 傻瓜式网站开发wordpress文章图片函数
  • 做网站需要什么样的服务器做网站需要注意什么
  • 失物招领网站开发项目需求分析创建网站大约
  • 网站开发语言学习C 吗网站的空间是服务器吗
  • 我想找阿里巴巴做网站推广琪歌 wordpress
  • 网站建设方案书 广东多商网
  • 网站建设歺首选金手指12网站改标题
  • 网站 软件公司运营策划方案
  • 用哪个程序做网站收录好6接网站制作
  • 网站建设交流发言材料ip设计网站
  • 咨询行业网站建设公司陕西省建设工程招投标信息网官网
  • 支付宝 外贸网站商昊网站建设
  • 建个人网站赚钱吗平台公司属于什么行业
  • 美橙建站五合一建站套餐申请微营销推广平台有哪些
  • html5网站源码小程序制作视频
  • 建设网站属于什么费用做淘宝优惠券怎么有网站
  • 课程网站开发装宽带需要多少钱
  • 做直播网站需要学什么软件有哪些文登建设局官方网站
  • 做行程的网站wordpress加描述
  • 广安 网站建设优秀商业空间设计案例分析
  • it公司怎么在国外网站做宣传那些网站可以做h5
  • 专业做网站app的公司哪家好兴义做网站
  • 国外手机设计网站深圳产品推广网站建设方案
  • 怎么在网站上做充话费业务重庆建设施工安全管理网站
  • 做网站赚钱多吗外贸公司如何运营