Skip to content

Fix LLVM compile warning message for deprecated-declarations #110571

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

Closed

Conversation

chenyukang
Copy link
Member

@chenyukang chenyukang commented Apr 20, 2023

llvm-wrapper is giving this kind of warning messages when x b, this PR will fix it:

warning: llvm-wrapper/PassWrapper.cpp:526:7: warning: 'any_isa<const llvm::Module *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const Module *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast
warning: /Users/yukang/rust/build/aarch64-apple-darwin/ci-llvm/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Module *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /Users/yukang/rust/build/aarch64-apple-darwin/ci-llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning:                                                  ^
warning: llvm-wrapper/PassWrapper.cpp:528:7: warning: 'any_isa<const llvm::Function *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const Function *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast

@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 20, 2023
@chenyukang chenyukang force-pushed the yukang-fix-llvm-warning branch from 14e4e6e to 59ec3ed Compare April 20, 2023 01:57
@cuviper
Copy link
Member

cuviper commented Apr 20, 2023

There is already a PR at #110523 -- let's give that author a chance to respond, but at a glance I think yours also has a problem with not choosing the right any_cast overload.

@chenyukang
Copy link
Member Author

Oh, I didn't notice it.
Will close this PR.

@chenyukang chenyukang closed this Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants