diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-08-04 19:46:10 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-08-04 19:46:10 +0000 |
commit | be83fad57e31e109e0f2d639d362210a66c55182 (patch) | |
tree | 8829997b638ea0df7e01e6b533708fdb195a55da /clang/lib/CodeGen/CGOpenMPRuntime.h | |
parent | 638316da5b490ef7327d87b34976357ec8512d70 (diff) | |
download | bcm5719-llvm-be83fad57e31e109e0f2d639d362210a66c55182.tar.gz bcm5719-llvm-be83fad57e31e109e0f2d639d362210a66c55182.zip |
[OPENMP][DEBUG] Set proper address space info if required by target.
Arguments, passed to the outlined function, must have correct address
space info for proper Debug info support. Patch sets global address
space for arguments that are mapped and passed by reference.
Also, cuda-gdb does not handle reference types correctly, so reference
arguments are represented as pointers.
llvm-svn: 310104
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index 809d9fa0a92..c0682e2be99 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -1325,6 +1325,33 @@ public: virtual void emitDoacrossOrdered(CodeGenFunction &CGF, const OMPDependClause *C); + /// Translates argument of outlined function if this is required for target. + /// \param FD A field for the corresponding captured variable in the captured + /// record. + /// \param NativeParam Native parameter of the outlined function. + virtual const VarDecl *translateParameter(const FieldDecl *FD, + const VarDecl *NativeParam) const { + return NativeParam; + } + + typedef llvm::function_ref<void(CodeGenFunction &, const VarDecl *, Address)> + MappingFnType; + /// Maps the native argument to the address of the target-specific argument. + /// \param FD A field for the corresponding captured variable in the captured + /// record. + /// \param NativeParam Native parameter of the outlined function. + /// \param TargetParam Target-specific parameter of the outlined function + /// (provided by the \a CGOpenMPRuntime::translateParameter). + /// \param MapFn Mapping function that maps the address of the \p NativeParam + /// to the address of the \p TargetParam. + virtual void mapParameterAddress(CodeGenFunction &CGF, const FieldDecl *FD, + const VarDecl *NativeParam, + const VarDecl *TargetParam, + const MappingFnType MapFn) const { + assert(NativeParam == TargetParam && + "native and target args must be the same"); + } + /// Emits call of the outlined function with the provided arguments, /// translating these arguments to correct target-specific arguments. virtual void |