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


C++ const_global_iterator::hasDLLExportStorageClass方法代码示例

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


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

示例1: if


//.........这里部分代码省略.........
        // implementation of multiple entry points).  If this doesn't occur, the
        // linker can safely perform dead code stripping.  Since LLVM never
        // generates code that does this, it is always safe to set.
        OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
    }

    if (Subtarget->isTargetWindows() && !Subtarget->isTargetCygMing() &&
            MMI->usesVAFloatArgument()) {
        StringRef SymbolName = Subtarget->is64Bit() ? "_fltused" : "__fltused";
        MCSymbol *S = MMI->getContext().GetOrCreateSymbol(SymbolName);
        OutStreamer.EmitSymbolAttribute(S, MCSA_Global);
    }

    if (Subtarget->isTargetCOFF()) {
        Cse523COFFMachineModuleInfo &COFFMMI =
            MMI->getObjFileInfo<Cse523COFFMachineModuleInfo>();

        // Emit type information for external functions
        typedef Cse523COFFMachineModuleInfo::externals_iterator externals_iterator;
        for (externals_iterator I = COFFMMI.externals_begin(),
                E = COFFMMI.externals_end();
                I != E; ++I) {
            OutStreamer.BeginCOFFSymbolDef(CurrentFnSym);
            OutStreamer.EmitCOFFSymbolStorageClass(COFF::IMAGE_SYM_CLASS_EXTERNAL);
            OutStreamer.EmitCOFFSymbolType(COFF::IMAGE_SYM_DTYPE_FUNCTION
                    << COFF::SCT_COMPLEX_TYPE_SHIFT);
            OutStreamer.EndCOFFSymbolDef();
        }

        // Necessary for dllexport support
        std::vector<const MCSymbol*> DLLExportedFns, DLLExportedGlobals;

        for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
            if (I->hasDLLExportStorageClass())
                DLLExportedFns.push_back(getSymbol(I));

        for (Module::const_global_iterator I = M.global_begin(),
                E = M.global_end(); I != E; ++I)
            if (I->hasDLLExportStorageClass())
                DLLExportedGlobals.push_back(getSymbol(I));

        for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
                I != E; ++I) {
            const GlobalValue *GV = I;
            if (!GV->hasDLLExportStorageClass())
                continue;

            while (const GlobalAlias *A = dyn_cast<GlobalAlias>(GV))
                GV = A->getAliasedGlobal();

            if (isa<Function>(GV))
                DLLExportedFns.push_back(getSymbol(I));
            else if (isa<GlobalVariable>(GV))
                DLLExportedGlobals.push_back(getSymbol(I));
        }

        // Output linker support code for dllexported globals on windows.
        if (!DLLExportedGlobals.empty() || !DLLExportedFns.empty()) {
            const TargetLoweringObjectFileCOFF &TLOFCOFF =
                static_cast<const TargetLoweringObjectFileCOFF&>(getObjFileLowering());

            OutStreamer.SwitchSection(TLOFCOFF.getDrectveSection());
            SmallString<128> name;
            for (unsigned i = 0, e = DLLExportedGlobals.size(); i != e; ++i) {
                if (Subtarget->isTargetWindows())
                    name = " /EXPORT:";
开发者ID:sahilpparmar,项目名称:llvm_backend,代码行数:67,代码来源:Cse523AsmPrinter.cpp


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