llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

[refactoring] idea: convert a ternary operator into an if statement and vice-versa #34348

Open hyp opened 6 years ago

hyp commented 6 years ago
Bugzilla Link 35000
Version trunk
OS All
CC @TH3CHARLie

Extended Description

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 ternary operator into an if statement and vice-versa. For example, this statement:

  int x = expression ? a : b;

Can become:

    int x;
    if (expression) {
        x = a;
    } else {
        x = b;
    }

and vice-versa.

TH3CHARLie commented 3 years ago

Hi Alex, is this already taken by anyone or solved? If not, I'd like to give a try!

elhewaty commented 1 year ago

Hello, I am a beginner who is interested in contributing to LLVM. Can anyone guide me through this?

llvmbot commented 1 year ago

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

1) Assign the issue to you. 2) Fix the issue locally. 3) Run the test suite locally. 3.1) Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests. 4) Create a git commit 5) Run git clang-format HEAD~1 to format your changes. 6) Submit the patch to Phabricator. 6.1) Detailed instructions can be found here

For more instructions on how to submit a patch to LLVM, see our documentation.

If you have any further questions about this issue, don't hesitate to ask via a comment on this Github issue.

@llvm/issue-subscribers-good-first-issue

rachejazz commented 6 months ago

So I see many opted for working on this before, but as I read on other issues, as long as I send a patch I can get a review?

EugeneZelenko commented 6 months ago

@rachejazz: Sure, patch is best way to proceed!

elhewaty commented 6 months ago

@rachejazz, Yes, and feel free to work on it, my comment was a long time ago. The sign of work is the assignee tag and the pull requests.