mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-03 14:21:30 +00:00 
			
		
		
		
	This commit introduces a serializable structure called 'llvm::yaml::MachineFunction' that stores the machine function's name. This structure will mirror the machine function's state in the future. This commit prints machine functions as YAML documents containing a YAML mapping that stores the state of a machine function. This commit also parses the YAML documents that contain the machine functions. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D9841 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238519 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
//===- MIRYAMLMapping.h - Describes the mapping between MIR and YAML ------===//
 | 
						|
//
 | 
						|
//                     The LLVM Compiler Infrastructure
 | 
						|
//
 | 
						|
// This file is distributed under the University of Illinois Open Source
 | 
						|
// License. See LICENSE.TXT for details.
 | 
						|
//
 | 
						|
//===----------------------------------------------------------------------===//
 | 
						|
//
 | 
						|
// The MIR serialization library is currently a work in progress. It can't
 | 
						|
// serialize machine functions at this time.
 | 
						|
//
 | 
						|
// This file implements the mapping between various MIR data structures and
 | 
						|
// their corresponding YAML representation.
 | 
						|
//
 | 
						|
//===----------------------------------------------------------------------===//
 | 
						|
 | 
						|
#ifndef LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H
 | 
						|
#define LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H
 | 
						|
 | 
						|
#include "llvm/ADT/StringRef.h"
 | 
						|
#include "llvm/Support/YAMLTraits.h"
 | 
						|
 | 
						|
namespace llvm {
 | 
						|
namespace yaml {
 | 
						|
 | 
						|
struct MachineFunction {
 | 
						|
  StringRef Name;
 | 
						|
};
 | 
						|
 | 
						|
template <> struct MappingTraits<MachineFunction> {
 | 
						|
  static void mapping(IO &YamlIO, MachineFunction &MF) {
 | 
						|
    YamlIO.mapRequired("name", MF.Name);
 | 
						|
  }
 | 
						|
};
 | 
						|
 | 
						|
} // end namespace yaml
 | 
						|
} // end namespace llvm
 | 
						|
 | 
						|
#endif
 |