Lines Matching +defs:string +defs:equal
65 using std::string;
72 /// Convenience typedef for a map of string -> string*.
73 typedef unordered_map<string, string*> pool_map_type;
89 /// Test if the interned string pool already contains a string with a
92 /// @param s the string to test for.
94 /// @return true if the pool contains a string with the value @p s.
99 /// Get a pointer to the interned string which has a given value.
101 /// @param s the value of the interned string to look for.
103 /// @return a pointer to the raw string of characters which has the
104 /// value of @p s. Or null if no string with value @p s was interned.
108 unordered_map<string, string*>::const_iterator i =
117 /// Create an interned string with a given value.
119 /// @param str_value the value of the interned string to create.
123 interned_string_pool::create_string(const std::string& str_value)
125 string*& result = priv_->map[str_value];
127 result = new string(str_value);
143 /// @param l the instance of std::string on the left-hand-side of the
149 /// @return true iff the two string are equal.
151 operator==(const std::string& l, const interned_string& r)
155 operator!=(const std::string& l, const interned_string& r)
170 o << static_cast<std::string>(s);
177 /// instance of std::string with the resulting string and return it.
179 /// @param s1 the first string to consider.
181 /// @param s2 the second string to consider.
183 /// @return the resuting concatenated string.
184 std::string
185 operator+(const interned_string& s1,const std::string& s2)
186 {return static_cast<std::string>(s1) + s2;}
191 /// instance of std::string with the resulting string and return it.
193 /// @param s1 the first string to consider.
195 /// @param s2 the second string to consider.
197 /// @return the resuting concatenated string.
198 std::string
199 operator+(const std::string& s1, const interned_string& s2)
200 {return s1 + static_cast<std::string>(s2);}
214 static string
342 string path_;
352 expanded_location(const string& path, unsigned line, unsigned column)
392 location::expand(std::string& path, unsigned& line, unsigned& column) const
408 /// Expand the location into a string.
410 /// @return the string representing the location.
411 string
414 string path, result;
447 location_manager::create_new_location(const std::string& file_path,
471 std::string& path,
702 string l_repr = get_pretty_representation(l);
703 string r_repr = get_pretty_representation(r);
742 /// the equality functions first compare non-equal, we can just set a
760 /// the equality functions first compare non-equal, we can just set a
1139 const std::string& path,
1229 const std::string&
1241 translation_unit::set_path(const string& a_path)
1253 const std::string&
1265 translation_unit::set_compilation_dir_path(const std::string& d)
1272 const std::string&
1277 string path;
1397 /// @return true if the two translation units are equal, false
1464 /// Converts a translation_unit::language enumerator into a string.
1468 /// @return the resulting string.
1469 string
1533 /// Parse a string representing a language into a
1534 /// translation_unit::language enumerator into a string.
1536 /// @param l the string representing the language.
1540 string_to_translation_unit_language(const string& l)
1651 /// @return true if the two translation units are equal, false otherwise.
1683 string name_;
1720 abg_compat::optional<std::string> namespace_;
1725 string id_string_;
1745 const string& n,
1754 const abg_compat::optional<std::string>& ns,
1809 const string& n,
1818 const abg_compat::optional<std::string>& ns,
1870 const string& n,
1879 const abg_compat::optional<std::string>& ns,
1894 /// @return true iff the two symbols are textually equal.
1943 const string&
1951 elf_symbol::set_name(const string& n)
2120 const abg_compat::optional<std::string>&
2128 elf_symbol::set_namespace(const abg_compat::optional<std::string>& ns)
2164 /// an alias that is equal to the main symbol should logically be a
2275 elf_symbol::update_main_symbol(const std::string& name)
2383 /// Get a string that is representative of a given elf_symbol.
2385 /// If the symbol has a version, then the ID string is the
2388 /// of the symbol then the '@' character is replaced by a "@@" string.
2393 /// @return a the ID string.
2394 const string&
2399 string s = get_name ();
2422 elf_symbol::get_alias_from_name(const string& name) const
2455 /// well as the id string of its aliases.
2463 /// @return the string.
2464 string
2468 string result;
2490 /// well as the id string of its aliases.
2495 /// @return the string.
2496 string
2508 string result;
2531 elf_symbol::get_name_and_version_from_id(const string& id,
2532 string& name,
2533 string& ver)
2537 string::size_type i = id.find('@');
2538 if (i == string::npos)
2550 string::size_type j = id.find('@', i);
2551 if (j == string::npos)
2568 /// Test if two main symbols are textually equal, or, if they have
2569 /// aliases that are textually equal.
2717 string repr;
2767 string repr;
2805 string repr;
2834 /// Convert a string representing a symbol type into an
2837 ///@param s the string to convert.
2843 string_to_elf_symbol_type(const string& s, elf_symbol::type& t)
2867 /// Convert a string representing a an elf symbol binding into an
2870 /// @param s the string to convert.
2876 string_to_elf_symbol_binding(const string& s, elf_symbol::binding& b)
2892 /// Convert a string representing a an elf symbol visibility into an
2895 /// @param s the string to convert.
2901 string_to_elf_symbol_visibility(const string& s, elf_symbol::visibility& v)
2941 string version_;
2948 priv(const string& v,
2962 elf_symbol::version::version(const string& v,
2974 /// Cast the version_type into a string that is its name.
2977 elf_symbol::version::operator const string&() const
2983 const string&
2991 elf_symbol::version::str(const string& s)
3205 string p1, p2;
3365 string s1 = get_pretty_representation(f, /*internal=*/false);
3366 string s2 = get_pretty_representation(s, /*internal=*/false);
3390 // types are logically equal, but here, we decide that
3426 string s1 = get_pretty_representation(f, false);
3427 string s2 = get_pretty_representation(s, false);
3557 /// equal to any class definition named "struct foo'. This is at
3581 /// equal to any class definition named "struct foo'. This is at
3659 /// Do intern a string.
3661 /// If a value of this string already exists in the interned string
3663 /// interned_string pointing to that already existing string.
3664 /// Otherwise, a new string is created, stored in the interned string
3666 /// that new intrerned string, and it's return.
3668 /// @param s the value of the string to intern.
3670 /// @return the interned string.
3672 environment::intern(const string& s) const
3812 /// Get the vector of canonical types which have a given "string
3834 /// Get a given canonical type which has a given "string
3867 unordered_map<string, uintptr_t>&
3884 unordered_map<uintptr_t, string>&
3903 string
4362 // __anonymous_struct__ string, even if the anonymous struct is not
4421 const string& name,
4423 const string& linkage_name,
4646 decl_base::set_name(const string& n)
4739 string qualified_name = build_qualified_name(get_scope(), t->get_name());
4758 decl_base::set_linkage_name(const string& m)
4835 /// with a meaningful string to add context for the user.
4836 string
4853 string name = get_generic_anonymous_internal_type_name(this);
5070 /// This is a sub-routine of the 'equal' overload for decl_base.
5085 string r;
5112 /// equal, the function keeps up the comparison in order to determine
5195 /// equal.
5258 string r;
5290 string r;
5321 /// equal, false otherwise.
5357 /// equal, false otherwise.
7509 const string& name,
7543 /// sorted using the lexicographic order of the string representing
7738 scope_decl::find_member_type(const string& name) const
7927 /// equal, the function keeps up the comparison in order to determine
8304 /// Get the string representation of a CV qualifier bitmap.
8308 /// @return the string representation.
8309 string
8312 string repr;
8339 string
8342 string result;
8371 string
8384 /// @return a copy of the string that represents the qualified name.
8385 string
8386 build_qualified_name(const scope_decl* scope, const string& name)
8391 string qualified_name;
8408 string
8487 /// empty string if it does not.
8550 /// the empty string if @p t is not an integral type.
8551 static string
8554 string name;
8580 /// empty string if it does not.
8599 string r;
8629 /// empty string if it does not.
8644 /// @return the name (string representation) of the pointer.
8650 string tn = get_type_name(pointed_to_type, qualified, internal);
8666 /// @return the name (string representation) of the reference.
8674 string name = get_type_name(pointed_to_type, qualified, internal);
8696 /// @return the name (string representation) of the qualified type.
8704 string quals_repr = get_string_representation_of_cv_quals(quals);
8705 string name = get_type_name(underlying_type, qualified, internal);
8926 string
8929 string result;
8954 string
8968 string
8986 string
9009 string
9023 string
9036 /// @return the string represenation of the function type.
9037 string
9051 /// @return the string represenation of the function type.
9052 string
9073 /// @return the string represenation of the function type.
9074 string
9091 /// @return the string represenation of the method type.
9092 string
9109 /// @return the string represenation of the method type.
9110 string
9127 /// @return the string represenation of the method type.
9128 string
9148 string
9150 const string& indent,
9155 string repr;
9156 string local_indent = " ";
9173 string name = cou.get_qualified_name();
9183 string real_indent;
9243 string
9245 const string& indent,
9272 string
9274 const string& indent,
9293 /// @return a debugging string representation of @p artifact.
9294 string
9298 return string("");
9304 string name = c->get_qualified_name();
9363 string name = e->get_qualified_name();
9506 /// Test if two ABI artifacts are equal.
9576 /// Test if two types are equal modulo a typedef.
9580 /// - A and B are equal
9614 /// Test if two types are equal modulo a typedef.
9618 /// - A and B are equal
9766 const string& name)
10781 /// Find the first relevant delimiter (the "::" string) in a fully
10809 find_next_delim_in_cplus_type(const string& fqn,
10841 fqn_to_components(const string& fqn,
10842 list<string>& comps)
10844 string::size_type fqn_size = fqn.size(), comp_begin = 0, comp_end = fqn_size;
10850 string comp = fqn.substr(comp_begin, comp_end - comp_begin);
10860 /// qualified name string.
10864 /// @return the resulting string, which would be the qualified name of
10866 string
10867 components_to_type_name(const list<string>& comps)
10869 string result;
10870 for (list<string>::const_iterator c = comps.begin();
10995 lookup_basic_type(const string& type_name, const translation_unit& tu)
11017 lookup_class_type(const string& fqn, const translation_unit& tu)
11072 lookup_union_type(const string& fqn, const translation_unit& tu)
11104 lookup_union_type_per_location(const string& loc, const corpus& corp)
11140 lookup_enum_type(const string& type_name, const translation_unit& tu)
11180 lookup_typedef_type(const string& type_name, const translation_unit& tu)
11267 lookup_pointer_type(const string& type_name, const translation_unit& tu)
11450 lookup_type(const string& fqn, const translation_unit& tu)
11490 lookup_type_in_scope(const string& fqn,
11493 list<string> comps;
11507 lookup_var_decl_in_scope(const string& fqn,
11510 list<string> comps;
11584 lookup_node_in_scope(const list<string>& fqn,
11592 for (list<string>::const_iterator c = fqn.begin(); c != fqn.end(); ++c)
11654 lookup_type_in_scope(const list<string>& comps,
11799 lookup_var_decl_in_scope(const std::list<string>& comps,
11816 lookup_node_in_translation_unit(const list<string>& fqn,
11832 lookup_type_through_scopes(const list<string>& fqn,
11852 lookup_class_type_through_scopes(const list<string>& fqn,
12092 lookup_type_through_translation_units(const string& qn,
12117 lookup_type_from_translation_unit(const string& type_name,
12118 const string& tu_path,
12233 lookup_basic_type_per_location(const string &loc, const corpus &corp)
12252 lookup_basic_type(const string& qualified_name, const corpus& corp)
12289 lookup_class_type(const string& qualified_name, const corpus& corp)
12376 lookup_class_types(const string& qualified_name, const corpus& corp)
12408 lookup_class_type_per_location(const string &loc, const corpus &corp)
12449 lookup_union_type(const string& type_name, const corpus& corp)
12487 lookup_enum_type(const string& qualified_name, const corpus& corp)
12543 lookup_enum_types(const string& qualified_name, const corpus& corp)
12574 lookup_enum_type_per_location(const string &loc, const corpus &corp)
12612 lookup_typedef_type(const string& qualified_name, const corpus& corp)
12669 lookup_typedef_type_per_location(const string &loc, const corpus &corp)
12689 lookup_class_or_typedef_type(const string& qualified_name, const corpus& corp)
12714 lookup_class_typedef_or_enum_type(const string& qualified_name,
13105 string str = l.expand();
13160 string qname = type->get_qualified_name();
13165 string str = l.expand();
13884 /// Demangle a C++ mangled name and return the resulting string
13889 string
13890 demangle_cplus_mangled_name(const string& mangled_name)
13899 string demangled_name = mangled_name;
13961 string t1_file_path, t2_file_path;
14010 // class/union is equal to all definitions of that
14012 // equal.
14021 // are equal, then t1 and t2 are defined in the same file.
14065 /// The two comparisons must be equal. Otherwise, the
14184 string repr = t->get_cached_pretty_representation(/*internal=*/true);
14235 // equal their definition.
14238 bool equal = (types_defined_same_linux_kernel_corpus_public(**it, *t)
14241 // the decl-only-class-being-equal-to-a-matching-definition
14247 if (equal)
14263 // be equal to its matching canonical type coming from
14288 string type_id = env.get_type_id_from_pointer(ptr_val);
14562 string r = ir::get_pretty_representation(this, internal);
14570 string r = ir::get_pretty_representation(this, internal);
14592 /// equal, the function keeps up the comparison in order to determine
14607 /// Return true iff both type declarations are equal.
14609 /// Note that this doesn't test if the scopes of both types are equal.
14753 /// A word is considered to be a string of characters that doesn't
14756 /// @param word the word to parse. It is considered to be a string of
14764 parse_integral_type_modifier(const string& word,
14783 /// Parse a base type of an integral type from a string.
14793 parse_base_integral_type(const string& type_name,
14818 /// Parse an integral type from a string.
14820 /// @param type_name the string containing the integral type to parse.
14831 parse_integral_type(const string& type_name,
14835 string input = type_name;
14836 string::size_type len = input.length();
14837 string::size_type cur_pos = 0, prev_pos = 0;
14838 string cur_word, prev_word;
14864 string saved_prev_word = prev_word;
14891 /// Parse an integral type from a string.
14893 /// @param str the string containing the integral type to parse.
14901 parse_integral_type(const string& str, integral_type& type)
14934 integral_type::integral_type(const string& type_name)
14973 /// Return the string representation of the current instance of @ref
14976 /// @param internal if true the string representation is to be used
14980 /// @return the string representation of the current instance of @ref
14982 string
14985 string result;
14998 // same size. If they don't have the same internal string
15030 /// Convert the current instance of @ref integral_type into its string
15033 /// @return the string representation of the current instance of @ref
15035 integral_type::operator string() const
15059 const string& name,
15063 const string& linkage_name,
15080 // Convert the integral_type into its canonical string
15082 string integral_type_name = int_type;
15084 // Set the name of this type_decl to the canonical string
15109 /// equal, the function keeps up the comparison in order to determine
15284 string
15337 const string& name,
15366 /// equal, the function keeps up the comparison in order to determine
15392 /// @return true iff both scope types are equal.
15408 /// @return true iff both scope types are equal.
15474 const string& name,
15510 string
15514 string r =
15520 /// Return true iff both namespaces and their members are equal.
15523 /// namespaces are equal.
15641 string
15755 /// equal, the function keeps up the comparison in order to determine
15803 /// @return true iff both qualified types are equal.
15822 /// @return true iff both qualified types are equal.
15840 /// @return true iff both qualified types are equal.
15967 /// Compute and return the string prefix or suffix representing the
15971 /// @return the newly-built cv string.
15972 string
16082 string str;
16165 string name = (pto ? pto->get_name() : string("void")) + "*";
16195 string name = string("void") + "*";
16213 string name = (pto ? pto->get_name() : string("void")) + "*";
16237 /// equal, the function keeps up the comparison in order to determine
16259 /// Return true iff both instances of pointer_type_def are equal.
16272 /// Return true iff both instances of pointer_type_def are equal.
16289 /// Return true iff both instances of pointer_type_def are equal.
16445 /// shared_ptrs are equal, false otherwise.
16517 string name;
16521 name = string(pto->get_name()) + "&";
16524 name = string(get_type_name(is_function_type(pointed_to),
16570 string name = "void&";
16596 string name = string(pto->get_name()) + "&";
16619 /// equal, the function keeps up the comparison in order to determine
16650 /// @return true iff the two instances are equal.
16666 /// @return true iff the two instances are equal.
16681 /// @return true iff the two instances are equal.
16754 string
16758 string result =
16810 /// shared_ptrs are equal, false otherwise.
16977 const string& name,
17009 const string& name,
17037 const string& name,
17134 /// Return a string representation of the sub range.
17136 /// @return the string representation of the sub range.
17137 string
17157 /// Return a string representation of a vector of subranges
17159 /// @return the string representation of a vector of sub ranges.
17160 string
17166 string r;
17190 /// equal, the function keeps up the comparison in order to determine
17284 string
17287 string name = get_name();
17288 string repr;
17427 string
17430 string r = subrange_type::vector_as_string(get_subranges());
17434 /// Get the string representation of an @ref array_type_def.
17442 static string
17447 string r;
17455 << e_type ? e_type->get_pretty_representation(internal):string("void");
17464 : string("void"))
17469 : string("void"))
17494 string
17514 /// equal, the function keeps up the comparison in order to determine
17840 enum_type_decl::enum_type_decl(const string& name,
17844 const string& linkage_name,
17896 string
17900 string r = "enum ";
17994 string n_l = l.get_name();
17995 string n_r = r.get_name();
18042 /// Check if two enumerators values are equal.
18045 /// equal or not.
18133 /// equal, the function keeps up the comparison in order to determine
18207 // In that case, note that the two enums below are considered equal:
18241 // These two enums are considered equal.
18339 string name_;
18341 string qualified_name_;
18352 priv(const string& name,
18375 enum_type_decl::enumerator::enumerator(const string& name,
18430 const string&
18447 const string&
18464 enum_type_decl::enumerator::set_name(const string& n)
18503 string internal_qualified_name_;
18504 string temp_internal_qualified_name_;
18522 typedef_decl::typedef_decl(const string& name,
18525 const string& linkage_name,
18552 typedef_decl::typedef_decl(const string& name,
18555 const string& mangled_name,
18618 /// equal, the function keeps up the comparison in order to determine
18696 string
18701 string result = "typedef ";
18797 var_decl::var_decl(const string& name,
18800 const string& linkage_name,
18932 /// equal, the function keeps up the comparison in order to determine
18981 // The variables have underlying elf symbols that are equal, so
19058 string repr = get_name();
19059 string sym_str;
19101 /// The string returned for the anonymous member here is going to be:
19116 string r = get_pretty_representation(internal);
19139 string
19142 string result;
19156 string name;
19230 string
19233 string name;
19496 /// equal, the function keeps up the comparison in order to determine
19570 string l_rt_name = l_return_type_decl
19572 : string();
19573 string r_rt_name = r_return_type_decl
19575 : string();
19753 /// @return true iff the two function_type are equal.
19778 string
20006 string
20084 function_decl::function_decl(const string& name,
20088 const string& mangled_name,
20122 function_decl::function_decl(const string& name,
20126 const string& linkage_name,
20152 string
20159 string result = mem_fn ? "method ": "function ";
20202 string
20208 string result;
20435 /// equal, the function keeps up the comparison in order to determine
20447 ; // the types are equal, let's move on to compare the other
20487 // The functions have underlying elf symbols that are equal,
20695 /// comparing them too. If the two pointed-to objects are equal then
20720 /// @return true iff @p is not equal to @p r.
20751 const string& name,
20764 const string& name,
20778 const string& name,
20815 string str;
20828 const string
20832 string str;
20887 /// equal, the function keeps up the comparison in order to determine
21040 string
21046 string type_repr;
21055 string result = type_repr;
21056 string parm_name = get_name_id();
21092 class_or_union::class_or_union(const environment& env, const string& name,
21142 class_or_union::class_or_union(const environment& env, const string& name,
21164 class_or_union::class_or_union(const environment& env, const string& name,
21517 class_or_union::find_data_member(const string& name) const
21651 class_or_union::find_member_function(const string& linkage_name) const
21662 class_or_union::find_member_function(const string& linkage_name)
21677 class_or_union::find_member_function_sptr(const string& linkage_name)
21693 class_or_union::find_member_function_from_signature(const string& s) const
21705 class_or_union::find_member_function_from_signature(const string& s)
21860 /// the @ref equal overloads.
21872 /// using the @ref equal overloads.
21897 /// equal, the function keeps up the comparison in order to determine
22201 /// are equal, then we can deduce that the canonical type of the
22248 /// considered equal. This is done so that we don't enter an infinite
22251 /// That means ST1 is also deemed equal to ST1'. If we are in the
22256 /// equal to the canonical type of ST1 as a result of that
22316 unordered_map<string, base_spec_sptr> bases_map_;
22362 class_decl::class_decl(const environment& env, const string& name,
22413 class_decl::class_decl(const environment& env, const string& name,
22433 /*linkage_name=*/is_anonymous ? string() : name,
22459 class_decl::class_decl(const environment& env, const string& name,
22496 class_decl:: class_decl(const environment& env, const string& name,
22514 /*linkage_name=*/ is_anonymous ? string() : name,
22534 class_decl::class_decl(const environment& env, const string& name,
22605 class_decl::find_base_class(const string& qualified_name) const
22607 unordered_map<string, base_spec_sptr>::iterator i =
22665 string
22669 string cl = "class ";
22686 string result = cl;
22867 /// equal, the function keeps up the comparison in order to determine
22943 method_decl::method_decl(const string& name,
22947 const string& linkage_name,
22980 method_decl::method_decl(const string& name,
22984 const string& linkage_name,
23017 method_decl::method_decl(const string& name,
23021 const string& linkage_name,
23041 method_decl::set_linkage_name(const string& l)
23175 string fn, sn;
23178 // string.
23202 string fn_filepath, sn_filepath;
23406 /// Test if two methods are equal without taking their symbol or
23434 bool equal = *first == *second;
23441 return equal;
23447 /// Note that "equivalent" here means being equal without taking the
23516 /// equal, the function keeps up the comparison in order to determine
23628 // be equal if we don't take into account their symbol name or
23787 /// equal, false otherwise.
24123 /// @return true iff the two instances are equal.
24138 /// @return true iff the two instances are equal.
24158 /// @return true iff the two instances are equal.
24198 string r;
24326 union_decl::union_decl(const environment& env, const string& name,
24362 union_decl::union_decl(const environment& env, const string& name,
24379 /*linkage_name=*/is_anonymous ? string() : name,
24400 union_decl::union_decl(const environment& env, const string& name,
24431 union_decl::union_decl(const environment& env, const string& name,
24448 /*linkage_name=*/is_anonymous ? string() : name,
24467 const string& name,
24499 string
24503 string repr;
24507 repr = string("union ") +
24670 /// equal, the function keeps up the comparison in order to determine
24812 const string& name,
24966 const string& name,
25046 const string& name,
25125 const string& name,
25365 /// @return true iff the two instance are equal.
25379 /// @return true iff the two instance are equal.
25393 /// @return true iff the two instance are equal.
25699 string repr1 = get_pretty_representation(t1, /*internal=*/false),
25748 string repr = v->get_pretty_representation(/*internal=*/true);
25749 std::hash<string> hash_string;
25757 string repr = f->get_pretty_representation(/*internal=*/true);
25758 std::hash<string> hash_string;
25952 string fr = f.get_pretty_representation_of_declarator(),
26254 string
26255 build_internal_underlying_enum_type_name(const string &base_name,
26577 /// Generate a different string at each invocation.
26579 /// @return the resulting string.
26580 static string
26591 /// string.
26592 typedef unordered_map<const function_decl*, string,
26596 /// Return a string associated to a given function. Two functions
26597 /// that compare equal would yield the same string, as far as this
26604 /// diffing issues on string and thus ease the debugging.
26606 /// @param fn the function to generate a string for.
26608 /// @param m the function_decl* <-> string map to be used by this
26611 /// @return the resulting string.
26612 static const string&
26619 string s = get_next_string();
26623 /// Generate a sequence of string that matches a given sequence of
26625 /// representated" by a string. For instance, if the same function "foo"
26626 /// appears at indexes 1 and 3, then the same string 'schmurf' (okay,
26627 /// we don't care about the actual string) would appear at index 1 and 3.
26634 /// @param m the function_decl* <-> string map to be used by this
26651 /// sequence of string that matches a given sequence of function. In
26653 /// by a string. For instance, if the same function "foo" appears at
26654 /// indexes 1 and 3, then the same string 'schmurf' (okay, we don't
26655 /// care about the actual string) would appear at index 1 and 3.
26667 /// @param m the function_decl* <-> string map to be used by this
26687 /// sequence of string that matches a given sequence of function. In
26689 /// by a string. For instance, if the same function "foo" appears at
26690 /// indexes 1 and 3, then the same string 'schmurf' (okay, we don't
26691 /// care about the actual string) would appear at index 1 and 3.
26735 std::string parent_qualified_name;