History log of /llvm-project/clang/lib/Format/Format.cpp (Results 101 – 125 of 1154)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 38ecb976 24-Apr-2023 Manna, Soumi <soumi.manna@intel.com>

[NFC][clang] Fix Coverity bugs with AUTO_CAUSES_COPY

Reported by Coverity:
AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

1. Inside "ExtractAPIVisitor.h" file, in clang::extract

[NFC][clang] Fix Coverity bugs with AUTO_CAUSES_COPY

Reported by Coverity:
AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

1. Inside "ExtractAPIVisitor.h" file, in clang::extractapi::impl::ExtractAPIVisitorBase<<unnamed>::BatchExtractAPIVisitor>::VisitFunctionDecl(clang::FunctionDecl const *): Using the auto keyword without an & causes the copy of an object of type DynTypedNode.

2. Inside "NeonEmitter.cpp" file, in <unnamed>::Intrinsic::Intrinsic(llvm::Record *, llvm::StringRef, llvm::StringRef, <unnamed>::TypeSpec, <unnamed>::TypeSpec, <unnamed>::ClassKind, llvm::ListInit *, <unnamed>::NeonEmitter &, llvm::StringRef, llvm::StringRef, bool, bool): Using the auto keyword without an & causes the copy of an object of type Type.

3. Inside "MicrosoftCXXABI.cpp" file, in <unnamed>::MSRTTIBuilder::getClassHierarchyDescriptor(): Using the auto keyword without an & causes the copy of an object of type MSRTTIClass.

4. Inside "CGGPUBuiltin.cpp" file, in clang::CodeGen::CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(clang::CallExpr const *): Using the auto keyword without an & causes the copy of an object of type CallArg.

5. Inside "SemaDeclAttr.cpp" file, in threadSafetyCheckIsSmartPointer(clang::Sema &, clang::RecordType const *): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

6. Inside "ComputeDependence.cpp" file, in clang::computeDependence(clang::DesignatedInitExpr *): Using the auto keyword without an & causes the copy of an object of type Designator.

7. Inside "Format.cpp" file, In clang::format::affectsRange(llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int): Using the auto keyword without an & causes the copy of an object of type Range.

Reviewed By: tahonermann

Differential Revision: https://reviews.llvm.org/D149074

show more ...


# 51f6a166 20-Apr-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Hanlde leading whitespaces for JSON files

Fixes #62228.
Fixes #62229.

Differential Revision: https://reviews.llvm.org/D148777


Revision tags: llvmorg-16.0.2
# 2bcfff67 16-Apr-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix regression with AlignTrailingComments set to true

Fixes #62161.

Differential Revision: https://reviews.llvm.org/D148447


Revision tags: llvmorg-16.0.1
# 00ea6798 04-Apr-2023 Ben Hamilton <benhamilton@google.com>

[Format/ObjC] Support NS_ERROR_ENUM in ObjC language guesser

Apple added a new NS_ERROR_ENUM macro to help define enums for
NSError codes.

This updates libformat's Objective-C language-guessing heu

[Format/ObjC] Support NS_ERROR_ENUM in ObjC language guesser

Apple added a new NS_ERROR_ENUM macro to help define enums for
NSError codes.

This updates libformat's Objective-C language-guessing heuristic
to detect the new macro as well as related NSError types.

Tested: New tests added.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D147577

show more ...


# 74cc4389 04-Apr-2023 sstwcw <f0gukp2nk@protonmail.com>

[clang-format] Add option for having one port per line in Verilog

We added the option `VerilogBreakBetweenInstancePorts` to put ports on
separate lines in module instantiations. We made it default

[clang-format] Add option for having one port per line in Verilog

We added the option `VerilogBreakBetweenInstancePorts` to put ports on
separate lines in module instantiations. We made it default to true
because style guides mostly recommend it that way for example:

https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md#module-instantiation

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D147327

show more ...


# feb585e7 01-Apr-2023 sstwcw <f0gukp2nk@protonmail.com>

[clang-format] Handle Verilog struct literals

Previously `isVerilogIdentifier` was mistaking the apostrophe used in
struct literals as an identifier. It is fixed.

Reviewed By: HazardyKnusperkeks,

[clang-format] Handle Verilog struct literals

Previously `isVerilogIdentifier` was mistaking the apostrophe used in
struct literals as an identifier. It is fixed.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D147329

show more ...


# 253985d5 29-Mar-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Add MinDigits suboptions to IntegerLiteralSeparator

Closes #61209.

Differential Revision: https://reviews.llvm.org/D147111


# af98f3b1 29-Mar-2023 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] JSON Add ability to add a space before the colon

I've seen a couple of request for extra Json formatting to match prettier capability.

Reviewed By: owenpan

Differential Revision: ht

[clang-format] JSON Add ability to add a space before the colon

I've seen a couple of request for extra Json formatting to match prettier capability.

Reviewed By: owenpan

Differential Revision: https://reviews.llvm.org/D147003

show more ...


Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2
# 01402831 01-Feb-2023 Manuel Klimek <klimek@google.com>

[clang-format] Add simple macro replacements in formatting.

Add configuration to specify macros.
Macros will be expanded, and the code will be parsed and annotated
in the expanded state. In a second

[clang-format] Add simple macro replacements in formatting.

Add configuration to specify macros.
Macros will be expanded, and the code will be parsed and annotated
in the expanded state. In a second step, the formatting decisions
in the annotated expanded code will be reconstructed onto the
original unexpanded macro call.

Eventually, this will allow to remove special-case code for
various macro options we accumulated over the years in favor of
one principled mechanism.

Differential Revision: https://reviews.llvm.org/D144170

show more ...


# 0ef289e5 20-Feb-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Clean up nullptr comparison style

For example, use 'Next' instead of 'Next != nullptr',
and '!Next' instead of 'Next == nullptr'.

Differential Revision: https://reviews.llvm.org

[clang-format][NFC] Clean up nullptr comparison style

For example, use 'Next' instead of 'Next != nullptr',
and '!Next' instead of 'Next == nullptr'.

Differential Revision: https://reviews.llvm.org/D144355

show more ...


# c24cdd58 06-Feb-2023 Backl1ght <backlight.zzk@gmail.com>

[clang-format] PackConstructorInitializers support PCIS_OnlyNextLine

fixes https://github.com/llvm/llvm-project/issues/60241

Differential Revision: https://reviews.llvm.org/D143091


# 25e2d0f3 28-Jan-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Support clang-format on/off line comments as prefix

Closes #60264.

Differential Revision: https://reviews.llvm.org/D142804


Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init
# 58751f94 20-Jan-2023 Backl1ght <backlight.zzk@gmail.com>

[clang-format] SortUsingDeclarations support lexicographic order

fix https://github.com/llvm/llvm-project/issues/59930

Differential Revision: https://reviews.llvm.org/D141694


# 6ad0788c 14-Jan-2023 Kazu Hirata <kazu@google.com>

[clang] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is p

[clang] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# e3eca335 13-Jan-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

Below is the mapping:
LineEnding DeriveLineEnding UseCRLF
LF false false
CRLF false true

[clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

Below is the mapping:
LineEnding DeriveLineEnding UseCRLF
LF false false
CRLF false true
DeriveLF true false
DeriveCRLF true true

Differential Revision: https://reviews.llvm.org/D141654

show more ...


Revision tags: llvmorg-15.0.7
# 2e2aa8bb 12-Jan-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in DerivePointerAlignment fallback

Fixes #59953.

Differential Revision: https://reviews.llvm.org/D141563


# 922c8891 11-Jan-2023 Krasimir Georgiev <krasimir@google.com>

Revert "Revert "[clang-format] Add an option for breaking after C++11 attributes""

This reverts commit 879bfe6a979295f834b76df66b19a203b93eed0f.

owenpan@ pointed out on https://reviews.llvm.org/D14

Revert "Revert "[clang-format] Add an option for breaking after C++11 attributes""

This reverts commit 879bfe6a979295f834b76df66b19a203b93eed0f.

owenpan@ pointed out on https://reviews.llvm.org/D140956 that this
actually makes the formatting more consistent, so it's not a regression.

show more ...


# 879bfe6a 10-Jan-2023 Krasimir Georgiev <krasimir@google.com>

Revert "[clang-format] Add an option for breaking after C++11 attributes"

This reverts commit a28f0747c2f3728bd8a6f64f7c8ba80b4e0cda9f.

It appears that this regresses some function definitions, add

Revert "[clang-format] Add an option for breaking after C++11 attributes"

This reverts commit a28f0747c2f3728bd8a6f64f7c8ba80b4e0cda9f.

It appears that this regresses some function definitions, added an
example as a comment over at https://reviews.llvm.org/D140956.

show more ...


# 2c6ecc9d 05-Jan-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Add an option to insert a newline at EOF if missing

Closes #38042.

Differential Revision: https://reviews.llvm.org/D141035


# a28f0747 04-Jan-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Add an option for breaking after C++11 attributes

Fixes #45968.
Fixes #54265.
Fixes #58102.

Differential Revision: https://reviews.llvm.org/D140956


# 89aad1e6 22-Dec-2022 Owen Pan <owenpiano@gmail.com>

Reland [clang-format] Add an option to format integer literal separators

Previously committed in 46c94e5067b5 which was reverted in f0756e086010
due to a memory bug.

Closes #58949.

Differential Re

Reland [clang-format] Add an option to format integer literal separators

Previously committed in 46c94e5067b5 which was reverted in f0756e086010
due to a memory bug.

Closes #58949.

Differential Revision: https://reviews.llvm.org/D140543

show more ...


# f0756e08 25-Dec-2022 Vitaly Buka <vitalybuka@google.com>

Revert "[clang-format] Add an option to format integer literal separators"
Revert "[clang-format] Disable FixRanges in IntegerLiteralSeparatorTest"

Breaks buildbots, details in https://reviews.llvm.

Revert "[clang-format] Add an option to format integer literal separators"
Revert "[clang-format] Disable FixRanges in IntegerLiteralSeparatorTest"

Breaks buildbots, details in https://reviews.llvm.org/D140543

This reverts commit 879bd9146a2c9ea395abd7c1ebd0f76f414a4967.
This reverts commit 46c94e5067b5f396c24bb950505c79bc819bd4b8.

show more ...


# 46c94e50 22-Dec-2022 Owen Pan <owenpiano@gmail.com>

[clang-format] Add an option to format integer literal separators

Closes #58949.

Differential Revision: https://reviews.llvm.org/D140543


# 5a06334c 16-Dec-2022 Jordan Rupprecht <rupprecht@google.com>

[Format] Capture `FormatStyle` by value to avoid use-after-free.

Fixes the test failure in 240e29c5015d246de7fb5e4421aa93042fada59b, reported on the D140058 review thread.


# 240e29c5 14-Dec-2022 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Turn on some code-changing options one by one

For the code-changing options InsertBraces, RemoveBracesLLVM, and
RemoveSemicolon, turn the option on only when running the token
an

[clang-format][NFC] Turn on some code-changing options one by one

For the code-changing options InsertBraces, RemoveBracesLLVM, and
RemoveSemicolon, turn the option on only when running the token
analyzer pass for it. This improves the run-time and avoids
interference from other options.

Differential Revision: https://reviews.llvm.org/D140058

show more ...


12345678910>>...47