This is an archive of the discontinued LLVM Phabricator instance.

[clang] NFC: return void in an alternative expression after call to void function.
AbandonedPublic

Authored by zhouyizhou on Oct 18 2021, 7:29 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

It is better to return void in an alternative expression after call to void function. Also, I processed emitDestroy's function body using clang-format.

I don't have write access to LLVM repository, if the patch got approved, can someone commit for me ?

Thanks
Zhouyi

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>

Diff Detail

Event Timeline

zhouyizhou requested review of this revision.Oct 18 2021, 7:29 PM
zhouyizhou created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2021, 7:29 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I create this patch because I am also a Linux hobbyist, in Linux kernel, return statement in a void function is always standalone. For example in kernel/event/core.c:

static void
perf_event_exit_event(struct perf_event *child_event,

struct perf_event_context *child_ctx,
struct task_struct *child)

{

...
if (!parent_event) {
        perf_event_wakeup(child_event);
        return;
}
...

}

In above code, return statement is standalone. It was rarely seen statement like "return perf_event_wakeup(child_event);" in Linux kernel.

Thanks
Zhouyi

ping
Just a ping, to see if there are any comments :-P

zhouyizhou abandoned this revision.Dec 5 2021, 4:46 PM