From 26015b43862599e141f205825ecd61b9c9e5c4ea Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Fri, 27 Jan 2017 18:32:40 +0000 Subject: [PATCH] [AMDGPU] Grab MCSubtargetInfo from TargetMachine instead of constructing it Differential Revision: https://reviews.llvm.org/D29224 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293318 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp index 974e79fff3d7..d1bc438a6c55 100644 --- a/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp +++ b/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp @@ -103,17 +103,12 @@ void AMDGPUAsmPrinter::EmitStartOfAsmFile(Module &M) { if (TM.getTargetTriple().getOS() != Triple::AMDHSA) return; - // Need to construct an MCSubtargetInfo here in case we have no functions - // in the module. - std::unique_ptr STI(TM.getTarget().createMCSubtargetInfo( - TM.getTargetTriple().str(), TM.getTargetCPU(), - TM.getTargetFeatureString())); - AMDGPUTargetStreamer *TS = static_cast(OutStreamer->getTargetStreamer()); TS->EmitDirectiveHSACodeObjectVersion(2, 1); + const MCSubtargetInfo *STI = TM.getMCSubtargetInfo(); AMDGPU::IsaVersion ISA = AMDGPU::getIsaVersion(STI->getFeatureBits()); TS->EmitDirectiveHSACodeObjectISA(ISA.Major, ISA.Minor, ISA.Stepping, "AMD", "AMDGPU");