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


C++ QualifiedType::unqualified方法代码示例

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


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

示例1: compare

int LexicalTypeOrdering::compare(const QualifiedType & t0, const QualifiedType & t1) {
  int result = compare(t0.unqualified(), t1.unqualified());
  if (result != 0) {
    return result;
  }

  if (t0.qualifiers() < t1.qualifiers()) {
    return -1;
  } else if (t0.qualifiers() > t1.qualifiers()) {
    return 1;
  } else {
    return 0;
  }
}
开发者ID:afrog33k,项目名称:tart,代码行数:14,代码来源:LexicalTypeOrdering.cpp

示例2: genFunction

bool CodeGenerator::genFunction(FunctionDefn * fdef) {
  // Don't generate undefined functions.
  if (fdef->isUndefined() || fdef->isAbstract() || fdef->isInterfaceMethod()) {
    return true;
  }

  DASSERT_OBJ(fdef->isSingular(), fdef);
  DASSERT_OBJ(fdef->type(), fdef);
  DASSERT_OBJ(fdef->type()->isSingular(), fdef);

  // Don't generate intrinsic functions.
  if (fdef->isIntrinsic()) {
    return true;
  }

  // Don't generate a function if it has been merged to another function
  if (fdef->mergeTo() != NULL || fdef->isUndefined()) {
    return true;
  }

  // Create the function
  Function * f = genFunctionValue(fdef);

  if (fdef->hasBody() && f->getBasicBlockList().empty()) {
    FunctionType * ftype = fdef->functionType();

    if (fdef->isSynthetic()) {
      f->setLinkage(GlobalValue::LinkOnceODRLinkage);
    }

    if (gcEnabled_) {
      if (SsGC) {
        f->setGC("shadow-stack");
      } else {
        f->setGC("tart-gc");
      }
    }

    if (debug_) {
      dbgContext_ = genDISubprogram(fdef);
      //dbgContext_ = genLexicalBlock(fdef->location());
      dbgInlineContext_ = DIScope();
      setDebugLocation(fdef->location());
    }

    BasicBlock * prologue = BasicBlock::Create(context_, "prologue", f);

    // Create the LLVM Basic Blocks corresponding to each high level BB.
//    BlockList & blocks = fdef->blocks();
//    for (BlockList::iterator b = blocks.begin(); b != blocks.end(); ++b) {
//      Block * blk = *b;
//      blk->setIRBlock(BasicBlock::Create(context_, blk->label(), f));
//    }

    builder_.SetInsertPoint(prologue);

    // Handle the explicit parameters
    unsigned param_index = 0;
    Function::arg_iterator it = f->arg_begin();

    Value * saveStructRet = structRet_;
    if (ftype->isStructReturn()) {
      it->addAttr(llvm::Attribute::StructRet);
      structRet_ = it;
      ++it;
    }

    // Handle the 'self' parameter
    if (ftype->selfParam() != NULL) {
      ParameterDefn * selfParam = ftype->selfParam();
      const Type * selfParamType = selfParam->type().unqualified();
      DASSERT_OBJ(fdef->storageClass() == Storage_Instance ||
          fdef->storageClass() == Storage_Local, fdef);
      DASSERT_OBJ(it != f->arg_end(), ftype);

      // Check if the self param is a root.
      if (selfParamType->isReferenceType()) {
        selfParam->setFlag(ParameterDefn::LValueParam, true);
        Value * selfAlloca = builder_.CreateAlloca(
            selfParam->type()->irEmbeddedType(), 0, "self.alloca");
        builder_.CreateStore(it, selfAlloca);
        selfParam->setIRValue(selfAlloca);
        markGCRoot(selfAlloca, NULL, "self.alloca");
      } else {
        // Since selfParam is always a pointer, we don't need to mark the object pointed
        // to as a root, since the next call frame up is responsible for tracing it.
        ftype->selfParam()->setIRValue(it);
      }

      it->setName("self");
      ++it;
    }

    // If this function needs to make allocations, cache a copy of the
    // allocation context pointer for this thread, since it can on some
    // platforms be expensive to look up.
    if (fdef->flags() & FunctionDefn::MakesAllocs) {
      Function * gcGetAllocContext = genFunctionValue(gc_allocContext);
      gcAllocContext_ = builder_.CreateCall(gcGetAllocContext, "allocCtx");
    }
//.........这里部分代码省略.........
开发者ID:afrog33k,项目名称:tart,代码行数:101,代码来源:CodeGenDefn.cpp

示例3: areTypesCompatible

bool FunctionMergePass::areTypesCompatible(QualifiedType from, QualifiedType to) {
  return areTypesCompatible(from.unqualified(), to.unqualified());
}
开发者ID:afrog33k,项目名称:tart,代码行数:3,代码来源:FunctionMergePass.cpp


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