mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 16:50:58 +00:00 
			
		
		
		
	cmd/internal/obj: make Dconv a portable top-level function
Each architecture had its own Dconv (operand printer) but the syntax is
close to uniform and the code overlap was considerable. Consolidate these
into a single top-level function. A similar but smaller unification is done
for Mconv ("Name" formatter) as well.
The signature is changed. The flag was unused so drop it. Add a
function argument, Rconv, that must be supplied by the caller.
TODO: A future change will unify Rconv as well and this argument
will go away.
Some formats changed, because of the automatic consistency
created by unification. For instance, 0(R1) always prints as (R1)
now, and foo+0(SB) is just foo(SB). Before, some made these
simplifications and some didn't; now they all do.
Update the asm tests that depend on the format.
Change-Id: I6e3310bc19814c0c784ff0b960a154521acd9532
Reviewed-on: https://go-review.googlesource.com/5920
Reviewed-by: Russ Cox <rsc@golang.org>
			
			
This commit is contained in:
		
							parent
							
								
									77d7771a82
								
							
						
					
					
						commit
						29421cbb5b
					
				
					 21 changed files with 348 additions and 634 deletions
				
			
		|  | @ -1111,7 +1111,6 @@ loop: | |||
| } | ||||
| 
 | ||||
| var Linkamd64 = obj.LinkArch{ | ||||
| 	Dconv:      Dconv, | ||||
| 	Rconv:      Rconv, | ||||
| 	ByteOrder:  binary.LittleEndian, | ||||
| 	Pconv:      Pconv, | ||||
|  | @ -1128,7 +1127,6 @@ var Linkamd64 = obj.LinkArch{ | |||
| } | ||||
| 
 | ||||
| var Linkamd64p32 = obj.LinkArch{ | ||||
| 	Dconv:      Dconv, | ||||
| 	Rconv:      Rconv, | ||||
| 	ByteOrder:  binary.LittleEndian, | ||||
| 	Pconv:      Pconv, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Rob Pike
						Rob Pike