clang  6.0.0svn
FreeBSD.h
Go to the documentation of this file.
1 //===--- FreeBSD.h - FreeBSD ToolChain Implementations ----------*- 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_FREEBSD_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FREEBSD_H
12 
13 #include "Gnu.h"
14 #include "clang/Driver/Driver.h"
15 #include "clang/Driver/ToolChain.h"
16 
17 namespace clang {
18 namespace driver {
19 namespace tools {
20 
21 /// freebsd -- Directly call GNU Binutils assembler and linker
22 namespace freebsd {
23 class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool {
24 public:
25  Assembler(const ToolChain &TC)
26  : GnuTool("freebsd::Assembler", "assembler", TC) {}
27 
28  bool hasIntegratedCPP() const override { return false; }
29 
30  void ConstructJob(Compilation &C, const JobAction &JA,
31  const InputInfo &Output, const InputInfoList &Inputs,
32  const llvm::opt::ArgList &TCArgs,
33  const char *LinkingOutput) const override;
34 };
35 
36 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
37 public:
38  Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {}
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 freebsd
49 } // end namespace tools
50 
51 namespace toolchains {
52 
53 class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
54 public:
55  FreeBSD(const Driver &D, const llvm::Triple &Triple,
56  const llvm::opt::ArgList &Args);
57  bool HasNativeLLVMSupport() const override;
58 
59  bool IsMathErrnoDefault() const override { return false; }
60  bool IsObjCNonFragileABIDefault() const override { return true; }
61 
62  CXXStdlibType GetDefaultCXXStdlibType() const override;
63  void addLibStdCxxIncludePaths(
64  const llvm::opt::ArgList &DriverArgs,
65  llvm::opt::ArgStringList &CC1Args) const override;
66  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
67  llvm::opt::ArgStringList &CmdArgs) const override;
68 
69  llvm::ExceptionHandling GetExceptionModel(
70  const llvm::opt::ArgList &Args) const override;
71  bool isPIEDefault() const override;
72  SanitizerMask getSupportedSanitizers() const override;
73  unsigned GetDefaultDwarfVersion() const override { return 2; }
74  // Until dtrace (via CTF) and LLDB can deal with distributed debug info,
75  // FreeBSD defaults to standalone/full debug info.
76  bool GetDefaultStandaloneDebug() const override { return true; }
77 
78 protected:
79  Tool *buildAssembler() const override;
80  Tool *buildLinker() const override;
81 };
82 
83 } // end namespace toolchains
84 } // end namespace driver
85 } // end namespace clang
86 
87 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FREEBSD_H
Linker(const ToolChain &TC)
Definition: FreeBSD.h:38
unsigned GetDefaultDwarfVersion() const override
Definition: FreeBSD.h:73
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
bool hasIntegratedCPP() const override
Definition: FreeBSD.h:28
bool IsMathErrnoDefault() const override
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition: FreeBSD.h:59
bool GetDefaultStandaloneDebug() const override
Definition: FreeBSD.h:76
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:41
bool hasIntegratedCPP() const override
Definition: FreeBSD.h:40
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 isLinkJob() const override
Definition: FreeBSD.h:41
bool IsObjCNonFragileABIDefault() const override
IsObjCNonFragileABIDefault - Does this tool chain set -fobjc-nonfragile-abi by default.
Definition: FreeBSD.h:60
Assembler(const ToolChain &TC)
Definition: FreeBSD.h:25
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73