}
clang_type = m_ast.CreateEnumerationType(
- attrs.name.GetCString(), GetClangDeclContextContainingDIE(die, nullptr),
+ attrs.name.GetStringRef(),
+ GetClangDeclContextContainingDIE(die, nullptr),
GetOwningClangModule(die), attrs.decl, enumerator_clang_type,
attrs.is_scoped_enum);
} else {
Declaration declaration;
CompilerType enum_ct = m_clang.CreateEnumerationType(
- uname.c_str(), decl_context, OptionalClangModuleID(), declaration,
+ uname, decl_context, OptionalClangModuleID(), declaration,
ToCompilerType(underlying_type), er.isScoped());
TypeSystemClang::StartTagDeclarationDefinition(enum_ct);
// Class). Set it false for now.
bool isScoped = false;
- ast_enum = m_ast.CreateEnumerationType(name.c_str(), decl_context,
+ ast_enum = m_ast.CreateEnumerationType(name, decl_context,
OptionalClangModuleID(), decl,
builtin_type, isScoped);
#pragma mark Enumeration Types
CompilerType TypeSystemClang::CreateEnumerationType(
- const char *name, clang::DeclContext *decl_ctx,
+ llvm::StringRef name, clang::DeclContext *decl_ctx,
OptionalClangModuleID owning_module, const Declaration &decl,
const CompilerType &integer_clang_type, bool is_scoped) {
// TODO: Do something intelligent with the Declaration object passed in
// const bool IsFixed = false;
EnumDecl *enum_decl = EnumDecl::CreateDeserialized(ast, 0);
enum_decl->setDeclContext(decl_ctx);
- if (name && name[0])
+ if (!name.empty())
enum_decl->setDeclName(&ast.Idents.get(name));
enum_decl->setScoped(is_scoped);
enum_decl->setScopedUsingClassTag(is_scoped);
size_t element_count, bool is_vector);
// Enumeration Types
- CompilerType CreateEnumerationType(const char *name,
+ CompilerType CreateEnumerationType(llvm::StringRef name,
clang::DeclContext *decl_ctx,
OptionalClangModuleID owning_module,
const Declaration &decl,