|
3 | 3 | #include <swift/AST/GenericParamList.h> |
4 | 4 | #include <swift/AST/ParameterList.h> |
5 | 5 | #include "swift/extractor/infra/SwiftDiagnosticKind.h" |
6 | | -#include "swift/AST/PropertyWrappers.h" |
| 6 | +#include <swift/AST/PropertyWrappers.h> |
7 | 7 |
|
8 | 8 | namespace codeql { |
9 | 9 | namespace { |
@@ -303,27 +303,7 @@ std::optional<codeql::ModuleDecl> DeclTranslator::translateModuleDecl( |
303 | 303 | } |
304 | 304 |
|
305 | 305 | std::string DeclTranslator::mangledName(const swift::ValueDecl& decl) { |
306 | | - std::string_view moduleName = decl.getModuleContext()->getRealName().str(); |
307 | | - // ASTMangler::mangleAnyDecl crashes when called on `ModuleDecl` |
308 | | - if (decl.getKind() == swift::DeclKind::Module) { |
309 | | - return std::string{moduleName}; |
310 | | - } |
311 | | - std::ostringstream ret; |
312 | | - // stamp all declarations with an id-ref of the containing module |
313 | | - ret << '{' << ModuleDeclTag::prefix << '_' << moduleName << '}'; |
314 | | - if (decl.getKind() == swift::DeclKind::TypeAlias) { |
315 | | - // In cases like this (when coming from PCM) |
316 | | - // typealias CFXMLTree = CFTree |
317 | | - // typealias CFXMLTreeRef = CFXMLTree |
318 | | - // mangleAnyDecl mangles both CFXMLTree and CFXMLTreeRef into 'So12CFXMLTreeRefa' |
319 | | - // which is not correct and causes inconsistencies. mangleEntity makes these two distinct |
320 | | - // prefix adds a couple of special symbols, we don't necessary need them |
321 | | - ret << mangler.mangleEntity(&decl); |
322 | | - } else { |
323 | | - // prefix adds a couple of special symbols, we don't necessary need them |
324 | | - ret << mangler.mangleAnyDecl(&decl, /* prefix = */ false); |
325 | | - } |
326 | | - return ret.str(); |
| 306 | + return mangler.mangledName(decl); |
327 | 307 | } |
328 | 308 |
|
329 | 309 | void DeclTranslator::fillAbstractFunctionDecl(const swift::AbstractFunctionDecl& decl, |
|
0 commit comments