[lldb][NFC] Modernize ClangASTContext constructor
Now using default initializers and StringRef.
Also formats the member list that we excluded from clang-format
at some point and still hangs around with the old LLDB code style.
llvm-svn: 373329
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 78bad39..891410d 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -522,14 +522,9 @@
Opts.NoInlineDefine = !Opt;
}
-ClangASTContext::ClangASTContext(const char *target_triple)
- : TypeSystem(TypeSystem::eKindClang), m_target_triple(), m_ast_up(),
- m_language_options_up(), m_source_manager_up(), m_diagnostics_engine_up(),
- m_target_options_rp(), m_target_info_up(), m_identifier_table_up(),
- m_selector_table_up(), m_builtins_up(), m_callback_tag_decl(nullptr),
- m_callback_objc_decl(nullptr), m_callback_baton(nullptr),
- m_pointer_byte_size(0), m_ast_owned(false) {
- if (target_triple && target_triple[0])
+ClangASTContext::ClangASTContext(llvm::StringRef target_triple)
+ : TypeSystem(TypeSystem::eKindClang) {
+ if (!target_triple.empty())
SetTargetTriple(target_triple);
}
@@ -676,13 +671,13 @@
return m_target_triple.c_str();
}
-void ClangASTContext::SetTargetTriple(const char *target_triple) {
+void ClangASTContext::SetTargetTriple(llvm::StringRef target_triple) {
Clear();
- m_target_triple.assign(target_triple);
+ m_target_triple = target_triple.str();
}
void ClangASTContext::SetArchitecture(const ArchSpec &arch) {
- SetTargetTriple(arch.GetTriple().str().c_str());
+ SetTargetTriple(arch.GetTriple().str());
}
bool ClangASTContext::HasExternalSource() {