github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c --
clang/lib/CodeGen/CGDebugInfo.cpp clang/test/DebugInfo/Generic/macro-info.c
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 22fc6704d..81f6d09a8 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -49,21 +49,21 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SHA1.h"
#include "llvm/Support/SHA256.h"
#include "llvm/Support/TimeProfiler.h"
-#include "llvm/Support/CommandLine.h"
#include <cstdint>
#include <optional>
using namespace clang;
using namespace clang::CodeGen;
-static llvm::cl::opt<bool>
- DebugInfoMacroExpansionLoc("debug-info-macro-expansion-loc",
- llvm::cl::desc("Use expansion location for
debug info"),
- llvm::cl::init(false));
+static llvm::cl::opt<bool> DebugInfoMacroExpansionLoc(
+ "debug-info-macro-expansion-loc",
+ llvm::cl::desc("Use expansion location for debug info"),
+ llvm::cl::init(false));
static uint32_t getTypeAlignIfRequired(const Type *Ty, const ASTContext &Ctx) {
auto TI = Ctx.getTypeInfo(Ty);
@@ -581,8 +581,8 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation
Loc) {
FileName = TheCU->getFile()->getFilename();
CSInfo = TheCU->getFile()->getChecksum();
} else {
- PresumedLoc PLoc =
- SM.getPresumedLoc(DebugInfoMacroExpansionLoc ? Loc :
SM.getFileLoc(Loc));
+ PresumedLoc PLoc = SM.getPresumedLoc(
+ DebugInfoMacroExpansionLoc ? Loc : SM.getFileLoc(Loc));
FileName = PLoc.getFilename();
if (FileName.empty()) {
@@ -609,9 +609,10 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation
Loc) {
if (CSKind)
CSInfo.emplace(*CSKind, Checksum);
}
- return createFile(
- FileName, CSInfo,
- getSource(SM, SM.getFileID(DebugInfoMacroExpansionLoc ? Loc :
SM.getFileLoc(Loc))));
+ return createFile(FileName, CSInfo,
+ getSource(SM, SM.getFileID(DebugInfoMacroExpansionLoc
+ ? Loc
+ : SM.getFileLoc(Loc))));
}
llvm::DIFile *CGDebugInfo::createFile(
@@ -666,7 +667,8 @@ unsigned CGDebugInfo::getLineNumber(SourceLocation Loc) {
if (Loc.isInvalid())
return 0;
SourceManager &SM = CGM.getContext().getSourceManager();
- return SM.getPresumedLoc(DebugInfoMacroExpansionLoc ? Loc :
SM.getFileLoc(Loc))
+ return SM
+ .getPresumedLoc(DebugInfoMacroExpansionLoc ? Loc : SM.getFileLoc(Loc))
.getLine();
}
@@ -679,9 +681,9 @@ unsigned CGDebugInfo::getColumnNumber(SourceLocation Loc,
bool Force) {
if (Loc.isInvalid() && CurLoc.isInvalid())
return 0;
SourceManager &SM = CGM.getContext().getSourceManager();
- PresumedLoc PLoc = SM.getPresumedLoc(Loc.isValid()
- ? (DebugInfoMacroExpansionLoc ? Loc
: SM.getFileLoc(Loc))
- : CurLoc);
+ PresumedLoc PLoc = SM.getPresumedLoc(
+ Loc.isValid() ? (DebugInfoMacroExpansionLoc ? Loc : SM.getFileLoc(Loc))
+ : CurLoc);
return PLoc.isValid() ? PLoc.getColumn() : 0;
}
@@ -5027,7 +5029,8 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder,
SourceLocation Loc) {
// Update our current location
setLocation(Loc);
- if (CurLoc.isInvalid() || (DebugInfoMacroExpansionLoc && CurLoc.isMacroID())
||
+ if (CurLoc.isInvalid() ||
+ (DebugInfoMacroExpansionLoc && CurLoc.isMacroID()) ||
LexicalBlockStack.empty())
return;
``````````
</details>
https://github.com/llvm/llvm-project/pull/174895
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits