versioner: assorted fixes.
Zero initialize the contents of ArchMap, keep track of the symbol name in Declaration, remove unnecessary copies in loops. Change-Id: I47b07755846f252b83ffc4c89547a34b2f7ab868
This commit is contained in:
parent
bfb6bae9fb
commit
16057886d7
|
@ -76,7 +76,7 @@ class ArchMap {
|
|||
}
|
||||
|
||||
private:
|
||||
std::array<T, size_t(Arch::x86_64) + 1> data_;
|
||||
std::array<T, size_t(Arch::x86_64) + 1> data_ = {};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
|
|
@ -196,6 +196,7 @@ class Visitor : public RecursiveASTVisitor<Visitor> {
|
|||
auto declaration_it = symbol_it->second.declarations.find(location);
|
||||
if (declaration_it == symbol_it->second.declarations.end()) {
|
||||
Declaration declaration;
|
||||
declaration.name = declaration_name;
|
||||
declaration.location = location;
|
||||
declaration.is_extern = is_extern;
|
||||
declaration.is_definition = is_definition;
|
||||
|
@ -335,7 +336,7 @@ std::string to_string(const DeclarationAvailability& decl_av) {
|
|||
ss << to_string(decl_av.global_availability) << ", ";
|
||||
}
|
||||
|
||||
for (auto it : decl_av.arch_availability) {
|
||||
for (const auto& it : decl_av.arch_availability) {
|
||||
if (!it.second.empty()) {
|
||||
ss << to_string(it.first) << ": " << to_string(it.second) << ", ";
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ struct DeclarationAvailability {
|
|||
return false;
|
||||
}
|
||||
|
||||
for (auto it : arch_availability) {
|
||||
for (const auto& it : arch_availability) {
|
||||
if (!it.second.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ struct Location {
|
|||
std::string to_string(const Location& loc);
|
||||
|
||||
struct Declaration {
|
||||
std::string name;
|
||||
Location location;
|
||||
|
||||
bool is_extern;
|
||||
|
|
Loading…
Reference in New Issue