diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-08-08 14:25:14 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-08-08 14:25:14 +0000 |
commit | 59b81e51d330420a73f93b46b264b8c7f07b178a (patch) | |
tree | a86f9561b9182a224431b37abe0667dc5dc8b467 /clang/lib/CodeGen/CGOpenMPRuntime.h | |
parent | ce25d41b67f02b60d6d46b8334788d2d2c3a4d41 (diff) | |
download | bcm5719-llvm-59b81e51d330420a73f93b46b264b8c7f07b178a.tar.gz bcm5719-llvm-59b81e51d330420a73f93b46b264b8c7f07b178a.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: 310360
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index 809d9fa0a92..4f75e250cb9 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -1325,6 +1325,32 @@ public: virtual void emitDoacrossOrdered(CodeGenFunction &CGF, const OMPDependClause *C); + /// Translates the native parameter of outlined function if this is required + /// for target. + /// \param FD Field decl from captured record for the paramater. + /// \param NativeParam Parameter itself. + 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 corresponding + /// target-specific argument. + /// \param FD Field decl from captured record for the paramater. + /// \param NativeParam Parameter itself. + /// \param TargetParam Corresponding target-specific parameter. + /// \param MapFn Function that maps the native parameter to the address of the + /// target-specific. + virtual void mapParameterAddress(CodeGenFunction &CGF, const FieldDecl *FD, + const VarDecl *NativeParam, + const VarDecl *TargetParam, + const MappingFnType) 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 |