mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	R600: Fix up for AsmPrinter's OutStreamer being a unique_ptr
Fixes a crash with basically any OpenGL application using the radeonsi driver. Patch by: Michel Dänzer Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90176 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -132,8 +132,9 @@ void AMDGPUAsmPrinter::EmitInstruction(const MachineInstr *MI) {
 | 
				
			|||||||
      SmallVector<char, 16> CodeBytes;
 | 
					      SmallVector<char, 16> CodeBytes;
 | 
				
			||||||
      raw_svector_ostream CodeStream(CodeBytes);
 | 
					      raw_svector_ostream CodeStream(CodeBytes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      MCObjectStreamer &ObjStreamer = (MCObjectStreamer &)OutStreamer;
 | 
					      MCObjectStreamer *ObjStreamer =
 | 
				
			||||||
      MCCodeEmitter &InstEmitter = ObjStreamer.getAssembler().getEmitter();
 | 
					          static_cast<MCObjectStreamer *>(OutStreamer.get());
 | 
				
			||||||
 | 
					      MCCodeEmitter &InstEmitter = ObjStreamer->getAssembler().getEmitter();
 | 
				
			||||||
      InstEmitter.EncodeInstruction(TmpInst, CodeStream, Fixups,
 | 
					      InstEmitter.EncodeInstruction(TmpInst, CodeStream, Fixups,
 | 
				
			||||||
                                    MF->getSubtarget<MCSubtargetInfo>());
 | 
					                                    MF->getSubtarget<MCSubtargetInfo>());
 | 
				
			||||||
      CodeStream.flush();
 | 
					      CodeStream.flush();
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								test/CodeGen/R600/debug.ll
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								test/CodeGen/R600/debug.ll
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs -mattr=dumpcode -filetype=obj | FileCheck --check-prefix=SI --check-prefix=FUNC %s
 | 
				
			||||||
 | 
					; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs -mattr=dumpcode -filetype=obj | FileCheck --check-prefix=SI --check-prefix=FUNC %s
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					; Test for a crash in the custom assembly dump code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					; SI: s_endpgm
 | 
				
			||||||
 | 
					define void @test(i32 addrspace(1)* %out) {
 | 
				
			||||||
 | 
					  store i32 0, i32 addrspace(1)* %out
 | 
				
			||||||
 | 
					  ret void
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user