clang  6.0.0svn
CrossWindows.h
Go to the documentation of this file.
1 //===--- CrossWindows.h - CrossWindows ToolChain Implementation -*- 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_CROSSWINDOWS_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
12 
13 #include "Cuda.h"
14 #include "Gnu.h"
15 #include "clang/Driver/Tool.h"
16 #include "clang/Driver/ToolChain.h"
17 
18 namespace clang {
19 namespace driver {
20 namespace tools {
21 
22 namespace CrossWindows {
23 class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
24 public:
25  Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {}
26 
27  bool hasIntegratedCPP() const override { return false; }
28 
29  void ConstructJob(Compilation &C, const JobAction &JA,
30  const InputInfo &Output, const InputInfoList &Inputs,
31  const llvm::opt::ArgList &TCArgs,
32  const char *LinkingOutput) const override;
33 };
34 
35 class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
36 public:
37  Linker(const ToolChain &TC)
38  : Tool("CrossWindows::Linker", "ld", TC, RF_Full) {}
39 
40  bool hasIntegratedCPP() const override { return false; }
41  bool isLinkJob() const override { return true; }
42 
43  void ConstructJob(Compilation &C, const JobAction &JA,
44  const InputInfo &Output, const InputInfoList &Inputs,
45  const llvm::opt::ArgList &TCArgs,
46  const char *LinkingOutput) const override;
47 };
48 } // end namespace CrossWindows
49 } // end namespace tools
50 
51 namespace toolchains {
52 
53 class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC {
54 public:
55  CrossWindowsToolChain(const Driver &D, const llvm::Triple &T,
56  const llvm::opt::ArgList &Args);
57 
58  bool IsIntegratedAssemblerDefault() const override { return true; }
59  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
60  bool isPICDefault() const override;
61  bool isPIEDefault() const override;
62  bool isPICDefaultForced() const override;
63 
64  unsigned int GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
65  return 0;
66  }
67 
68  void
69  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
70  llvm::opt::ArgStringList &CC1Args) const override;
71  void AddClangCXXStdlibIncludeArgs(
72  const llvm::opt::ArgList &DriverArgs,
73  llvm::opt::ArgStringList &CC1Args) const override;
74  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
75  llvm::opt::ArgStringList &CmdArgs) const override;
76 
77  SanitizerMask getSupportedSanitizers() const override;
78 
79 protected:
80  Tool *buildLinker() const override;
81  Tool *buildAssembler() const override;
82 };
83 
84 } // end namespace toolchains
85 } // end namespace driver
86 } // end namespace clang
87 
88 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
Generic_GCC - A tool chain using the 'gcc' command to perform all subcommands; this relies on gcc tra...
Definition: Gnu.h:140
unsigned int GetDefaultStackProtectorLevel(bool KernelOrKext) const override
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off...
Definition: CrossWindows.h:64
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
const FunctionProtoType * T
Dataflow Directional Tag Classes.
uint64_t SanitizerMask
Definition: Sanitizers.h:24
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: CrossWindows.h:58
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73