clang/AMDGPU: Use TranslateArgs from the base toolchain instead of the host (#198627) This fixes -Xopenmp-target / -Xarch for arbitrary arguments. HIP and OpenMP had cargo-cult broken implementations of TranslateArgs, which called the host toolchain's implementation, and then special case transferred either -march or -mcpu to the device argument list. The respective device forwarding flags should work for any argument, not just this one. The main feature that needs to be preserved is the shared filtering of unsupported sanitizers to degrade them into warnings. Most of the changes here are dealing with fallout observed when the host target is darwin. The darwin toolchain happens to have some hacky statefulness tracking the compile target version, which gets written and rewritten on argument parsing. To maintain this hack, there are a few unused calls to getArgsForToolChain; start passing OFK_Host to these so the offload toolchains don't get confused and think they're in a non-offload context.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.