Skip to content

Type::getInt32Ty(M.getContext()) have a bug !!! #7037

Open
@xiaoxu1234

Description

@xiaoxu1234

Type *I32Ty = Type::getInt32Ty(M.getContext()); if (I32Ty->isIntegerTy()) { errs() << "xxx : I32Ty isIntegerTy\n"; } else if (I32Ty->isFunctionTy()) { errs() << "xxx : I32Ty isFunctionTy\n"; } else { errs() << "xxx : I32Ty isUnknown\n"; }

this code for I32Ty is FunctionTy, I32Ty should be isIntegerTy!!!

Reproduction steps as follows:
you can search llvm src LLVMPasses PassBuilderPipeLines.cpp, in this file has a lot of internel pass, you can find any one for module pass.

for example: Annotation2MetadataPass
PreservedAnalyses Annotation2MetadataPass::run(Module &M, ModuleAnalysisManager &AM) { Type *I32Ty = Type::getInt32Ty(M.getContext()); if (I32Ty->isIntegerTy()) { errs() << "xxx : I32Ty isIntegerTy\n"; } else if (I32Ty->isFunctionTy()) { errs() << "xxx : I32Ty isFunctionTy\n"; } else { errs() << "xxx : I32Ty isUnknown\n"; } convertAnnotation2Metadata(M); return PreservedAnalyses::all(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions