search for: make_range

Displaying 14 results from an estimated 14 matches for "make_range".

2010 Jan 26
2
[LLVMdev] Returning a structure
...ditions in a single cpp file) to write a compiler. In one part of my code, I want to build a function that returns a structure. The LLVM Assembly Language Reference Manual gives this as a possible return value: > ret { i32, i8 } { i32 4, i8 2 } Meanwhile, compiling this C function: > Range make_range(Index location, Index length) { > return (Range){ location, length }; > } reveals clang’s IR output to be quite a bit more complex: > %struct._Range = type <{ i64, i64 }> > > define void @make_range(%struct._Range* noalias sret %agg.result, i64 %location, i64 %length) noun...
2014 Mar 05
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On 2014 Mar 2, at 22:27, Chandler Carruth <chandlerc at google.com> wrote: > > On Sun, Mar 2, 2014 at 10:13 PM, Saleem Abdulrasool <compnerd at compnerd.org> wrote: > On Sun, Mar 2, 2014 at 9:26 PM, Chris Lattner <sabre at nondot.org> wrote: > > On Mar 2, 2014, at 8:53 PM, Renato Golin <renato.golin at linaro.org> wrote: > > > On 3 March 2014
2018 Apr 09
0
InstIterator
Within a basic block this is just normal iterator usage/manipulation: for (instr : llvm::make_range(FromInstruction.getIterator(), ToInstruction.getIterator())) { ... } Use std::next() on ToInstruction.getIterator() if you want it included. - Matthias > On Apr 9, 2018, at 10:04 AM, Alexandre Isoard via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hello, > > Is there...
2018 Apr 09
2
InstIterator
Hello, Is there an iterator to iterate over a "range" of instructions in a Function? "range" meaning from an instruction::iterator up to an other instruction::iterator which either: - point to instructions in the same basic block (the first one first, second one second) - point to instructions in different basic block (the BB of the first dominate the BB of the second, and
2017 Jul 17
3
A bug related with undef value when bootstrap MemorySSA.cpp
...some time for now? Now we use an empty generic_def_path_iterator with Optional<ListIndex> N being initialized by None as the end of range. Can we initialize the Optional var with a special value instead of None? iterator_range<def_path_iterator> def_path(ListIndex From) { return make_range(def_path_iterator(this, From), def_path_iterator()); } On Mon, Jul 17, 2017 at 1:37 PM, Daniel Berlin <dberlin at dberlin.org> wrote: > I think everyone agrees pretty much everything short of "Fix undef" will not > fix the problem for good. > I think we are more trying...
2010 Jan 27
0
[LLVMdev] Returning a structure
...) to write a compiler. In one part of my code, I want to build a function that returns a structure. The LLVM Assembly Language Reference Manual gives this as a possible return value: > >> ret { i32, i8 } { i32 4, i8 2 } > > Meanwhile, compiling this C function: > >> Range make_range(Index location, Index length) { >> return (Range){ location, length }; >> } > > reveals clang’s IR output to be quite a bit more complex: > >> %struct._Range = type <{ i64, i64 }> >> >> define void @make_range(%struct._Range* noalias sret %agg.result...
2016 Oct 31
0
RFC: General purpose type-safe formatting library
...); // "true" outs() << "{0}"_fmt.stream((void*)nullptr); // "0x00000000" 3) Customizable formatting of ranges with optionally customizable separator std::vector<int> X = {1, 2, 3, 4} outs() << "{0}"_fmt.stream(make_range(X.begin(), X.end())); "1, 2, 3, 4" outs() << "{0:@[ - ]}"_fmt.stream(make_range(X.begin(), X.end())); "1 - 2 - 3 - 4"; 4) Left, center, and right-alignment: outs() << "{0:-3}"_fmt.stream(0); "3 " outs() <<...
2016 Oct 14
2
RFC: General purpose type-safe formatting library
On 12.10.2016 05:59, Mehdi Amini via llvm-dev wrote: >> If you change a const char * to a StringRef, it can silently succeed >> while passing your StringRef object to printf. It should fail to compile! > > llvm::format now fails to compile as well :) > > However this does not address other issues, like: `format(“%d”, float_var)` This may be a good time to point at
2014 Mar 05
3
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
...void reverse(Range &R) { reverse(std::begin(R), std::end(R)); } On the other hand, “reversed” sounds like an accessor, and I’d expect it to look something like this: template <class Range> reversed_range<Range::iterator> reversed(Range &R) { return make_range(make_reverse_iterator(std::end(R)), make_reverse_iterator(std::begin(R))); } template <class Range> reversed_range<Range::const_iterator> reversed(const Range &R) { return make_range(make_reverse_iterator(std::end(R)),...
2017 Jul 17
3
A bug related with undef value when bootstrap MemorySSA.cpp
...ric_def_path_iterator with Optional<ListIndex> N >> being initialized by None as the end of range. Can we initialize the >> Optional var with a special value instead of None? >> >> iterator_range<def_path_iterator> def_path(ListIndex From) { >> return make_range(def_path_iterator(this, From), def_path_iterator()); >> } >> > > Why does this work? Fwiw, I don't think this is a good idea. If it can happen in MemorySSA it can happen in other organic C++ source code too - think about what you're going to tell other folks who run in...
2017 Jul 18
2
A bug related with undef value when bootstrap MemorySSA.cpp
...ized by None as the end of range. Can we > initialize the > >>>> Optional var with a special value instead of None? > >>>> > >>>> iterator_range<def_path_iterator> def_path(ListIndex From) { > >>>> return make_range(def_path_iterator(this, From), > def_path_iterator()); > >>>> } > >>>> > >>> > >>> Why does this work? > >> > >> Fwiw, I don't think this is a good idea. If it can happen in > >&g...
2017 Jul 18
4
A bug related with undef value when bootstrap MemorySSA.cpp
...istIndex> N >>>> being initialized by None as the end of range. Can we initialize the >>>> Optional var with a special value instead of None? >>>> >>>> iterator_range<def_path_iterator> def_path(ListIndex From) { >>>> return make_range(def_path_iterator(this, From), def_path_iterator()); >>>> } >>>> >>> >>> Why does this work? >> >> Fwiw, I don't think this is a good idea. If it can happen in >> MemorySSA it can happen in other organic C++ source code too - think...
2017 Jan 30
3
Choosing the appropriate iterator for the job
At the moment I am in the process of getting our out-of-tree compiler up to date with respect to the v4.0 branch, and thankfully all is going well. However, one of the most common changes I have had to make has to do with iterations over machine instructions and basic blocks. These are changes I have had to make incrementally each time we catch up with a release of LLVM, and basically the
2017 Jul 17
2
A bug related with undef value when bootstrap MemorySSA.cpp
Hello, some of the patches had conflicts with LLVM head, so I updated them. If you experienced patch failure before then you can try it again. I compiled your code (1.c) with LLVM r308173 with the 5 patches applied, and it generated assembly like this. Now it contains store to c(%rip). It tries to store a(%rip) + b(%rip) to c(%rip). I wish this translation is now correct. ``` 73 .globl hoo