[LLVMdev] Target data question
Kenneth Uildriks
kennethuil at gmail.com
Wed Oct 21 08:59:57 PDT 2009
If the TargetData pass isn't registered in the global registry,
getPassInfo() returns null.
Now when you add a TargetData pass, it winds up in ImmutablePasses.
Any search through ImmutablePasses assumes that getPassInfo() for
every member returns something other than null. So findAnalysisPass
for *any* analysis pass can crash the system if the TargetData pass is
lurking in the list without being registered.
Since we want to be able to run opt without a TargetData pass, this
will never do. If TargetData is registered globally, any
findAnalysisPass call will find it if there isn't another TargetData
pass in the PassManager. Should TargetData now not be considered an
ImmutablePass? Should findAnalysisPass include a null check on the
getPassInfo of ImmutablePasses?
More information about the llvm-dev
mailing list