Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globals now formatted surprsingly #16532

Closed
tobiasgrosser opened this issue May 27, 2013 · 3 comments
Closed

Globals now formatted surprsingly #16532

tobiasgrosser opened this issue May 27, 2013 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@tobiasgrosser
Copy link
Contributor

Bugzilla Link 16157
Resolution FIXED
Resolved on Jun 28, 2013 12:29
Version unspecified
OS Linux
CC @rnk

Extended Description

Hi,

clang-format now formats the following code differently:

This:

static cl::opt
ValueDependences("polly-value-dependences",
cl::desc("Use value instead of memory based dependences"),
cl::Hidden, cl::init(true), cl::cat(PollyCategory));

became:

static cl::opt
ValueDependences("polly-value-dependences",
cl::desc("Use value instead of memory based dependences"),
cl::Hidden, cl::init(true), cl::cat(PollyCategory));

I can see the reasoning behind this, but a quick grep 'grep -R cl::opt -A 2 lib/'
does not show a single use of this in LLVM whereas the first one is very common.
I believe this change should be disabled in the LLVM style

@rnk
Copy link
Collaborator

rnk commented Jun 14, 2013

From my current change, clang-format is doing this too:

  • virtual void AddLinkRuntimeLibArgs(const ArgList &Args,
  •                                 ArgStringList &CmdArgs) const = 0;
    
  • virtual void
  •  AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
    
  •                        llvm::opt::ArgStringList &CmdArgs) const = 0;
    

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 27, 2013

I just hit this bug. We try to format:

static llvm::error_code
createUniqueEntity(const llvm::Twine &Model, int &ResultFD,
llvm::SmallVectorImpl &ResultPath,
bool MakeAbsolute, unsigned Mode, FSEntity Type);

as

static llvm::error_code
createUniqueEntity(const llvm::Twine &Model, int &ResultFD,
llvm::SmallVectorImpl &ResultPath,
bool MakeAbsolute, unsigned Mode, FSEntity Type);

@tobiasgrosser
Copy link
Contributor Author

In fact, this bug was fixed by Manuel a week ago:

commit 65972bc4e59c64ade6a5f2efffc0764144e809f5
Author: Manuel Klimek klimek@google.com
Date: Fri Jun 21 17:25:42 2013 +0000

Add an option to not indent declarations when breaking after the type.

Make that option the default for LLVM style.

I get the right behavior with the latest version of clang. Rafael, if this does not work for you after updating clang, please reopen the bug.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

3 participants