[AMDGPU] Null checking on TS to avoid crashing in clang tests.

- `test/Misc/backend-resource-limit-diagnostics.cl` crashes as null
  streamer is used.

llvm-svn: 364318
This commit is contained in:
Michael Liao 2019-06-25 14:06:34 +00:00
parent 34cac0955d
commit f0a665afca
1 changed files with 2 additions and 1 deletions

View File

@ -326,7 +326,8 @@ void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
EmitLinkage(GV, GVSym);
getTargetStreamer()->emitAMDGPULDS(GVSym, Size, Align);
if (auto TS = getTargetStreamer())
TS->emitAMDGPULDS(GVSym, Size, Align);
return;
}