[PATCH] This patch introduces MemorySSA, a virtual SSA form for memory.Details on what it looks like are in MemorySSA.h

Sanjoy Das sanjoy at playingwithpointers.com
Fri Feb 27 16:43:25 PST 2015


I think you need "for (auto &BB : F) { .. }".

On Fri, Feb 27, 2015 at 4:00 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
>>
>> ================
>> Comment at: lib/Transforms/Utils/MemorySSA.cpp:357
>> @@ +356,3 @@
>> +  unsigned ID = 0;
>> +  for (auto I = F.begin(), E = F.end(); I != E; ++I)
>> +    BBNumbers[I] = ID++;
>> ----------------
>> Range-based for?
>
>
> BTW, at least the obvious construction of that  for( auto I : F) gives:
> ../lib/Transforms/Utils/MemorySSA.cpp:350:13: error: call to deleted
> constructor of 'llvm::BasicBlock'
>   for (auto I : F)
>             ^ ~
>
> ../include/llvm/IR/BasicBlock.h:85:3: note: 'BasicBlock' has been explicitly
> marked deleted here
>   BasicBlock(const BasicBlock &) = delete;
>   ^
>
> Is there some way to iterate over basic block instructions using range based
> for that we've added?



More information about the llvm-commits mailing list