Skip to content

Commit abd3c27

Browse files
committed
[clang][codegen] Mention the invariant that LLVM demangler should be able to handle mangled names generated by clang.
https://discourse.llvm.org/t/rfc-clang-diagnostic-for-demangling-failures/82835/8
1 parent 026af9e commit abd3c27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,13 @@ StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
20472047
GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel),
20482048
ND));
20492049

2050+
// This invariant should hold true in the future.
2051+
// Prior work: https://discourse.llvm.org/t/rfc-clang-diagnostic-for-demangling-failures/82835/8
2052+
// https://github.com/llvm/llvm-project/issues/111345
2053+
// assert(llvm::isMangledName(MangledName) &&
2054+
// llvm::demangle(MangledName) != MangledName &&
2055+
// "LLVM demangler must demangle clang-generated names");
2056+
20502057
auto Result = Manglings.insert(std::make_pair(MangledName, GD));
20512058
return MangledDeclNames[CanonicalGD] = Result.first->first();
20522059
}

0 commit comments

Comments
 (0)