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


C++ ArgStringList::push_back方法代码示例

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


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

示例1: addClangTargetOptions

void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs,
                                        ArgStringList &CC1Args,
                                        Action::OffloadKind) const {
  if (DriverArgs.hasFlag(clang::driver::options::OPT_fuse_init_array,
                         options::OPT_fno_use_init_array, true))
    CC1Args.push_back("-fuse-init-array");
}
开发者ID:JaredCJR,项目名称:clang,代码行数:7,代码来源:WebAssembly.cpp

示例2: AddAllArgsTranslated

void ArgList::AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0,
                                   const char *Translation,
                                   bool Joined) const {
    for (arg_iterator it = filtered_begin(Id0),
            ie = filtered_end(); it != ie; ++it) {
        it->claim();

        if (Joined) {
            Output.push_back(MakeArgString(llvm::StringRef(Translation) +
                                           it->getValue(*this, 0)));
        } else {
            Output.push_back(Translation);
            Output.push_back(it->getValue(*this, 0));
        }
    }
}
开发者ID:jhoush,项目名称:dist-clang,代码行数:16,代码来源:ArgList.cpp

示例3: AddCXXStdlibLibArgs

void NaClToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
                                        ArgStringList &CmdArgs) const {
  // Check for -stdlib= flags. We only support libc++ but this consumes the arg
  // if the value is libc++, and emits an error for other values.
  GetCXXStdlibType(Args);
  CmdArgs.push_back("-lc++");
}
开发者ID:Bekenn,项目名称:clang,代码行数:7,代码来源:NaCl.cpp

示例4: addInputsOfType

ToolChain::InvocationInfo
ToolChain::constructInvocation(const MergeModuleJobAction &job,
                               const JobContext &context) const {
  ArgStringList Arguments;

  if (context.OI.CompilerMode != OutputInfo::Mode::UpdateCode)
    Arguments.push_back("-frontend");

  // We just want to emit a module, so pass -emit-module without any other
  // mode options.
  Arguments.push_back("-emit-module");

  size_t origLen = Arguments.size();
  (void)origLen;
  addInputsOfType(Arguments, context.Inputs, types::TY_SwiftModuleFile);
  addInputsOfType(Arguments, context.InputActions, types::TY_SwiftModuleFile);
  assert(Arguments.size() - origLen >=
         context.Inputs.size() + context.InputActions.size());
  assert((Arguments.size() - origLen == context.Inputs.size() ||
          !context.InputActions.empty()) &&
         "every input to MergeModule must generate a swiftmodule");

  // Tell all files to parse as library, which is necessary to load them as
  // serialized ASTs.
  Arguments.push_back("-parse-as-library");

  addCommonFrontendArgs(*this, context.OI, context.Output, context.Args,
                        Arguments);

  Arguments.push_back("-module-name");
  Arguments.push_back(context.Args.MakeArgString(context.OI.ModuleName));

  assert(context.Output.getPrimaryOutputType() == types::TY_SwiftModuleFile &&
         "The MergeModule tool only produces swiftmodule files!");

  const std::string &ObjCHeaderOutputPath =
    context.Output.getAdditionalOutputForType(types::TY_ObjCHeader);
  if (!ObjCHeaderOutputPath.empty()) {
    Arguments.push_back("-emit-objc-header-path");
    Arguments.push_back(ObjCHeaderOutputPath.c_str());
  }

  Arguments.push_back("-o");
  Arguments.push_back(
      context.Args.MakeArgString(context.Output.getPrimaryOutputFilename()));

  auto program = SWIFT_EXECUTABLE_NAME;
  if (context.OI.CompilerMode == OutputInfo::Mode::UpdateCode)
    program = SWIFT_UPDATE_NAME;

  return {program, Arguments};
}
开发者ID:ldhlfzysys,项目名称:swift,代码行数:52,代码来源:ToolChains.cpp

示例5: addLinkSanitizerLibArgsForDarwin

static void addLinkSanitizerLibArgsForDarwin(const ArgList &Args,
                                             ArgStringList &Arguments,
                                             StringRef Sanitizer,
                                             const ToolChain &TC,
                                             bool shared = true) {
  // Sanitizer runtime libraries requires C++.
  Arguments.push_back("-lc++");
  // Add explicit dependency on -lc++abi, as -lc++ doesn't re-export
  // all RTTI-related symbols that are used.
  Arguments.push_back("-lc++abi");

  auto LibName = TC.sanitizerRuntimeLibName(Sanitizer, shared);
  TC.addLinkRuntimeLib(Args, Arguments, LibName);

  if (shared)
    addLinkRuntimeLibRPath(Args, Arguments, LibName, TC);
}
开发者ID:pitiphong-p,项目名称:swift,代码行数:17,代码来源:DarwinToolChains.cpp

示例6: linkSanitizerRuntimeDeps

void tools::linkSanitizerRuntimeDeps(const ToolChain &TC,
                                     ArgStringList &CmdArgs) {
  // Force linking against the system libraries sanitizers depends on
  // (see PR15823 why this is necessary).
  CmdArgs.push_back("--no-as-needed");
  // There's no libpthread or librt on RTEMS.
  if (TC.getTriple().getOS() != llvm::Triple::RTEMS) {
    CmdArgs.push_back("-lpthread");
    CmdArgs.push_back("-lrt");
  }
  CmdArgs.push_back("-lm");
  // There's no libdl on FreeBSD or RTEMS.
  if (TC.getTriple().getOS() != llvm::Triple::FreeBSD &&
      TC.getTriple().getOS() != llvm::Triple::NetBSD &&
      TC.getTriple().getOS() != llvm::Triple::RTEMS)
    CmdArgs.push_back("-ldl");
}
开发者ID:jacobly0,项目名称:llvm-z80,代码行数:17,代码来源:CommonArgs.cpp

示例7: AddAllArgValues

void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
                              OptSpecifier Id1, OptSpecifier Id2) const {
  for (auto Arg : filtered(Id0, Id1, Id2)) {
    Arg->claim();
    for (unsigned i = 0, e = Arg->getNumValues(); i != e; ++i)
      Output.push_back(Arg->getValue(i));
  }
}
开发者ID:A2-Collaboration,项目名称:root,代码行数:8,代码来源:ArgList.cpp

示例8: os

ToolChain::InvocationInfo
ToolChain::constructInvocation(const REPLJobAction &job,
                               const JobContext &context) const {
  assert(context.Inputs.empty());
  assert(context.InputActions.empty());

  bool useLLDB;

  switch (job.getRequestedMode()) {
  case REPLJobAction::Mode::Integrated:
    useLLDB = false;
    break;
  case REPLJobAction::Mode::RequireLLDB:
    useLLDB = true;
    break;
  case REPLJobAction::Mode::PreferLLDB:
    useLLDB = !findProgramRelativeToSwift("lldb").empty();
    break;
  }

  ArgStringList FrontendArgs;
  addCommonFrontendArgs(*this, context.OI, context.Output, context.Args,
                        FrontendArgs);
  context.Args.AddAllArgs(FrontendArgs, options::OPT_l, options::OPT_framework,
                          options::OPT_L);

  if (!useLLDB) {
    FrontendArgs.insert(FrontendArgs.begin(), {"-frontend", "-repl"});
    FrontendArgs.push_back("-module-name");
    FrontendArgs.push_back(context.Args.MakeArgString(context.OI.ModuleName));
    return {SWIFT_EXECUTABLE_NAME, FrontendArgs};
  }

  // Squash important frontend options into a single argument for LLDB.
  std::string SingleArg = "--repl=";
  {
    llvm::raw_string_ostream os(SingleArg);
    Job::printArguments(os, FrontendArgs);
  }

  ArgStringList Arguments;
  Arguments.push_back(context.Args.MakeArgString(std::move(SingleArg)));

  return {"lldb", Arguments};
}
开发者ID:690130229,项目名称:swift,代码行数:45,代码来源:ToolChains.cpp

示例9: addSanitizerRuntimes

// Should be called before we add system libraries (C++ ABI, libstdc++/libc++,
// C runtime, etc). Returns true if sanitizer system deps need to be linked in.
bool tools::addSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
                                 ArgStringList &CmdArgs) {
  SmallVector<StringRef, 4> SharedRuntimes, StaticRuntimes,
      NonWholeStaticRuntimes, HelperStaticRuntimes, RequiredSymbols;
  collectSanitizerRuntimes(TC, Args, SharedRuntimes, StaticRuntimes,
                           NonWholeStaticRuntimes, HelperStaticRuntimes,
                           RequiredSymbols);

  // Inject libfuzzer dependencies.
  if (TC.getSanitizerArgs().needsFuzzer()
      && !Args.hasArg(options::OPT_shared)) {

    addSanitizerRuntime(TC, Args, CmdArgs, "fuzzer", false, true);
    if (!Args.hasArg(clang::driver::options::OPT_nostdlibxx))
      TC.AddCXXStdlibLibArgs(Args, CmdArgs);
  }

  for (auto RT : SharedRuntimes)
    addSanitizerRuntime(TC, Args, CmdArgs, RT, true, false);
  for (auto RT : HelperStaticRuntimes)
    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);
  bool AddExportDynamic = false;
  for (auto RT : StaticRuntimes) {
    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);
    AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);
  }
  for (auto RT : NonWholeStaticRuntimes) {
    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, false);
    AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);
  }
  for (auto S : RequiredSymbols) {
    CmdArgs.push_back("-u");
    CmdArgs.push_back(Args.MakeArgString(S));
  }
  // If there is a static runtime with no dynamic list, force all the symbols
  // to be dynamic to be sure we export sanitizer interface functions.
  if (AddExportDynamic)
    CmdArgs.push_back("-export-dynamic");

  const SanitizerArgs &SanArgs = TC.getSanitizerArgs();
  if (SanArgs.hasCrossDsoCfi() && !AddExportDynamic)
    CmdArgs.push_back("-export-dynamic-symbol=__cfi_check");

  return !StaticRuntimes.empty() || !NonWholeStaticRuntimes.empty();
}
开发者ID:jacobly0,项目名称:llvm-z80,代码行数:47,代码来源:CommonArgs.cpp

示例10: addInputsOfType

static void addInputsOfType(ArgStringList &Arguments,
                            ArrayRef<const Job *> Jobs,
                            types::ID InputType) {
  for (const Job *Cmd : Jobs) {
    auto &output = Cmd->getOutput().getAnyOutputForType(InputType);
    if (!output.empty())
      Arguments.push_back(output.c_str());
  }
}
开发者ID:690130229,项目名称:swift,代码行数:9,代码来源:ToolChains.cpp

示例11:

void MSP430ToolChain::addClangTargetOptions(const ArgList &DriverArgs,
                                            ArgStringList &CC1Args,
                                            Action::OffloadKind) const {
  CC1Args.push_back("-nostdsysteminc");

  const auto *MCUArg = DriverArgs.getLastArg(options::OPT_mmcu_EQ);
  if (!MCUArg)
    return;

  const StringRef MCU = MCUArg->getValue();
  if (MCU.startswith("msp430i")) {
    // 'i' should be in lower case as it's defined in TI MSP430-GCC headers
    CC1Args.push_back(DriverArgs.MakeArgString(
        "-D__MSP430i" + MCU.drop_front(7).upper() + "__"));
  } else {
    CC1Args.push_back(DriverArgs.MakeArgString("-D__" + MCU.upper() + "__"));
  }
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:18,代码来源:MSP430.cpp

示例12: addClangTargetOptions

void HexagonToolChain::addClangTargetOptions(const ArgList &DriverArgs,
                                             ArgStringList &CC1Args,
                                             Action::OffloadKind) const {
  if (DriverArgs.hasArg(options::OPT_ffp_contract))
    return;
  unsigned OptLevel = getOptimizationLevel(DriverArgs);
  if (OptLevel >= 3)
    CC1Args.push_back("-ffp-contract=fast");
}
开发者ID:JaredCJR,项目名称:clang,代码行数:9,代码来源:Hexagon.cpp

示例13: renderAsInput

void Arg::renderAsInput(const ArgList &Args, ArgStringList &Output) const {
    if (!getOption().hasNoOptAsInput()) {
        render(Args, Output);
        return;
    }

    for (unsigned i = 0, e = getNumValues(); i != e; ++i)
        Output.push_back(getValue(Args, i));
}
开发者ID:asdlei00,项目名称:freebsd,代码行数:9,代码来源:Arg.cpp

示例14: AddClangCXXStdlibIncludeArgs

void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args,
                                             ArgStringList &CmdArgs,
                                             bool ObjCXXAutoRefCount) const {
  CXXStdlibType Type = GetCXXStdlibType(Args);

  // Header search paths are handled by the mass of goop in InitHeaderSearch.

  switch (Type) {
  case ToolChain::CST_Libcxx:
    if (ObjCXXAutoRefCount)
      CmdArgs.push_back("-fobjc-arc-cxxlib=libc++");
    break;

  case ToolChain::CST_Libstdcxx:
    if (ObjCXXAutoRefCount)
      CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++");
    break;
  }
}
开发者ID:ACSOP,项目名称:android_external_clang,代码行数:19,代码来源:ToolChain.cpp

示例15: AddAssemblerKPIC

void tools::AddAssemblerKPIC(const ToolChain &ToolChain, const ArgList &Args,
                             ArgStringList &CmdArgs) {
  llvm::Reloc::Model RelocationModel;
  unsigned PICLevel;
  bool IsPIE;
  std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(ToolChain, Args);

  if (RelocationModel != llvm::Reloc::Static)
    CmdArgs.push_back("-KPIC");
}
开发者ID:jacobly0,项目名称:llvm-z80,代码行数:10,代码来源:CommonArgs.cpp


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