diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-06-29 16:43:05 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-06-29 16:43:05 +0000 |
commit | 1fdfdf7155032f6cc55c146405e9d7082258ae01 (patch) | |
tree | 18903388ba01cfe4da2ebe9ee4b2dbe8947d13b5 /llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp | |
parent | b49ca64b187781d6e1280411166916808bc18d95 (diff) | |
download | bcm5719-llvm-1fdfdf7155032f6cc55c146405e9d7082258ae01.tar.gz bcm5719-llvm-1fdfdf7155032f6cc55c146405e9d7082258ae01.zip |
[OPENMP][DEBUG] Generate second function with correct arg types.
Currently, if the some of the parameters are captured by value, this
argument is converted to uintptr_t type and thus we loosing the debug
info about real type of the argument (captured variable):
```
void @.outlined_function.(uintptr %par);
...
%a = alloca i32
%a.casted = alloca uintptr
%cast = bitcast uintptr* %a.casted to i32*
%a.val = load i32, i32 *%a
store i32 %a.val, i32 *%cast
%a.casted.val = load uintptr, uintptr* %a.casted
call void @.outlined_function.(uintptr %a.casted.val)
...
```
To resolve this problem, in debug mode a speciall external wrapper
function is generated, that calls the outlined function with the correct
parameters types:
```
void @.wrapper.(uintptr %par) {
%a = alloca i32
%cast = bitcast i32* %a to uintptr*
store uintptr %par, uintptr *%cast
%a.val = load i32, i32* %a
call void @.outlined_function.(i32 %a)
ret void
}
void @.outlined_function.(i32 %par);
...
%a = alloca i32
%a.casted = alloca uintptr
%cast = bitcast uintptr* %a.casted to i32*
%a.val = load i32, i32 *%a
store i32 %a.val, i32 *%cast
%a.casted.val = load uintptr, uintptr* %a.casted
call void @.wrapper.(uintptr %a.casted.val)
...
```
llvm-svn: 306697
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp')
0 files changed, 0 insertions, 0 deletions