https://bugs.llvm.org/show_bug.cgi?id=35004

            Bug ID: 35004
           Summary: [refactoring] idea: convert a switch statement to an
                    if
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libclang
          Assignee: unassignedclangb...@nondot.org
          Reporter: arpha...@gmail.com
                CC: kli...@google.com, llvm-bugs@lists.llvm.org

This is a possible idea for a new refactoring action for clang-refactor &
editors that support integration with Clang's refactoring engine.

This idea suggests adding a refactoring that can convert a switch statement
into an if statement. For example, this statement:

  switch (x) {
  case 0:
    foo();
    break;
  case 1:
    bar();
    break;
  }

Can become:

    if (x == 1) {
        foo();
    } else if (x == 2) {
        bar();
    }

(Note: I'm intending to add an operation that implements the reverse, i.e.
convert if to switch).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to