search for: const_iterators

Displaying 20 results from an estimated 165 matches for "const_iterators".

Did you mean: const_iterator
2009 Nov 04
2
[LLVMdev] DenseMap iterator constness fix
...ttee's bad taste. > >> > >> + DenseMapIterator(const DenseMapIterator<KeyT, ValueT, > >> + KeyInfoT, ValueInfoT, false>& > >> I) > >> > >> This looks like it will make it impossible to copy const_iterators. I > >> guess it doesn't because the copy-constructor is auto-generated, but > >> please comment that and add tests for it and for the non-const->const > >> conversion to unittests/ADT/DenseMapTest.cpp. > >> > >> Otherwise, the patches just change...
2009 Nov 04
2
[LLVMdev] DenseMap iterator constness fix
...u > should use the same name, despite the standard committee's bad taste. > > + DenseMapIterator(const DenseMapIterator<KeyT, ValueT, > + KeyInfoT, ValueInfoT, false>& I) > > This looks like it will make it impossible to copy const_iterators. I > guess it doesn't because the copy-constructor is auto-generated, but > please comment that and add tests for it and for the non-const->const > conversion to unittests/ADT/DenseMapTest.cpp. > > Otherwise, the patches just change iterator to const_iterator, which looks >...
2017 May 02
2
When to use auto instead of iterator/const_iterator?
Hi All, While reading LLVM source code, sometimes I am wondering when should we use auto instead of iterator/const_iterator. I want to use the patch [1] I sent before as an example. Could someone give me advice/guideline here? Also, I have another question. Sometimes the for-loop uses const_iterator, say for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
2009 Nov 04
0
[LLVMdev] DenseMap iterator constness fix
...me, despite the standard committee's bad taste. >> >> +  DenseMapIterator(const DenseMapIterator<KeyT, ValueT, >> +                                          KeyInfoT, ValueInfoT, false>& >> I) >> >> This looks like it will make it impossible to copy const_iterators. I >> guess it doesn't because the copy-constructor is auto-generated, but >> please comment that and add tests for it and for the non-const->const >> conversion to unittests/ADT/DenseMapTest.cpp. >> >> Otherwise, the patches just change iterator to const_iterat...
2014 Mar 04
3
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mon, Mar 3, 2014 at 12:26 AM, 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 12:32, Pete Cooper <peter_cooper at apple.com> wrote: > >> Would those work with a foreach construct? Perhaps I forgot to mention > that was what I'm trying to work out
2009 Nov 09
0
[LLVMdev] DenseMap iterator constness fix
...t;> >> >> + DenseMapIterator(const DenseMapIterator<KeyT, ValueT, >> >> + KeyInfoT, ValueInfoT, >> false>& >> >> I) >> >> >> >> This looks like it will make it impossible to copy const_iterators. I >> >> guess it doesn't because the copy-constructor is auto-generated, but >> >> please comment that and add tests for it and for the non-const->const >> >> conversion to unittests/ADT/DenseMapTest.cpp. >> >> >> >> Otherwise, the...
2015 Feb 08
2
[LLVMdev] Fwd: Improper Function::iterator increment
void Wave::init (const Function &F){ Function::const_iterator ie = F.end(); outs() << ie << "\n\n"; for (Function::const_iterator I = F.begin(), IE = F.end(); I != IE; I++, K++){ outs() << I << "\n"; // some manipulation with I } } I used the above shown function in my pass in LLVM 3.4.2 and it used to work fine but
2012 Dec 17
4
[LLVMdev] BasicBlock back()
Hello, I am a beginner of LLVM. I am trying to move among the instructions of a BasicBlock and I cannot. In this particular example, I try to get the previous instruction of the end instruction. I am trying 2 methods: 1. I have the following sequence of code: bool patternDC::runOnBasicBlock(BasicBlock &BB) { ... if (BB.getTerminator()) { Instruction* current =
2009 Nov 03
2
[LLVMdev] DenseMap iterator constness fix
Dear all, The first of the proposed patches (DenseMapIterator.patch) forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which
2009 Nov 03
0
[LLVMdev] DenseMap iterator constness fix
...ction 20.6.7), so I think you should use the same name, despite the standard committee's bad taste. + DenseMapIterator(const DenseMapIterator<KeyT, ValueT, + KeyInfoT, ValueInfoT, false>& I) This looks like it will make it impossible to copy const_iterators. I guess it doesn't because the copy-constructor is auto-generated, but please comment that and add tests for it and for the non-const->const conversion to unittests/ADT/DenseMapTest.cpp. Otherwise, the patches just change iterator to const_iterator, which looks fine. On Tue, Nov 3, 2009 a...
2015 Feb 08
2
[LLVMdev] Fwd: Improper Function::iterator increment
So, you mean to say that the above implementation is correct and should work fine. I initially thought that the above way is not the correct way anymore since 3.5.0 might have changed few things. Anyways here is my dirty code I have written for my research project that I took the above snippet from : https://github.com/pranavk/spatial-computing/blob/master/waves.cpp#L105 On Sun, Feb 8, 2015
2008 May 27
2
[LLVMdev] Iterator issue in BranchFolder::RemoveBlocksWithHash?
On May 27, 2008, at 2:01 PM, Dale Johannesen wrote: > On May 27, 2008, at 1:40 PM, Mike Stump wrote: >> >> From n2461: >> >>> 8 The insert members shall not affect the validity of iterators and >>> references to the container, and the erase members shall invalidate >>> only iterators and references to the erased elements. >> >> Pretty
2011 Mar 30
1
[LLVMdev] Trouble traversing the CallGraph
I am finding some weird behavior in the CallGraph, and am not sure what am I doing wrong. When trying to traverse nodes in the CallGraph I get stuck in nodes representing external functions. Take the following code: ----- #include <stdio.h> int main() { printf( "Hello World!\n" ); } ----- If I try to traverse the CallGraph using the following code: ----- CallGraph CG
2012 Dec 17
0
[LLVMdev] BasicBlock back()
On 12/17/12 10:34 AM, Alexandru Ionut Diaconescu wrote: > Hello, > > I am a beginner of LLVM. I am trying to move among the instructions of > a BasicBlock and I cannot. In this particular example, I try to get > the previous instruction of the end instruction. I am trying 2 methods: > > > > 1. I have the following sequence of code: > > bool
2015 Feb 08
2
[LLVMdev] Fwd: Improper Function::iterator increment
Input to this pass is the bitcode format of simple code below : int sum_single_loop (int a){ int su = 0, i; for (i=0;i<a;i++) su = su + i; return su; } On Mon, Feb 9, 2015 at 2:32 AM, David Blaikie <dblaikie at gmail.com> wrote: > > > On Sun, Feb 8, 2015 at 11:23 AM, Pranav Kant <pranav913 at gmail.com> wrote: > >> So, you mean to say that the
2010 Jan 09
2
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
Hello, The CodeExtractor contains a std::set<BasicBlock*> to keep track of the blocks to extract. Iterators on this set are not deterministic, and so the functions that are generated are not (the order of the inputs/outputs can change). The attached patch uses a SetVector instead. Ok to apply ? Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F
2010 Sep 15
2
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
Hi, I wrote tiny ModulePass which iterates over functions and then uses getAnalysis<LoopInfo> in order to get informations about the loop. It compiles smoothly, but whenever I try to run it I got error like this: opt: .. PassAnalysisSupport.h:203: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with AnalysisType = llvm::LoopInfo]: Assertion `ResultPass &&
2012 Dec 18
1
[LLVMdev] BasicBlock back()
PS: I works when I use Instruction* prev = current->getPrevNode(); But then I have runtime error Stack dump that is very frequent... On Mon, Dec 17, 2012 at 6:20 PM, John Criswell <criswell at illinois.edu>wrote: > On 12/17/12 10:34 AM, Alexandru Ionut Diaconescu wrote: > > Hello, > > I am a beginner of LLVM. I am trying to move among the instructions of a >
2002 Nov 18
0
[LLVMdev] Fixed DSGraph iteration, depth first search, etc...
The following now works for me: const DSNode *N1 = ...; df_iterator<const DSNode*> X1 = df_begin(N1), XE1 = df_end(N1); DSNode *N2 = ...; df_iterator<DSNode*> X2 = df_begin(N2), XE2 = df_end(N2); You need the following #includes: #include "Support/DepthFirstIterator.h" #include "llvm/Analysis/DSGraphTraits.h" You need this patch:
2008 Feb 11
0
[LLVMdev] Some questions about live intervals
Thanks. One question though. Should getMBBFromIndex() assert if given an index out of the range or simply returns a NULL pointer? I would think the later makes it a bit more friendly. Evan On Feb 8, 2008, at 8:59 AM, Roman Levenstein wrote: > Hi Evan, > > Here is a patch for the LiveIntervalAnalysis that we discussed. > > --- Evan Cheng <evan.cheng at apple.com>