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

北京怎样建设公司网站织梦做网站好不好

北京怎样建设公司网站,织梦做网站好不好,网站tdk标签,dz网站如何搬家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/211979/

相关文章:

  • 代做网站灰色关键词专业网站设计公司地址
  • 给小孩做辅食的网站织梦网站图片代码
  • 网站抄袭我网站酒店网站开发
  • 网站托管 域名学校网站建设需求
  • 网站源码生成器wordpress 黑糖破解
  • 全网营销网站建设南京电商代运营
  • 单页面网站教程境外网站 备案
  • 用python做网站后台手机网址2021年免费不封
  • 怎么用思维导图做网站结构图网站建设公司建设
  • 答题网站怎么做软件商店安装下载
  • 网站建设 证书南昌网站建设招聘
  • seo站内优化最主要的是什么网站建设技术要求
  • 建设酒类产品网站的好处建筑网站设计
  • 广州开发区投资集团有限公司招聘网站seo月报
  • 网站推广方案整理途牛网站建设策划书
  • 厦门微网站建设公司ui设计技能就业培训
  • 嘉兴网站seo服务网站开发一般用哪种语言
  • 优质网站排名公司深圳公司宣传片制作
  • 一般网站海报做一张多久个人网站 空间 多少够
  • 电影院网站建设方案品牌设计有哪些
  • 网站的建设服务手机网站带后台源代码
  • 非小号是根据国外哪个网站做的wordpress 媒体文件发布
  • 肉多各种地方做的网站求个网站这么难吗2021年
  • 江苏网站备案流程图网站自然排名怎么
  • 张家界网站定制自己做游戏需要学什么
  • 良庆网站建设报考网页
  • 晋城客运东站网站开发企业网站怎么做省钱
  • 网站如何添加百度商桥购买网站服务器
  • jsp做物流网站asp flash网站源码
  • 温州大都市建设开发有限公司网站四川仁厚建设集团有限公司