003 File Manager
Current Path:
/usr/src/contrib/llvm-project/clang/lib/Driver/ToolChains
usr
/
src
/
contrib
/
llvm-project
/
clang
/
lib
/
Driver
/
ToolChains
/
📁
..
📄
AIX.cpp
(7.69 KB)
📄
AIX.h
(2.51 KB)
📄
AMDGPU.cpp
(21.42 KB)
📄
AMDGPU.h
(3.72 KB)
📄
AVR.cpp
(5.72 KB)
📄
AVR.h
(1.94 KB)
📄
Ananas.cpp
(5.21 KB)
📄
Ananas.h
(2.06 KB)
📁
Arch
📄
BareMetal.cpp
(6.4 KB)
📄
BareMetal.h
(2.96 KB)
📄
Clang.cpp
(270.02 KB)
📄
Clang.h
(7.82 KB)
📄
CloudABI.cpp
(5.05 KB)
📄
CloudABI.h
(2.3 KB)
📄
CommonArgs.cpp
(49.63 KB)
📄
CommonArgs.h
(5.95 KB)
📄
Contiki.cpp
(926 B)
📄
Contiki.h
(1.25 KB)
📄
CrossWindows.cpp
(9.44 KB)
📄
CrossWindows.h
(2.93 KB)
📄
Cuda.cpp
(36.52 KB)
📄
Cuda.h
(7.5 KB)
📄
Darwin.cpp
(103.49 KB)
📄
Darwin.h
(20.22 KB)
📄
DragonFly.cpp
(6.83 KB)
📄
DragonFly.h
(2.16 KB)
📄
Flang.cpp
(2.57 KB)
📄
Flang.h
(1.45 KB)
📄
FreeBSD.cpp
(15.99 KB)
📄
FreeBSD.h
(3.72 KB)
📄
Fuchsia.cpp
(12.4 KB)
📄
Fuchsia.h
(3.72 KB)
📄
Gnu.cpp
(118.91 KB)
📄
Gnu.h
(14.8 KB)
📄
HIP.cpp
(15.47 KB)
📄
HIP.h
(4.4 KB)
📄
Haiku.cpp
(1.28 KB)
📄
Haiku.h
(1.25 KB)
📄
Hexagon.cpp
(23.79 KB)
📄
Hexagon.h
(4.34 KB)
📄
Hurd.cpp
(7.1 KB)
📄
Hurd.h
(1.5 KB)
📄
InterfaceStubs.cpp
(2.63 KB)
📄
InterfaceStubs.h
(1.23 KB)
📄
Lanai.h
(1.31 KB)
📄
Linux.cpp
(32.88 KB)
📄
Linux.h
(2.69 KB)
📄
MSP430.cpp
(7.95 KB)
📄
MSP430.h
(2.45 KB)
📄
MSVC.cpp
(57.11 KB)
📄
MSVC.h
(6.12 KB)
📄
MSVCSetupApi.h
(19.2 KB)
📄
MinGW.cpp
(21.52 KB)
📄
MinGW.h
(3.8 KB)
📄
Minix.cpp
(3.98 KB)
📄
Minix.h
(2.05 KB)
📄
MipsLinux.cpp
(4.48 KB)
📄
MipsLinux.h
(1.98 KB)
📄
Myriad.cpp
(11.75 KB)
📄
Myriad.h
(3.73 KB)
📄
NaCl.cpp
(13.25 KB)
📄
NaCl.h
(3.01 KB)
📄
NetBSD.cpp
(16.56 KB)
📄
NetBSD.h
(2.97 KB)
📄
OpenBSD.cpp
(10.17 KB)
📄
OpenBSD.h
(3.31 KB)
📄
PPCLinux.cpp
(1.06 KB)
📄
PPCLinux.h
(1.05 KB)
📄
PS4CPU.cpp
(9.53 KB)
📄
PS4CPU.h
(3.68 KB)
📄
RISCVToolchain.cpp
(7.25 KB)
📄
RISCVToolchain.h
(2.28 KB)
📄
ROCm.h
(6.94 KB)
📄
Solaris.cpp
(10.41 KB)
📄
Solaris.h
(2.5 KB)
📄
TCE.cpp
(1.49 KB)
📄
TCE.h
(1.49 KB)
📄
VEToolchain.cpp
(4.09 KB)
📄
VEToolchain.h
(2.16 KB)
📄
WebAssembly.cpp
(13.53 KB)
📄
WebAssembly.h
(2.94 KB)
📄
XCore.cpp
(5.48 KB)
📄
XCore.h
(2.98 KB)
Editing: Flang.cpp
//===-- Flang.cpp - Flang+LLVM ToolChain Implementations --------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "Flang.h" #include "CommonArgs.h" #include "clang/Driver/Options.h" #include <cassert> using namespace clang::driver; using namespace clang::driver::tools; using namespace clang; using namespace llvm::opt; void Flang::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { const auto &TC = getToolChain(); const llvm::Triple &Triple = TC.getEffectiveTriple(); const std::string &TripleStr = Triple.getTriple(); ArgStringList CmdArgs; CmdArgs.push_back("-fc1"); CmdArgs.push_back("-triple"); CmdArgs.push_back(Args.MakeArgString(TripleStr)); if (isa<PreprocessJobAction>(JA)) { CmdArgs.push_back("-E"); } else if (isa<CompileJobAction>(JA) || isa<BackendJobAction>(JA)) { if (JA.getType() == types::TY_Nothing) { CmdArgs.push_back("-fsyntax-only"); } else if (JA.getType() == types::TY_AST) { CmdArgs.push_back("-emit-ast"); } else if (JA.getType() == types::TY_LLVM_IR || JA.getType() == types::TY_LTO_IR) { CmdArgs.push_back("-emit-llvm"); } else if (JA.getType() == types::TY_LLVM_BC || JA.getType() == types::TY_LTO_BC) { CmdArgs.push_back("-emit-llvm-bc"); } else if (JA.getType() == types::TY_PP_Asm) { CmdArgs.push_back("-S"); } else { assert(false && "Unexpected output type!"); } } else if (isa<AssembleJobAction>(JA)) { CmdArgs.push_back("-emit-obj"); } else { assert(false && "Unexpected action class for Flang tool."); } if (Output.isFilename()) { CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); } else { assert(Output.isNothing() && "Invalid output."); } const InputInfo &Input = Inputs[0]; assert(Input.isFilename() && "Invalid input."); CmdArgs.push_back(Input.getFilename()); const auto& D = C.getDriver(); const char* Exec = Args.MakeArgString(D.GetProgramPath("flang", TC)); C.addCommand(std::make_unique<Command>( JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, Inputs)); } Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {} Flang::~Flang() {}
Upload File
Create Folder