[llvm-dev] How the LLVM handle the debug location information of continue keyword and right brace(loop end location)?

Frozen via llvm-dev llvm-dev at lists.llvm.org
Sat Jun 3 06:46:03 PDT 2017



Hi Marcin:
    I don't expect stop the right brace } and expect stop at continue keyword statement. My question is continue keyword statement is the same as right brace } statement in the LLVM IR except the !dbg!23 has different line number. I don't know how the LLVM backend distinguish it. 



在 2017-06-03 19:20:46,"Marcin Słowik" <me at marandil.pl> 写道:

On Jun 3, 2017 9:48 AM, "Frozen via llvm-dev" <llvm-dev at lists.llvm.org> wrote:

Why continue keyword can be emitted but right brace won't be emitted, and debbuger can stop at continue keyword statement but won't stop at right brace statement?


Simply because continue keyword is a part of the AST, while '}' is not. 


And you don't break on "natural" terminators. Also, would you expect a different behavior between:


for(i=0;i<N;++i)
    doStuff();


And:


for(i=0;i<N;++i) {
    doStuff();
} 


While they should be identical on AST level? 


Cheers, 
Marcin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170603/29db5327/attachment.html>


More information about the llvm-dev mailing list