clang  6.0.0svn
CommonArgs.h
Go to the documentation of this file.
1 //===--- CommonArgs.h - Args handling for multiple toolchains ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
12 
13 #include "InputInfo.h"
14 #include "clang/Driver/Driver.h"
15 #include "clang/Driver/Tool.h"
16 #include "clang/Driver/ToolChain.h"
17 #include "llvm/Support/CodeGen.h"
18 
19 namespace clang {
20 namespace driver {
21 namespace tools {
22 
23 void addPathIfExists(const Driver &D, const Twine &Path,
24  ToolChain::path_list &Paths);
25 
26 void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
27  const llvm::opt::ArgList &Args,
28  llvm::opt::ArgStringList &CmdArgs, const JobAction &JA);
29 
30 void claimNoWarnArgs(const llvm::opt::ArgList &Args);
31 
32 bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args,
33  llvm::opt::ArgStringList &CmdArgs);
34 
35 void linkSanitizerRuntimeDeps(const ToolChain &TC,
36  llvm::opt::ArgStringList &CmdArgs);
37 
38 void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
39  llvm::opt::ArgStringList &CmdArgs,
40  const llvm::opt::ArgList &Args);
41 
42 void AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C,
43  const InputInfo &Output,
44  const InputInfoList &Inputs,
45  const llvm::opt::ArgList &Args,
46  llvm::opt::ArgStringList &CmdArgs,
47  const JobAction &JA);
48 
49 const char *SplitDebugName(const llvm::opt::ArgList &Args,
50  const InputInfo &Input);
51 
52 void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,
53  const JobAction &JA, const llvm::opt::ArgList &Args,
54  const InputInfo &Output, const char *OutFile);
55 
56 void AddGoldPlugin(const ToolChain &ToolChain, const llvm::opt::ArgList &Args,
57  llvm::opt::ArgStringList &CmdArgs, bool IsThinLTO,
58  const Driver &D);
59 
60 std::tuple<llvm::Reloc::Model, unsigned, bool>
61 ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args);
62 
63 void AddAssemblerKPIC(const ToolChain &ToolChain,
64  const llvm::opt::ArgList &Args,
65  llvm::opt::ArgStringList &CmdArgs);
66 
67 void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args,
68  llvm::opt::ArgStringList &CmdArgs);
69 /// Returns true, if an OpenMP runtime has been added.
70 bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC,
71  const llvm::opt::ArgList &Args,
72  bool IsOffloadingHost = false, bool GompNeedsRT = false);
73 
74 llvm::opt::Arg *getLastProfileUseArg(const llvm::opt::ArgList &Args);
75 llvm::opt::Arg *getLastProfileSampleUseArg(const llvm::opt::ArgList &Args);
76 
77 bool isObjCAutoRefCount(const llvm::opt::ArgList &Args);
78 
79 unsigned getLTOParallelism(const llvm::opt::ArgList &Args, const Driver &D);
80 
81 bool areOptimizationsEnabled(const llvm::opt::ArgList &Args);
82 
83 bool isUseSeparateSections(const llvm::Triple &Triple);
84 
85 void addDirectoryList(const llvm::opt::ArgList &Args,
86  llvm::opt::ArgStringList &CmdArgs, const char *ArgName,
87  const char *EnvVar);
88 
89 void AddTargetFeature(const llvm::opt::ArgList &Args,
90  std::vector<StringRef> &Features,
91  llvm::opt::OptSpecifier OnOpt,
92  llvm::opt::OptSpecifier OffOpt, StringRef FeatureName);
93 
94 std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T,
95  bool FromAs = false);
96 
97 void handleTargetFeaturesGroup(const llvm::opt::ArgList &Args,
98  std::vector<StringRef> &Features,
99  llvm::opt::OptSpecifier Group);
100 
101 } // end namespace tools
102 } // end namespace driver
103 } // end namespace clang
104 
105 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
void handleTargetFeaturesGroup(const llvm::opt::ArgList &Args, std::vector< StringRef > &Features, llvm::opt::OptSpecifier Group)
SmallVector< std::string, 16 > path_list
Definition: ToolChain.h:75
bool isUseSeparateSections(const llvm::Triple &Triple)
Definition: CommonArgs.cpp:368
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
void AddTargetFeature(const llvm::opt::ArgList &Args, std::vector< StringRef > &Features, llvm::opt::OptSpecifier OnOpt, llvm::opt::OptSpecifier OffOpt, StringRef FeatureName)
std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
void linkSanitizerRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void AddGoldPlugin(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool IsThinLTO, const Driver &D)
bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC, const llvm::opt::ArgList &Args, bool IsOffloadingHost=false, bool GompNeedsRT=false)
Returns true, if an OpenMP runtime has been added.
void AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
void addDirectoryList(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const char *ArgName, const char *EnvVar)
const FunctionProtoType * T
const char * SplitDebugName(const llvm::opt::ArgList &Args, const InputInfo &Input)
std::tuple< llvm::Reloc::Model, unsigned, bool > ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args)
bool isObjCAutoRefCount(const llvm::opt::ArgList &Args)
void AddAssemblerKPIC(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
llvm::opt::Arg * getLastProfileSampleUseArg(const llvm::opt::ArgList &Args)
llvm::opt::Arg * getLastProfileUseArg(const llvm::opt::ArgList &Args)
void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T, const JobAction &JA, const llvm::opt::ArgList &Args, const InputInfo &Output, const char *OutFile)
SmallVector< InputInfo, 4 > InputInfoList
Definition: Tool.h:29
Dataflow Directional Tag Classes.
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
unsigned getLTOParallelism(const llvm::opt::ArgList &Args, const Driver &D)
bool areOptimizationsEnabled(const llvm::opt::ArgList &Args)
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
void addPathIfExists(const Driver &D, const Twine &Path, ToolChain::path_list &Paths)
Definition: CommonArgs.cpp:59