当前位置: 首页>>代码示例>>C++>>正文


C++ StoredDiagnostic::getMessage方法代码示例

本文整理汇总了C++中StoredDiagnostic::getMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ StoredDiagnostic::getMessage方法的具体用法?C++ StoredDiagnostic::getMessage怎么用?C++ StoredDiagnostic::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StoredDiagnostic的用法示例。


在下文中一共展示了StoredDiagnostic::getMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: emitStoredDiagnostic

void DiagnosticRenderer::emitStoredDiagnostic(StoredDiagnostic &Diag) {
  emitDiagnostic(Diag.getLocation(), Diag.getLevel(), Diag.getMessage(),
                 Diag.getRanges(), Diag.getFixIts(),
                 Diag.getLocation().isValid() ? &Diag.getLocation().getManager()
                                              : 0,
                 &Diag);
}
开发者ID:nico,项目名称:gong,代码行数:7,代码来源:DiagnosticRenderer.cpp

示例2: Report

void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
    assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");

    CurDiagLoc = storedDiag.getLocation();
    CurDiagID = storedDiag.getID();
    NumDiagArgs = 0;

    DiagRanges.clear();
    DiagRanges.reserve(storedDiag.range_size());
    for (StoredDiagnostic::range_iterator
            RI = storedDiag.range_begin(),
            RE = storedDiag.range_end(); RI != RE; ++RI)
        DiagRanges.push_back(*RI);

    DiagFixItHints.clear();
    DiagFixItHints.reserve(storedDiag.fixit_size());
    for (StoredDiagnostic::fixit_iterator
            FI = storedDiag.fixit_begin(),
            FE = storedDiag.fixit_end(); FI != FE; ++FI)
        DiagFixItHints.push_back(*FI);

    assert(Client && "DiagnosticConsumer not set!");
    Level DiagLevel = storedDiag.getLevel();
    Diagnostic Info(this, storedDiag.getMessage());
    Client->HandleDiagnostic(DiagLevel, Info);
    if (Client->IncludeInDiagnosticCounts()) {
        if (DiagLevel == DiagnosticsEngine::Warning)
            ++NumWarnings;
    }

    CurDiagID = ~0U;
}
开发者ID:degano,项目名称:clang,代码行数:32,代码来源:Diagnostic.cpp

示例3: Report

void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
  assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");

  CurDiagLoc = storedDiag.getLocation();
  CurDiagID = storedDiag.getID();
  NumDiagArgs = 0;

  NumDiagRanges = storedDiag.range_size();
  assert(NumDiagRanges < DiagnosticsEngine::MaxRanges &&
         "Too many arguments to diagnostic!");
  unsigned i = 0;
  for (StoredDiagnostic::range_iterator
         RI = storedDiag.range_begin(),
         RE = storedDiag.range_end(); RI != RE; ++RI)
    DiagRanges[i++] = *RI;

  assert(NumDiagRanges < DiagnosticsEngine::MaxFixItHints &&
         "Too many arguments to diagnostic!");
  NumDiagFixItHints = 0;
  for (StoredDiagnostic::fixit_iterator
         FI = storedDiag.fixit_begin(),
         FE = storedDiag.fixit_end(); FI != FE; ++FI)
    DiagFixItHints[NumDiagFixItHints++] = *FI;

  assert(Client && "DiagnosticConsumer not set!");
  Level DiagLevel = storedDiag.getLevel();
  Diagnostic Info(this, storedDiag.getMessage());
  Client->HandleDiagnostic(DiagLevel, Info);
  if (Client->IncludeInDiagnosticCounts()) {
    if (DiagLevel == DiagnosticsEngine::Warning)
      ++NumWarnings;
  }

  CurDiagID = ~0U;
}
开发者ID:Celtoys,项目名称:clReflect,代码行数:35,代码来源:Diagnostic.cpp

示例4: Report

void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
  assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");

  CurDiagLoc = storedDiag.getLocation();
  CurDiagID = storedDiag.getID();
  NumDiagArgs = 0;

  DiagRanges.clear();
  DiagRanges.append(storedDiag.range_begin(), storedDiag.range_end());

  DiagFixItHints.clear();
  DiagFixItHints.append(storedDiag.fixit_begin(), storedDiag.fixit_end());

  assert(Client && "DiagnosticConsumer not set!");
  Level DiagLevel = storedDiag.getLevel();
  Diagnostic Info(this, storedDiag.getMessage());
  Client->HandleDiagnostic(DiagLevel, Info);
  if (Client->IncludeInDiagnosticCounts()) {
    if (DiagLevel == DiagnosticsEngine::Warning)
      ++NumWarnings;
  }

  CurDiagID = ~0U;
}
开发者ID:mirams,项目名称:opencor,代码行数:24,代码来源:Diagnostic.cpp

示例5:

ASTUnit::StandaloneDiagnostic
TranslationUnitManager::MakeStandaloneDiagnostic(ASTUnit* tu,
                         const StoredDiagnostic &InDiag) {
  ASTUnit::StandaloneDiagnostic OutDiag;
  const LangOptions& LangOpts = tu->getASTContext().getLangOpts();
  OutDiag.ID = InDiag.getID();
  OutDiag.Level = InDiag.getLevel();
  OutDiag.Message = InDiag.getMessage();
  OutDiag.LocOffset = 0;
  if (InDiag.getLocation().isInvalid())
    return OutDiag;
  const SourceManager &SM = InDiag.getLocation().getManager();
  SourceLocation FileLoc = SM.getFileLoc(InDiag.getLocation());
  OutDiag.Filename = SM.getFilename(FileLoc);
  if (OutDiag.Filename.empty())
    return OutDiag;
  OutDiag.LocOffset = SM.getFileOffset(FileLoc);
  for (const CharSourceRange &Range : InDiag.getRanges())
    OutDiag.Ranges.push_back(makeStandaloneRange(Range, SM, LangOpts));
  for (const FixItHint &FixIt : InDiag.getFixIts())
    OutDiag.FixIts.push_back(makeStandaloneFixIt(SM, LangOpts, FixIt));

  return OutDiag;
}
开发者ID:golgepapaz,项目名称:clang_cc,代码行数:24,代码来源:translationunitmanager.cpp


注:本文中的StoredDiagnostic::getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。