This is an archive of the discontinued LLVM Phabricator instance.

[mlir][PDLL] Add support for c-style comment
Needs ReviewPublic

Authored by Chia-hungDuan on May 24 2022, 12:10 PM.

Details

Reviewers
jpienaar
rriddle
Summary

Given that pdll is another format of source file, we may need to add the
copyright disclaimer in c-style comment in some projects.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.May 24 2022, 12:10 PM
Chia-hungDuan requested review of this revision.May 24 2022, 12:10 PM

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I was thinking the same, you could just use // for each line of the copyright.

Chia-hungDuan added a comment.EditedMay 24 2022, 12:19 PM

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I think in Tensorflow we are using /* ... */, for example, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/transforms/graph_transform_wrapper.cc#L1-L14

Or do we have multiple styles there?

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I think in Tensorflow we are using /* ... */, for example, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/transforms/graph_transform_wrapper.cc#L1-L14

Or do we have multiple styles there?

I don't think TF is consistent, it uses // in various languages (even C++ at times): https://github.com/tensorflow/tensorflow/blob/e755ae9c7faa3715dff3a3247872a4499d5a53cd/tensorflow/lite/objc/sources/TFLCommonUtil.h#L1

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I think in Tensorflow we are using /* ... */, for example, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/transforms/graph_transform_wrapper.cc#L1-L14

Or do we have multiple styles there?

I don't think TF is consistent, it uses // in various languages (even C++ at times): https://github.com/tensorflow/tensorflow/blob/e755ae9c7faa3715dff3a3247872a4499d5a53cd/tensorflow/lite/objc/sources/TFLCommonUtil.h#L1

Oh I see. So do you prefer to only have one comment style? If so, I could use // style there. I was thinking if we support this, that may be easier for including the copyright disclaimer because in td file, they can use c-style comment. People won't be confused why they need to use the different style. No strong preference here.

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I think in Tensorflow we are using /* ... */, for example, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/transforms/graph_transform_wrapper.cc#L1-L14

Or do we have multiple styles there?

I don't think TF is consistent, it uses // in various languages (even C++ at times): https://github.com/tensorflow/tensorflow/blob/e755ae9c7faa3715dff3a3247872a4499d5a53cd/tensorflow/lite/objc/sources/TFLCommonUtil.h#L1

Oh I see. So do you prefer to only have one comment style? If so, I could use // style there. I was thinking if we support this, that may be easier for including the copyright disclaimer because in td file, they can use c-style comment. People won't be confused why they need to use the different style. No strong preference here.

I think it'd be nice if we can just avoid it, or at least I'd prefer if we find value in having them in general vs just for the copyright. In .td files I've seen we mostly just use them for parameter comment like things, but for PDLL I'd almost prefer we just use the IDE for those types of things (e.g. https://reviews.llvm.org/D126033)

Not sure I follow why c-style is requirement? E.g., copyright in Python files is close to // per line

I think in Tensorflow we are using /* ... */, for example, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/transforms/graph_transform_wrapper.cc#L1-L14

Or do we have multiple styles there?

I don't think TF is consistent, it uses // in various languages (even C++ at times): https://github.com/tensorflow/tensorflow/blob/e755ae9c7faa3715dff3a3247872a4499d5a53cd/tensorflow/lite/objc/sources/TFLCommonUtil.h#L1

Oh I see. So do you prefer to only have one comment style? If so, I could use // style there. I was thinking if we support this, that may be easier for including the copyright disclaimer because in td file, they can use c-style comment. People won't be confused why they need to use the different style. No strong preference here.

I think it'd be nice if we can just avoid it, or at least I'd prefer if we find value in having them in general vs just for the copyright. In .td files I've seen we mostly just use them for parameter comment like things, but for PDLL I'd almost prefer we just use the IDE for those types of things (e.g. https://reviews.llvm.org/D126033)

Got it! I'll use the // style first. Thanks!