This is an archive of the discontinued LLVM Phabricator instance.

[ADT][NFC] Remove some redundant code
ClosedPublic

Authored by yuntaopan on Aug 31 2023, 8:08 PM.

Details

Summary

Some typetraits are defined twice, delete this part of the code.

Diff Detail

Event Timeline

yuntaopan created this revision.Aug 31 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2023, 8:08 PM
yuntaopan requested review of this revision.Aug 31 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2023, 8:08 PM
MaskRay requested changes to this revision.Aug 31 2023, 9:06 PM

is_one_of is used by llvm/include/llvm/Support/FormatProviders.h
are_base_of is used by llvm/include/llvm/IR/DerivedTypes.h and llvm/include/llvm/IR/Constants.h

This revision now requires changes to proceed.Aug 31 2023, 9:06 PM

@MaskRay is_one_of and are_base_of have been defined in llvm/include/llvm/ADT/STLExtras.h lines 210 to 218, so delete the duplicate code starting at line 1487

@MaskRay is_one_of and are_base_of have been defined in llvm/include/llvm/ADT/STLExtras.h lines 210 to 218, so delete the duplicate code starting at line 1487

So we have llvm::detail::are_base_of and llvm::are_base_of. The use in llvm/include/llvm/IR/DerivedTypes.h is llvm::are_base_of which you are removing?

@MaskRay is_one_of and are_base_of have been defined in llvm/include/llvm/ADT/STLExtras.h lines 210 to 218, so delete the duplicate code starting at line 1487

So we have llvm::detail::are_base_of and llvm::are_base_of. The use in llvm/include/llvm/IR/DerivedTypes.h is llvm::are_base_of which you are removing?

I didn’t find llvm::detail::are_base_of. These two parts of code are both defined in the namespace of llvm.

MaskRay accepted this revision.Sep 1 2023, 12:18 AM

Looks great! You're right. Sorry for misreading..

This revision is now accepted and ready to land.Sep 1 2023, 12:18 AM
This revision was landed with ongoing or failed builds.Sep 1 2023, 8:14 PM
This revision was automatically updated to reflect the committed changes.