* Make TargetLowering not crash when TargetMachine::getTargetAsmInfo() returns

null. This assumes that any target that does not have AsmInfo, does not
   support "LocAndDot".

llvm-svn: 57438
This commit is contained in:
Matthijs Kooijman 2008-10-13 12:41:46 +00:00
parent c8d7988da8
commit 43686a6665
1 changed files with 2 additions and 1 deletions

View File

@ -473,7 +473,8 @@ TargetLowering::TargetLowering(TargetMachine &tm)
InitCmpLibcallCCs(CmpLibcallCCs); InitCmpLibcallCCs(CmpLibcallCCs);
// Tell Legalize whether the assembler supports DEBUG_LOC. // Tell Legalize whether the assembler supports DEBUG_LOC.
if (!TM.getTargetAsmInfo()->hasDotLocAndDotFile()) const TargetAsmInfo *TASM = TM.getTargetAsmInfo();
if (!TASM || !TASM->hasDotLocAndDotFile())
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
} }