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,h --
lldb/test/API/commands/frame/var-dil/expr/Casts/main.cpp
lldb/include/lldb/ValueObject/DILAST.h lldb/include/lldb/ValueObject/DILEval.h
lldb/source/ValueObject/DILEval.cpp --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/lldb/source/ValueObject/DILEval.cpp
b/lldb/source/ValueObject/DILEval.cpp
index 453152554..28175b3f6 100644
--- a/lldb/source/ValueObject/DILEval.cpp
+++ b/lldb/source/ValueObject/DILEval.cpp
@@ -776,10 +776,10 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
-llvm::Expected<CompilerType> Interpreter::VerifyCastType(
- lldb::ValueObjectSP &operand, CompilerType &op_type,
- CompilerType target_type, CastPromoKind &promo_kind,
- CastKind &cast_kind, int location) {
+llvm::Expected<CompilerType>
+Interpreter::VerifyCastType(lldb::ValueObjectSP &operand, CompilerType
&op_type,
+ CompilerType target_type, CastPromoKind
&promo_kind,
+ CastKind &cast_kind, int location) {
promo_kind = CastPromoKind::eNone;
if (op_type.IsReferenceType())
@@ -802,8 +802,8 @@ llvm::Expected<CompilerType> Interpreter::VerifyCastType(
// Cast from pointer to float/double is not allowed.
if (target_type.IsFloat()) {
std::string errMsg = llvm::formatv(
- "Cast from {0} to {1} is not allowed",
- op_type.TypeDescription(), target_type.TypeDescription());
+ "Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+ target_type.TypeDescription());
return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg), location,
op_type.TypeDescription().length());
@@ -840,9 +840,9 @@ llvm::Expected<CompilerType> Interpreter::VerifyCastType(
} else if (target_type.IsEnumerationType()) {
// Cast to enum type.
if (!op_type.IsScalarType() && !op_type.IsEnumerationType()) {
- std::string errMsg = llvm::formatv(
- "Cast from {0} to {1} is not allowed",
- op_type.TypeDescription(), target_type.TypeDescription());
+ std::string errMsg = llvm::formatv("Cast from {0} to {1} is not allowed",
+ op_type.TypeDescription(),
+ target_type.TypeDescription());
return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg), location,
@@ -871,9 +871,9 @@ llvm::Expected<CompilerType> Interpreter::VerifyCastType(
(!operand->IsIntegerType(is_signed) ||
(is_signed && operand->GetValueAsSigned(0) != 0) ||
(!is_signed && operand->GetValueAsUnsigned(0) != 0))) {
- std::string errMsg = llvm::formatv(
- "Cast from {0} to {1} is not allowed",
- op_type.TypeDescription(), target_type.TypeDescription());
+ std::string errMsg = llvm::formatv("Cast from {0} to {1} is not allowed",
+ op_type.TypeDescription(),
+ target_type.TypeDescription());
return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg), location,
@@ -907,9 +907,8 @@ llvm::Expected<lldb::ValueObjectSP>
Interpreter::Visit(const CastNode *node) {
CastKind cast_kind = CastKind::eNone;
CastPromoKind promo_kind = CastPromoKind::eNone;
- auto type_or_err =
- VerifyCastType(operand, op_type, node->GetType(), promo_kind,
- cast_kind, node->GetLocation());
+ auto type_or_err = VerifyCastType(operand, op_type, node->GetType(),
+ promo_kind, cast_kind,
node->GetLocation());
if (!type_or_err)
return type_or_err.takeError();
diff --git a/lldb/test/API/commands/frame/var-dil/expr/Casts/main.cpp
b/lldb/test/API/commands/frame/var-dil/expr/Casts/main.cpp
index f54e58f36..8ecf4d548 100644
--- a/lldb/test/API/commands/frame/var-dil/expr/Casts/main.cpp
+++ b/lldb/test/API/commands/frame/var-dil/expr/Casts/main.cpp
@@ -8,7 +8,6 @@
#include <memory>
#include <string>
-
namespace ns {
typedef int myint;
@@ -17,7 +16,6 @@ class Foo {};
} // namespace ns
-
int main(int argc, char **argv) {
int a = 1;
int *ap = &a;
``````````
</details>
https://github.com/llvm/llvm-project/pull/170332
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits