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


C++ MCSymbol::setAbsolute方法代码示例

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


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

示例1:

void Cse523AsmPrinter::EmitStartOfAsmFile(Module &M) {
    if (Subtarget->isTargetMacho())
        OutStreamer.SwitchSection(getObjFileLowering().getTextSection());

    if (Subtarget->isTargetCOFF()) {
        // Emit an absolute @feat.00 symbol.  This appears to be some kind of
        // compiler features bitfield read by link.exe.
        if (!Subtarget->is64Bit()) {
            MCSymbol *S = MMI->getContext().GetOrCreateSymbol(StringRef("@feat.00"));
            OutStreamer.BeginCOFFSymbolDef(S);
            OutStreamer.EmitCOFFSymbolStorageClass(COFF::IMAGE_SYM_CLASS_STATIC);
            OutStreamer.EmitCOFFSymbolType(COFF::IMAGE_SYM_DTYPE_NULL);
            OutStreamer.EndCOFFSymbolDef();
            // According to the PE-COFF spec, the LSB of this value marks the object
            // for "registered SEH".  This means that all SEH handler entry points
            // must be registered in .sxdata.  Use of any unregistered handlers will
            // cause the process to terminate immediately.  LLVM does not know how to
            // register any SEH handlers, so its object files should be safe.
            S->setAbsolute();
            OutStreamer.EmitSymbolAttribute(S, MCSA_Global);
            OutStreamer.EmitAssignment(
                    S, MCConstantExpr::Create(int64_t(1), MMI->getContext()));
        }
    }
}
开发者ID:sahilpparmar,项目名称:llvm_backend,代码行数:25,代码来源:Cse523AsmPrinter.cpp

示例2: EmitFileDirective

// Add a symbol for the file name of this module. This is the second
// entry in the module's symbol table (the first being the null symbol).
void MCELFStreamer::EmitFileDirective(StringRef Filename) {
  MCSymbol *Symbol = getAssembler().getContext().GetOrCreateSymbol(Filename);
  Symbol->setSection(*getCurrentSection());
  Symbol->setAbsolute();

  MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);

  SD.setFlags(ELF_STT_File | ELF_STB_Local | ELF_STV_Default);
}
开发者ID:shaoming,项目名称:llvm-mirror,代码行数:11,代码来源:MCELFStreamer.cpp


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