aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/TypeSystem
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-08-17 13:35:12 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-08-17 14:17:20 +0200
commitcfb773c676236652f63f9ba031d6755d55f5d884 (patch)
tree9c13befb7e22a920381a84020ba63466b40dfc41 /lldb/source/Plugins/TypeSystem
parentbc902191d3c002c13436f2c9a299826704861a80 (diff)
downloadllvm-cfb773c676236652f63f9ba031d6755d55f5d884.zip
llvm-cfb773c676236652f63f9ba031d6755d55f5d884.tar.gz
llvm-cfb773c676236652f63f9ba031d6755d55f5d884.tar.bz2
[lldb][NFC] Use StringRef in CreateFunctionDeclaration/GetDeclarationName
CreateFunctionDeclaration should just take a StringRef. GetDeclarationName is (only) used by CreateFunctionDeclaration so that's why now also takes a StringRef.
Diffstat (limited to 'lldb/source/Plugins/TypeSystem')
-rw-r--r--lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp7
-rw-r--r--lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h12
2 files changed, 8 insertions, 11 deletions
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 2ace212..608cdc2 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1965,11 +1965,8 @@ TypeSystemClang::GetOpaqueCompilerType(clang::ASTContext *ast,
#pragma mark Function Types
clang::DeclarationName
-TypeSystemClang::GetDeclarationName(const char *name,
+TypeSystemClang::GetDeclarationName(llvm::StringRef name,
const CompilerType &function_clang_type) {
- if (!name || !name[0])
- return clang::DeclarationName();
-
clang::OverloadedOperatorKind op_kind = clang::NUM_OVERLOADED_OPERATORS;
if (!IsOperator(name, op_kind) || op_kind == clang::NUM_OVERLOADED_OPERATORS)
return DeclarationName(&getASTContext().Idents.get(
@@ -1996,7 +1993,7 @@ TypeSystemClang::GetDeclarationName(const char *name,
FunctionDecl *TypeSystemClang::CreateFunctionDeclaration(
clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
- const char *name, const CompilerType &function_clang_type,
+ llvm::StringRef name, const CompilerType &function_clang_type,
clang::StorageClass storage, bool is_inline) {
FunctionDecl *func_decl = nullptr;
ASTContext &ast = getASTContext();
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 4ae1271..74fd9de 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -408,11 +408,10 @@ public:
// Function Types
- clang::FunctionDecl *
- CreateFunctionDeclaration(clang::DeclContext *decl_ctx,
- OptionalClangModuleID owning_module,
- const char *name, const CompilerType &function_Type,
- clang::StorageClass storage, bool is_inline);
+ clang::FunctionDecl *CreateFunctionDeclaration(
+ clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
+ llvm::StringRef name, const CompilerType &function_Type,
+ clang::StorageClass storage, bool is_inline);
CompilerType CreateFunctionType(const CompilerType &result_type,
const CompilerType *args, unsigned num_args,
@@ -1053,7 +1052,8 @@ public:
}
clang::DeclarationName
- GetDeclarationName(const char *name, const CompilerType &function_clang_type);
+ GetDeclarationName(llvm::StringRef name,
+ const CompilerType &function_clang_type);
clang::LangOptions *GetLangOpts() const {
return m_language_options_up.get();