Skip to content
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

[Minor] Fix compilation warnings for clang #15940

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/target/llvm/llvm_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
#include <utility>

#if TVM_LLVM_VERSION < 180
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreturn-stack-address"
#endif
namespace llvm {
#if TVM_LLVM_VERSION < 170
// SubtargetSubTypeKV view
Expand All @@ -86,6 +90,9 @@ struct FeatViewer {
template struct FeatViewer<&MCSubtargetInfo::ProcFeatures>;
ArrayRef<SubtargetFeatureKV>& featViewer(MCSubtargetInfo);
} // namespace llvm
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif

namespace tvm {
Expand Down Expand Up @@ -809,7 +816,7 @@ const Array<String> LLVMTargetInfo::GetAllLLVMTargetArches() const {
// get all arches
llvm::ArrayRef<llvm::SubtargetSubTypeKV> llvm_arches =
#if TVM_LLVM_VERSION < 170
llvm::archViewer(*(llvm::MCSubtargetInfo*)MCInfo);
llvm::archViewer(*(const llvm::MCSubtargetInfo*)MCInfo);
#else
MCInfo->getAllProcessorDescriptions();
#endif
Expand All @@ -830,7 +837,7 @@ const Array<String> LLVMTargetInfo::GetAllLLVMCpuFeatures() const {
// get all features for CPU
llvm::ArrayRef<llvm::SubtargetFeatureKV> llvm_features =
#if TVM_LLVM_VERSION < 180
llvm::featViewer(*(llvm::MCSubtargetInfo*)MCInfo);
llvm::featViewer(*(const llvm::MCSubtargetInfo*)MCInfo);
#else
MCInfo->getAllProcessorFeatures();
#endif
Expand Down
Loading