diff options
author | Logan Chien <loganchien@google.com> | 2019-08-27 10:45:42 -0700 |
---|---|---|
committer | Logan Chien <loganchien@google.com> | 2019-08-27 11:54:28 -0700 |
commit | 8fd8b999783aacd73c8164c3453d6c6212907fb1 (patch) | |
tree | ea91f94264e0dce8ea3de088b6877e166a7253bf /tools | |
parent | c071fe40899c9374a1ea143c4b6264cf05788d9d (diff) | |
download | bionic-8fd8b999783aacd73c8164c3453d6c6212907fb1.tar.gz |
versioner: Add R to codename map
This commit adds "R" to codename map because `libc.map.txt` started
using "introduced=R".
Test: PATH=prebuilts/clang-tools/linux-x86/bin:$PATH \
./bionic/tools/versioner/run_tests.py
Bug: 140110040
Change-Id: Ibc1154557c29d9580b5c527160116b24fa4c656f
Diffstat (limited to 'tools')
-rw-r--r-- | tools/versioner/src/Arch.h | 5 | ||||
-rw-r--r-- | tools/versioner/src/SymbolFileParser.cpp | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/tools/versioner/src/Arch.h b/tools/versioner/src/Arch.h index 16fa2655b..e4bbcc44a 100644 --- a/tools/versioner/src/Arch.h +++ b/tools/versioner/src/Arch.h @@ -138,7 +138,9 @@ static ArchMap<std::string> arch_targets = { { Arch::x86_64, "x86_64-linux-android" }, }; -static const std::set<int> default_levels = { 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29 }; +static const std::set<int> default_levels = { + 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29, 30, +}; static const ArchMap<int> arch_min_api = { { Arch::arm, 9 }, @@ -165,4 +167,5 @@ static const std::unordered_map<std::string, int> api_codename_map{ {"O-MR1", 27}, {"P", 28}, {"Q", 29}, + {"R", 30}, }; diff --git a/tools/versioner/src/SymbolFileParser.cpp b/tools/versioner/src/SymbolFileParser.cpp index c312b4856..1b4adae6f 100644 --- a/tools/versioner/src/SymbolFileParser.cpp +++ b/tools/versioner/src/SymbolFileParser.cpp @@ -266,19 +266,23 @@ class SymbolFileParser { if (!api_level.empty()) { // If an api-level tag is specified, it must be an exact match (mainly // for versioner unit tests). - return compilation_type.api_level == decodeApiLevelValue(api_level); + return compilation_type.api_level == parseApiLevelValue(api_level); } - return compilation_type.api_level >= decodeApiLevelValue(intro); + return compilation_type.api_level >= parseApiLevelValue(intro); } - // Extract and decode the integer API level from api-level or introduced tags. - static int decodeApiLevelValue(const std::string& tag) { + // Parse the integer API level from api-level or introduced tags. + int parseApiLevelValue(const std::string& tag) const { std::string api_level = tag.substr(tag.find('=') + 1); auto it = api_codename_map.find(api_level); if (it != api_codename_map.end()) { return it->second; } + if (api_level.find_first_not_of("0123456789") != std::string::npos) { + errx(1, "%s:%zu: error: unknown API level codename specified: \"%s\"", + file_path.c_str(), curr_line_num, tag.c_str()); + } return std::stoi(api_level); } |