[cfe-users] the case of the missing label in the switch/case

folkert via cfe-users cfe-users at lists.llvm.org
Wed Nov 9 00:53:28 PST 2016


I maybe very well not understanding something but it looks like a label
targetted by a goto, in a switch statement, gets missing: if I iterate
through the ast and emit all the stmt/expr/decls, then no label-type is

#include <stdio.h>
void myfunc(int a)
        switch(a) {
                case 1:
                        goto my_label;
                case 2:
                case 3:
my_label: // this label does not appear in the ast
                        printf("Hello, world!\n");

any ideas?

Folkert van Heusden

Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

More information about the cfe-users mailing list