Issue |
83245
|
Summary |
`PHINode::incoming_values()` does not return a good C++ range...
|
Labels |
|
Assignees |
|
Reporter |
natanelh-mobileye
|
```
auto incoming = map_range(PHI->incoming_values(), [](Use *X) {return X;});
```
gives the following error, under gcc 7.5 :
```
In file included from {...snip...}
llvm-project/llvm/include/llvm/ADT/STLExtras.h: In instantiation of ‘auto llvm::map_range(ContainerTy&&, FuncTy) [with ContainerTy = llvm::iterator_range<llvm::Use*>; FuncTy = isInnermostAccPhi(llvm::Value*)::<lambda(llvm::Use*)>]’:
llvm-project/llvm/tools/my_pass.cpp:282:77: required from here
llvm-project/llvm/include/llvm/ADT/STLExtras.h:378:33: error: no matching function for call to ‘map_iterator(llvm::Use*, isInnermostAccPhi(llvm::Value*)::<lambda(llvm::Use*)>&)’
return make_range(map_iterator(std::begin(C), F),
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
```
Expected behavior:
1. I get range from `->incoming_values()`
2. I use it like normal with whatever function takes an llvm range
Actual behavior:
1. I get a "wannabe range that doesnt work properly"
2. can't use it in any way as a range...
The [docs](https://llvm.org/doxygen/classllvm_1_1PHINode.html#a1f0ff79b64a40d383b891f1baba89c6b) say that it should return a range...
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs