mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Swift: mangle builtin types
This commit is contained in:
@@ -38,3 +38,12 @@ std::optional<std::string> SwiftMangler::mangleType(const swift::ModuleType& typ
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
#define TYPE(TYPE_ID, PARENT_TYPE)
|
||||
#define BUILTIN_TYPE(TYPE_ID, PARENT_TYPE) \
|
||||
std::optional<std::string> SwiftMangler::mangleType(const swift::TYPE_ID##Type& type) { \
|
||||
llvm::SmallString<32> buffer; \
|
||||
type.getTypeName(buffer); \
|
||||
return buffer.str().str(); \
|
||||
}
|
||||
#include <swift/AST/TypeNodes.def>
|
||||
|
||||
@@ -15,6 +15,11 @@ class SwiftMangler {
|
||||
|
||||
std::optional<std::string> mangleType(const swift::ModuleType& type);
|
||||
|
||||
#define TYPE(TYPE_ID, PARENT_TYPE)
|
||||
#define BUILTIN_TYPE(TYPE_ID, PARENT_TYPE) \
|
||||
std::optional<std::string> mangleType(const swift::TYPE_ID##Type& type);
|
||||
#include <swift/AST/TypeNodes.def>
|
||||
|
||||
private:
|
||||
swift::Mangle::ASTMangler mangler;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user