diff options
author | Samuel Antao <sfantao@us.ibm.com> | 2016-10-27 17:39:44 +0000 |
---|---|---|
committer | Samuel Antao <sfantao@us.ibm.com> | 2016-10-27 17:39:44 +0000 |
commit | 31fef989934d38385567f9df8016e0d567a62bd0 (patch) | |
tree | cb0c20475700c8b276cfe0fb6a9b70e9e66a3cf2 /clang/lib/Driver/Compilation.cpp | |
parent | 59efaede56bebf15853f06faa9a799b6963b43de (diff) | |
download | llvm-31fef989934d38385567f9df8016e0d567a62bd0.zip llvm-31fef989934d38385567f9df8016e0d567a62bd0.tar.gz llvm-31fef989934d38385567f9df8016e0d567a62bd0.tar.bz2 |
[Driver][OpenMP] Add logic for offloading-specific argument translation.
Summary:
This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain.
With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation.
Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel
Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin
Differential Revision: https://reviews.llvm.org/D21848
llvm-svn: 285320
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r-- | clang/lib/Driver/Compilation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 6bbaae6..5c13e59 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -50,14 +50,15 @@ Compilation::~Compilation() { } } -const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC, - StringRef BoundArch) { +const DerivedArgList & +Compilation::getArgsForToolChain(const ToolChain *TC, StringRef BoundArch, + Action::OffloadKind DeviceOffloadKind) { if (!TC) TC = &DefaultToolChain; - DerivedArgList *&Entry = TCArgs[std::make_pair(TC, BoundArch)]; + DerivedArgList *&Entry = TCArgs[{TC, BoundArch, DeviceOffloadKind}]; if (!Entry) { - Entry = TC->TranslateArgs(*TranslatedArgs, BoundArch); + Entry = TC->TranslateArgs(*TranslatedArgs, BoundArch, DeviceOffloadKind); if (!Entry) Entry = TranslatedArgs; } |