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


C++ DISubprogram::getLineNumber方法代码示例

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


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

示例1: cmpDISP

bool cmpDISP(const DISubprogram & SP1, const DISubprogram & SP2) 
{ 
  int cmp = SP1.getDirectory().compare(SP2.getDirectory());
  if (cmp == 0) {
    cmp = SP1.getFilename().compare(SP2.getFilename());
    if (cmp == 0) {
      cmp = SP1.getLineNumber() - SP2.getLineNumber();
    }
  }
  return cmp >= 0 ? false : true;
}
开发者ID:sdasgup3,项目名称:llvm-slicer,代码行数:11,代码来源:Matcher.cpp

示例2: addSourceLine

/// addSourceLine - Add location information to specified debug information
/// entry.
void CompileUnit::addSourceLine(DIE *Die, DISubprogram SP) {
  // Verify subprogram.
  if (!SP.Verify())
    return;
  // If the line number is 0, don't add it.
  if (SP.getLineNumber() == 0)
    return;

  unsigned Line = SP.getLineNumber();
  if (!SP.getContext().Verify())
    return;
  unsigned FileID = DD->GetOrCreateSourceID(SP.getFilename(), SP.getDirectory());
  assert(FileID && "Invalid file id");
  addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
  addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例3: addFunction

void DebugDatabase::addFunction(MDNode *subprogram, GenerateRTL *hw) {
    string name;
    DISubprogram s;

    assert(subprogram || hw);

    if (subprogram) {
        s = DISubprogram(subprogram);
        name = s.getName().str();
    }

    if (hw) {
        //        dbgs() << "Adding function " <<
        //        hw->getFunction()->getName().str() << "\n";
        if (hwToFunctionIds.find(hw) != hwToFunctionIds.end()) {
            // This function has already been added
            // This can happen since we add functions with metadata first, then
            // add all functions with hardware next.  Those with metadata will
            // have
            // already been added
            //            dbgs() << "exiting\n";
            return;
        } else {
            //            dbgs() << "not exiting\n";
        }

        if (subprogram) {
            assert(name == hw->getFunction()->getName().str());
        } else {
            name = hw->getFunction()->getName().str();
        }
    }

    std::string query = "INSERT INTO Function (designId, name, inlined, "
                        "hasMetadata, startLineNumber) ";
    query += "VALUES (" + std::to_string(designId);
    query += "," + addQuotesToStr(name);
    query += "," + std::to_string(hw ? false : true);
    query += "," + std::to_string(subprogram ? true : false);
    query += "," + (subprogram ? std::to_string(s.getLineNumber()) : "NULL");
    query += ");";
    runQuery(query);

    int functionId = mysql_insert_id(connection);

    if (subprogram) {
        subprogramsToFunctionIds[subprogram] = functionId;
    }

    if (hw) {
        hwToFunctionIds[hw] = functionId;
    }
}
开发者ID:eddiehung,项目名称:dox-legup,代码行数:53,代码来源:DebugDatabase.cpp

示例4: getFnDebugLoc

DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) {
  const MDNode *Scope = getScopeNode(Ctx);
  DISubprogram SP = getDISubprogram(Scope);
  if (SP.isSubprogram()) {
    // Check for number of operands since the compatibility is
    // cheap here.  FIXME: Name the magic constant.
    if (SP->getNumOperands() > 19)
      return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
    else
      return DebugLoc::get(SP.getLineNumber(), 0, SP);
  }

  return DebugLoc();
}
开发者ID:ADonut,项目名称:LLVM-GPGPU,代码行数:14,代码来源:DebugLoc.cpp


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