[clang] [llvm] [clang][LLVM Demangler] Add an assertion that validates that all mang… (PR #111391)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 7 08:15:05 PDT 2024
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 4b3ba64ba71c06b6bc9db347a66a7316f5edbcc4 9c16570650e487e63ec887d61be478ecad5402c2 --extensions cpp,h -- clang/test/CodeGenCXX/assert-demangle.cpp clang/lib/CodeGen/CodeGenModule.cpp llvm/include/llvm/Demangle/Demangle.h llvm/lib/Demangle/Demangle.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 6afbfa9ae4..94b04df652 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2047,10 +2047,11 @@ StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel),
ND));
- if (getCodeGenOpts().NoDemanglingFailures)
- assert((!llvm::isMangledName(MangledName) || llvm::demangle(MangledName) !=
- MangledName) && "clang must demangle a mangled name it generates!");
-
+ if (getCodeGenOpts().NoDemanglingFailures)
+ assert((!llvm::isMangledName(MangledName) ||
+ llvm::demangle(MangledName) != MangledName) &&
+ "clang must demangle a mangled name it generates!");
+
auto Result = Manglings.insert(std::make_pair(MangledName, GD));
return MangledDeclNames[CanonicalGD] = Result.first->first();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/111391
More information about the cfe-commits
mailing list