-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[lldb] Refactor LookupInfo object to be per-language #168797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
augusto2112
wants to merge
1
commit into
llvm:main
Choose a base branch
from
augusto2112:lookup-info
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+224
−79
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -315,6 +315,22 @@ class Module : public std::enable_shared_from_this<Module>, | |||||
| const ModuleFunctionSearchOptions &options, | ||||||
| SymbolContextList &sc_list); | ||||||
|
|
||||||
| /// Find functions by a vector of lookup infos. | ||||||
| /// | ||||||
| /// If the function is an inlined function, it will have a block, | ||||||
| /// representing the inlined function, and the function will be the | ||||||
| /// containing function. If it is not inlined, then the block will be NULL. | ||||||
| /// | ||||||
| /// \param[in] lookup_infos | ||||||
| /// The vector of lookup infos of the function we are looking for. | ||||||
| /// | ||||||
| /// \param[out] sc_list | ||||||
| /// A symbol context list that gets filled in with all of the | ||||||
| /// matches. | ||||||
| void FindFunctions(const std::vector<LookupInfo> &lookup_infos, | ||||||
| const CompilerDeclContext &parent_decl_ctx, | ||||||
| const ModuleFunctionSearchOptions &options, | ||||||
| SymbolContextList &sc_list); | ||||||
| /// Find functions by name. | ||||||
| /// | ||||||
| /// If the function is an inlined function, it will have a block, | ||||||
|
|
@@ -917,8 +933,29 @@ class Module : public std::enable_shared_from_this<Module>, | |||||
| public: | ||||||
| LookupInfo() = default; | ||||||
|
|
||||||
| LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask, | ||||||
| lldb::LanguageType language); | ||||||
| /// Creates a vector of lookup infos for function name resolution. | ||||||
| /// | ||||||
| /// \param[in] name | ||||||
| /// The function name to search for. This can be a simple name like | ||||||
| /// "foo" or a qualified name like "Class::method". | ||||||
| /// | ||||||
| /// \param[in] name_type_mask | ||||||
| /// A bitmask specifying what types of names to search for | ||||||
| /// (e.g., eFunctionNameTypeFull, eFunctionNameTypeBase, | ||||||
| /// eFunctionNameTypeMethod, eFunctionNameTypeAuto). Multiple types | ||||||
| /// can be combined with bitwise OR. | ||||||
| /// | ||||||
| /// \param[in] requested_lang_type | ||||||
| /// The language to create lookups for. If eLanguageTypeUnknown is | ||||||
| /// passed, creates one LookupInfo for each language plugin currently | ||||||
| /// available in LLDB. If a specific language is provided, creates only | ||||||
| // a single LookupInfo for that language. | ||||||
| /// | ||||||
| /// \return | ||||||
| /// A vector of LookupInfo objects, one per relevant language. | ||||||
| static std::vector<LookupInfo> | ||||||
| MakeLookupInfos(ConstString name, lldb::FunctionNameType name_type_mask, | ||||||
| lldb::LanguageType requested_lang_type); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just
Suggested change
|
||||||
|
|
||||||
| ConstString GetName() const { return m_name; } | ||||||
|
|
||||||
|
|
@@ -959,6 +996,10 @@ class Module : public std::enable_shared_from_this<Module>, | |||||
| /// If \b true, then demangled names that match will need to contain | ||||||
| /// "m_name" in order to be considered a match | ||||||
| bool m_match_name_after_lookup = false; | ||||||
|
|
||||||
| private: | ||||||
| LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask, | ||||||
| lldb::LanguageType lang_type); | ||||||
| }; | ||||||
|
|
||||||
| /// Get a unique hash for this module. | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Doxygen comment is missing arguments. I personally think it adds little value compared to the cost of keeping it in sync as the function will eventually change, so I would just omit it.