Hi, The 'br' instruction has the syntax: br i1 <cond>, label <iftrue>, label <iffalse> br label <dest> ; Unconditional branch If we know <cond>'s type must be 'i1', <iftrue><iffalse><dest> have to be of type 'label', why does the syntax have to specify them? lib/AsmParser/LLParser.cpp also checks these restrictions when reading a *.ll. I have the same questions for the 'label type' of 'switch' and 'indirectbr'. Thanks. -- Jianzhou
On 7 March 2010 05:18, Jianzhou Zhao <jianzhou at seas.upenn.edu> wrote:> If we know <cond>'s type must be 'i1', <iftrue><iffalse><dest> have to > be of type 'label',I'm not the expert, but I guess it's because EVERY type in LLVM is specified, even when redundant. Probably to avoid the possible case when it looks redundant but it's not, and we're too late to fix, since everyone is using the "feature" for their own purposes. Safety is always redundant, until it really matters... cheers, --renato http://systemcall.org/ Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm
Maybe Matching Threads
- [LLVMdev] Splitting a basic block, replacing it's terminator
- [LLVMdev] Splitting a basic block, replacing it's terminator
- [LLVMdev] all LLVM Instructions that may write to memory -- other than StoreInst?
- with(data.frame,ifelse(___,___,___))
- [LLVMdev] Reviving the new LLVM concurrency model