Skip to content

LLVMTargetMachine.cpp assert not fully descriptive #11589

@llvmbot

Description

@llvmbot
Bugzilla Link 11217
Resolution FIXED
Resolved on Oct 25, 2011 15:42
Version trunk
OS Windows NT
Blocks #11571
Reporter LLVM Bugzilla Contributor

Extended Description

LLVMTargetMachine.cpp says:
// TargetSelect.h moved to a different directory between LLVM 2.9 and 3.0,
// and if the old one gets included then MCAsmInfo will be NULL and
// we'll crash later.
// Provide the user with a useful error message about what's wrong.
assert(AsmInfo && "MCAsmInfo not initialized."
"Make sure you include the correct TargetSelect.h!");

This can also occur if you fail to do llvm::InitializeAllTargetMCs(), which is new (to me anyway). Found this upgrading my code from 2.9-ish SVN to 3.0-ish SVN.

It would be good if the assert mentioned this other possibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions