Skip to content

Add an API for clang dependency scanner to perform module lookup by name alone #3230

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

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

ahatanaka
Copy link

No description provided.

…ame alone (#3127)

* [clang][clang-scan-deps] Add an experimental C API for returning the list of
module and file dependencies of a module for a particular compiler invocation

rdar://64538073

* Address review comments

- Define a subclass of FrontendAction and call loadModule there.
- Remove the API for creating a worker just for
  clang_experimental_DependencyScannerWorkerByModName_getFileDependencies_v1.
- Add the capability to get the dependencies based on the module name to
  clang-scan-deps.

* Address review comments

- Create a fake virtual source file instead of asking users to create
  one and pass it to the command line.
- Remove the "translation-units" output from test case
  modules-full-by-mod-name.cpp. The information isn't useful as the
  source file name isn't passed on the command line in this case.
- Inherit from `PreprocessOnlyAction`.

* Address review comments

* Address review comments

- Rebase.
- Rename functions.
- Remove unneeded test cases.

* Address review comments

- Remove member `ModuleName` and thread it through functions. Remove
  member `FakeMemBuffer` too and make it a variable inside
  `computeDependencies`.
- Use `MemoryBufferRef` instead of `MemoryBuffer *`.
- Use `StringRef` instead of `const char *`.

* Address review comments

- Use Optional<String> as the type of ModuleName.
- Add comments explaining what happens if the passed ModuleName isn't
  empty.

(cherry picked from commit 2a3e8df)

Conflicts:
	clang/tools/libclang/libclang.map
@ahatanaka ahatanaka merged commit 3b3799f into stable/20210726 Sep 7, 2021
@ahatanaka ahatanaka deleted the PR-64538073-20210726 branch September 7, 2021 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant