From bf61605531fd981916fa624c47491c49e4444991 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 1 May 2020 16:54:43 +0800 Subject: [PATCH] Switch to clang-r383902 This change also adapts to llvm::StringRef losing its implicit conversion to std::string(). Test: ./build-prebuilts.sh Change-Id: I32e2ca71fde4d39726a5061d641e933121e9bafe --- vndk/tools/header-checker/android/envsetup.sh | 4 ++-- vndk/tools/header-checker/src/diff/header_abi_diff.cpp | 2 +- vndk/tools/header-checker/src/dumper/abi_wrappers.cpp | 10 +++++----- .../header-checker/src/repr/symbol/so_file_parser.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vndk/tools/header-checker/android/envsetup.sh b/vndk/tools/header-checker/android/envsetup.sh index b9d6e0c40..417f5f84d 100644 --- a/vndk/tools/header-checker/android/envsetup.sh +++ b/vndk/tools/header-checker/android/envsetup.sh @@ -15,5 +15,5 @@ # limitations under the License. export LLVM_BUILD_HOST_TOOLS=true -export LLVM_PREBUILTS_VERSION=clang-r377782d -export LLVM_RELEASE_VERSION=10.0.6 +export LLVM_PREBUILTS_VERSION=clang-r383902 +export LLVM_RELEASE_VERSION=11.0.1 diff --git a/vndk/tools/header-checker/src/diff/header_abi_diff.cpp b/vndk/tools/header-checker/src/diff/header_abi_diff.cpp index f482253c1..e947d2f43 100644 --- a/vndk/tools/header-checker/src/diff/header_abi_diff.cpp +++ b/vndk/tools/header-checker/src/diff/header_abi_diff.cpp @@ -150,7 +150,7 @@ static std::string GetConfigFilePath(const std::string &dump_file_path) { llvm::SmallString<128> config_file_path(dump_file_path); llvm::sys::path::remove_filename(config_file_path); llvm::sys::path::append(config_file_path, "config.ini"); - return config_file_path.str(); + return std::string(config_file_path); } static void ReadConfigFile(const std::string &config_file_path) { diff --git a/vndk/tools/header-checker/src/dumper/abi_wrappers.cpp b/vndk/tools/header-checker/src/dumper/abi_wrappers.cpp index 2cf94bc8d..dacdaca4d 100644 --- a/vndk/tools/header-checker/src/dumper/abi_wrappers.cpp +++ b/vndk/tools/header-checker/src/dumper/abi_wrappers.cpp @@ -96,7 +96,7 @@ std::string ABIWrapper::GetMangledNameDecl( const clang::NamedDecl *decl, clang::MangleContext *mangle_contextp) { if (!mangle_contextp->shouldMangleDeclName(decl)) { clang::IdentifierInfo *identifier = decl->getIdentifier(); - return identifier ? identifier->getName() : ""; + return identifier ? identifier->getName().str() : ""; } std::string mangled_name; llvm::raw_string_ostream ostream(mangled_name); @@ -223,7 +223,7 @@ bool ABIWrapper::CreateExtendedType(clang::QualType qual_type, static std::string GetAnonymousEnumUniqueId(llvm::StringRef mangled_name, const clang::EnumDecl *enum_decl) { // Get the type name from the mangled name. - const std::string mangled_name_str = mangled_name; + const std::string mangled_name_str(mangled_name); std::smatch match_result; std::string old_suffix; std::string nested_name_suffix; @@ -274,7 +274,7 @@ std::string ABIWrapper::GetTypeUniqueId(clang::QualType qual_type) { return GetAnonymousEnumUniqueId(uid.str(), enum_decl); } - return uid.str(); + return std::string(uid); } // CreateBasicNamedAndTypedDecl creates a BasicNamedAndTypedDecl which will @@ -602,7 +602,7 @@ bool RecordDeclWrapper::SetupRecordFields(repr::RecordTypeIR *recordp, llvm::errs() << "Creation of Type failed\n"; return false; } - std::string field_name = field->getName(); + std::string field_name(field->getName()); uint64_t field_offset = record_layout.getFieldOffset(field_index); recordp->AddRecordField(repr::RecordFieldIR( field_name, GetTypeUniqueId(field_type), field_offset, @@ -855,7 +855,7 @@ std::string RecordDeclWrapper::GetMangledRTTI( llvm::SmallString<256> uid; llvm::raw_svector_ostream out(uid); mangle_contextp_->mangleCXXRTTI(qual_type, out); - return uid.str(); + return std::string(uid); } diff --git a/vndk/tools/header-checker/src/repr/symbol/so_file_parser.cpp b/vndk/tools/header-checker/src/repr/symbol/so_file_parser.cpp index 77356db53..fa2ee6c28 100644 --- a/vndk/tools/header-checker/src/repr/symbol/so_file_parser.cpp +++ b/vndk/tools/header-checker/src/repr/symbol/so_file_parser.cpp @@ -99,7 +99,7 @@ ELFSoFileParser::ELFSoFileParser(const llvm::object::ELFObjectFile *obj) { ElfSymbolIR::ElfSymbolBinding symbol_binding = LLVMToIRSymbolBinding(elf_sym->getBinding()); - std::string symbol_name = UnWrap(symbol_it.getName()); + std::string symbol_name(UnWrap(symbol_it.getName())); switch (symbol_it.getELFType()) { case llvm::ELF::STT_OBJECT: