コード例 #1
0
ファイル: ArgumentsAdjusters.cpp プロジェクト: PolyJIT/clang
/// Add -fsyntax-only option to the command line arguments.
ArgumentsAdjuster getClangSyntaxOnlyAdjuster() {
  return [](const CommandLineArguments &Args, StringRef /*unused*/) {
    CommandLineArguments AdjustedArgs;
    for (size_t i = 0, e = Args.size(); i != e; ++i) {
      StringRef Arg = Args[i];
      // FIXME: Remove options that generate output.
      if (!Arg.startswith("-fcolor-diagnostics") &&
          !Arg.startswith("-fdiagnostics-color"))
        AdjustedArgs.push_back(Args[i]);
    }
    AdjustedArgs.push_back("-fsyntax-only");
    return AdjustedArgs;
  };
}
コード例 #2
0
/// Add -fsyntax-only option to the commnand line arguments.
CommandLineArguments
LFortSyntaxOnlyAdjuster::Adjust(const CommandLineArguments &Args) {
  CommandLineArguments AdjustedArgs = Args;
  // FIXME: Remove options that generate output.
  AdjustedArgs.push_back("-fsyntax-only");
  return AdjustedArgs;
}
コード例 #3
0
ファイル: Tooling.cpp プロジェクト: llvm-beanz/clang
static void injectResourceDir(CommandLineArguments &Args, const char *Argv0,
                              void *MainAddr) {
    // Allow users to override the resource dir.
    for (StringRef Arg : Args)
        if (Arg.startswith("-resource-dir"))
            return;

    // If there's no override in place add our resource dir.
    Args.push_back("-resource-dir=" +
                   CompilerInvocation::GetResourcesPath(Argv0, MainAddr));
}
コード例 #4
0
ファイル: ArgumentsAdjusters.cpp プロジェクト: PolyJIT/clang
ArgumentsAdjuster getClangStripOutputAdjuster() {
  return [](const CommandLineArguments &Args, StringRef /*unused*/) {
    CommandLineArguments AdjustedArgs;
    for (size_t i = 0, e = Args.size(); i < e; ++i) {
      StringRef Arg = Args[i];
      if (!Arg.startswith("-o"))
        AdjustedArgs.push_back(Args[i]);

      if (Arg == "-o") {
        // Output is specified as -o foo. Skip the next argument too.
        ++i;
      }
      // Else, the output is specified as -ofoo. Just do nothing.
    }
    return AdjustedArgs;
  };
}
コード例 #5
0
ファイル: ArgumentsAdjusters.cpp プロジェクト: PolyJIT/clang
ArgumentsAdjuster getClangStripDependencyFileAdjuster() {
  return [](const CommandLineArguments &Args, StringRef /*unused*/) {
    CommandLineArguments AdjustedArgs;
    for (size_t i = 0, e = Args.size(); i < e; ++i) {
      StringRef Arg = Args[i];
      // All dependency-file options begin with -M. These include -MM,
      // -MF, -MG, -MP, -MT, -MQ, -MD, and -MMD.
      if (!Arg.startswith("-M"))
        AdjustedArgs.push_back(Args[i]);

      if ((Arg == "-MF") || (Arg == "-MT") || (Arg == "-MQ") ||
          (Arg == "-MD") || (Arg == "-MMD")) {
        // Output is specified as -MX foo. Skip the next argument also.
        ++i;
      }
    }
    return AdjustedArgs;
  };
}
コード例 #6
0
 CommandLineArguments Adjust(const CommandLineArguments &Args) {
   CommandLineArguments AdjustedArgs = Args;
   AdjustedArgs.push_back("-fsyntax-only");
   AdjustedArgs.push_back("-std=c++11");
   return AdjustedArgs;
 }