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


C++ CallEvent::getSourceRange方法代码示例

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


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

示例1: reportUnmatchedWait

/**
 * Report there's no matching nonblocking call for request var used by wait.
 *
 * @param callExpr
 * @param requestVar
 * @param node
 */
void MPIBugReporter::reportUnmatchedWait(
    const CallEvent &callEvent, const clang::ento::MemRegion *requestRegion,
    const ExplodedNode *const node) const {
    std::string errorText{"Request '" + util::variableName(requestRegion) +
                          "' has no matching nonblocking call. "};

    auto bugReport =
        llvm::make_unique<BugReport>(*unmatchedWaitBugType_, errorText, node);
    bugReport->addRange(callEvent.getSourceRange());
    SourceRange r = util::sourceRange(requestRegion);
    if (r.isValid()) bugReport->addRange(r);
    bugReporter_.emitReport(std::move(bugReport));
}
开发者ID:harite,项目名称:MPI-Checker,代码行数:20,代码来源:MPIBugReporter.cpp

示例2: reportDoubleFetch

void DoubleFetchChecker::reportDoubleFetch(CheckerContext &Ctx, const CallEvent &Call) const {
	// We reached a bug, stop exploring the path here by generating a sink.
	ExplodedNode *ErrNode = Ctx.generateErrorNode(Ctx.getState());
	// If we've already reached this node on another path, return.
	if (!ErrNode)
		return;

	// Generate the report.
	auto R = llvm::make_unique<BugReport>(*DoubleFetchType,
			"Double-Fetch", ErrNode);
	R->addRange(Call.getSourceRange());
	Ctx.emitReport(std::move(R));
}
开发者ID:wpengfei,项目名称:DFTracker,代码行数:13,代码来源:DoubleFetchChecker-beforeXmas.cpp

示例3: reportBlockInCritSection

void BlockInCriticalSectionChecker::reportBlockInCritSection(
    SymbolRef BlockDescSym, const CallEvent &Call, CheckerContext &C) const {
  ExplodedNode *ErrNode = C.generateNonFatalErrorNode();
  if (!ErrNode)
    return;

  std::string msg;
  llvm::raw_string_ostream os(msg);
  os << "Call to blocking function '" << Call.getCalleeIdentifier()->getName()
     << "' inside of critical section";
  auto R = llvm::make_unique<BugReport>(*BlockInCritSectionBugType, os.str(), ErrNode);
  R->addRange(Call.getSourceRange());
  R->markInteresting(BlockDescSym);
  C.emitReport(std::move(R));
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:15,代码来源:BlockInCriticalSectionChecker.cpp

示例4: reportDoubleClose

void SimpleStreamChecker::reportDoubleClose(SymbolRef FileDescSym,
                                            const CallEvent &Call,
                                            CheckerContext &C) const {
  // We reached a bug, stop exploring the path here by generating a sink.
  ExplodedNode *ErrNode = C.generateErrorNode();
  // If we've already reached this node on another path, return.
  if (!ErrNode)
    return;

  // Generate the report.
  auto R = llvm::make_unique<BugReport>(*DoubleCloseBugType,
      "Closing a previously closed file stream", ErrNode);
  R->addRange(Call.getSourceRange());
  R->markInteresting(FileDescSym);
  C.emitReport(std::move(R));
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:16,代码来源:SimpleStreamChecker.cpp

示例5: reportDoubleWait

/**
 * Report duplicate request use by waits.
 *
 * @param observedCall
 * @param requestVar
 * @param node
 */
void MPIBugReporter::reportDoubleWait(const CallEvent &observedCall,
                                      const RequestVar &requestVar,
                                      const ExplodedNode *const node) const {
    std::string lineNo{lineNumber(requestVar.lastUser_)};
    std::string lastUser =
        requestVar.lastUser_->getCalleeIdentifier()->getName();
    std::string errorText{"Request '" + requestVar.variableName() +
                          "' is already waited upon by '" + lastUser +
                          "' in line " + lineNo + ". "};

    auto bugReport =
        llvm::make_unique<BugReport>(*doubleWaitBugType_, errorText, node);
    bugReport->addRange(observedCall.getSourceRange());
    bugReport->addRange(requestVar.lastUser_->getSourceRange());
    SourceRange r = util::sourceRange(requestVar.memRegion_);
    if (r.isValid()) bugReport->addRange(r);
    bugReporter_.emitReport(std::move(bugReport));
}
开发者ID:harite,项目名称:MPI-Checker,代码行数:25,代码来源:MPIBugReporter.cpp


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