Sometimes I find that the tag identifier in llvm IR is started with a semicolon ';', for example ; <label> 6 ; <label> 6 however, as I know, a comma is used for comments. So, how can llvm get label information in the comments? Am I missing something?
A simple test. C source file:
llvm IR code generated by http://llvm.org/demo/index.cgi (same as clang -c -emit-llvm main.c):
; ModuleID = '/tmp/webcompile/_13654_0.bc' @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 define i32 @main() nounwind uwtable { %a = alloca i32, align 4 %1 = call i32 (i8*, ...)* @__isoc99_scanf(i8* getelementptr inbounds ([3 x i8]* @.str, i64 0, i64 0), i32* %a) nounwind %2 = load i32* %a, align 4, !tbaa !0 %3 = icmp sgt i32 %2, 3 br i1 %3, label %4, label %6 ; <label>:4 ; preds = %0 %5 = shl nsw i32 %2, 1 store i32 %5, i32* %a, align 4, !tbaa !0 br label %6 ; <label>:6 ; preds = %4, %0 ret i32 0 }
source share