mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	v2: update CMakeLists.txt as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176626 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
//===-- SIMachineFunctionInfo.cpp - SI Machine Function Info -------===//
 | 
						|
//
 | 
						|
//                     The LLVM Compiler Infrastructure
 | 
						|
//
 | 
						|
// This file is distributed under the University of Illinois Open Source
 | 
						|
// License. See LICENSE.TXT for details.
 | 
						|
//
 | 
						|
/// \file
 | 
						|
//===----------------------------------------------------------------------===//
 | 
						|
 | 
						|
 | 
						|
#include "SIMachineFunctionInfo.h"
 | 
						|
#include "llvm/IR/Attributes.h"
 | 
						|
#include "llvm/IR/Function.h"
 | 
						|
 | 
						|
using namespace llvm;
 | 
						|
 | 
						|
const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
 | 
						|
 | 
						|
SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
 | 
						|
  : MachineFunctionInfo(),
 | 
						|
    ShaderType(0),
 | 
						|
    PSInputAddr(0) {
 | 
						|
 | 
						|
  AttributeSet Set = MF.getFunction()->getAttributes();
 | 
						|
  Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
 | 
						|
                                 ShaderTypeAttribute);
 | 
						|
 | 
						|
  if (A.isStringAttribute()) {
 | 
						|
    StringRef Str = A.getValueAsString();
 | 
						|
    if (Str.getAsInteger(0, ShaderType))
 | 
						|
      llvm_unreachable("Can't parse shader type!");
 | 
						|
  }
 | 
						|
}
 |