mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	[objdump] Moving PrintImmHex out of MachODump and in to llvm-objdump and setting instprinter appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		
							
								
								
									
										10
									
								
								test/MC/X86/hex-immediates.s
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								test/MC/X86/hex-immediates.s
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | # RUN: llvm-mc -filetype=obj %s -triple=x86_64-apple-darwin9 | llvm-objdump -d --print-imm-hex - | FileCheck %s | ||||||
|  |  | ||||||
|  | # CHECK: movabsq	$0x7fffffffffffffff, %rcx | ||||||
|  | movabsq	$0x7fffffffffffffff, %rcx | ||||||
|  | # CHECK: leaq	0x3e2(%rip), %rdi | ||||||
|  | leaq	0x3e2(%rip), %rdi | ||||||
|  | # CHECK: subq	$0x40, %rsp | ||||||
|  | subq	$0x40, %rsp | ||||||
|  | # CHECK: leal	(,%r14,4), %eax | ||||||
|  | leal	(,%r14,4), %eax | ||||||
| @@ -67,10 +67,6 @@ static cl::opt<bool> FullLeadingAddr("full-leading-addr", | |||||||
| static cl::opt<bool> NoLeadingAddr("no-leading-addr", | static cl::opt<bool> NoLeadingAddr("no-leading-addr", | ||||||
|                                    cl::desc("Print no leading address")); |                                    cl::desc("Print no leading address")); | ||||||
|  |  | ||||||
| static cl::opt<bool> |  | ||||||
|     PrintImmHex("print-imm-hex", |  | ||||||
|                 cl::desc("Use hex format for immediate values")); |  | ||||||
|  |  | ||||||
| cl::opt<bool> llvm::UniversalHeaders("universal-headers", | cl::opt<bool> llvm::UniversalHeaders("universal-headers", | ||||||
|                                      cl::desc("Print Mach-O universal headers " |                                      cl::desc("Print Mach-O universal headers " | ||||||
|                                               "(requires -macho)")); |                                               "(requires -macho)")); | ||||||
|   | |||||||
| @@ -149,6 +149,10 @@ static cl::alias | |||||||
| PrivateHeadersShort("p", cl::desc("Alias for --private-headers"), | PrivateHeadersShort("p", cl::desc("Alias for --private-headers"), | ||||||
|                     cl::aliasopt(PrivateHeaders)); |                     cl::aliasopt(PrivateHeaders)); | ||||||
|  |  | ||||||
|  | cl::opt<bool> | ||||||
|  |     llvm::PrintImmHex("print-imm-hex", | ||||||
|  |                       cl::desc("Use hex format for immediate values")); | ||||||
|  |  | ||||||
| static StringRef ToolName; | static StringRef ToolName; | ||||||
| static int ReturnValue = EXIT_SUCCESS; | static int ReturnValue = EXIT_SUCCESS; | ||||||
|  |  | ||||||
| @@ -743,6 +747,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { | |||||||
|       << '\n'; |       << '\n'; | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |   IP->setPrintImmHex(PrintImmHex); | ||||||
|   PrettyPrinter &PIP = selectPrettyPrinter(Triple(TripleName)); |   PrettyPrinter &PIP = selectPrettyPrinter(Triple(TripleName)); | ||||||
|  |  | ||||||
|   StringRef Fmt = Obj->getBytesInAddress() > 4 ? "\t\t%016" PRIx64 ":  " : |   StringRef Fmt = Obj->getBytesInAddress() > 4 ? "\t\t%016" PRIx64 ":  " : | ||||||
|   | |||||||
| @@ -51,6 +51,7 @@ extern cl::opt<bool> SectionHeaders; | |||||||
| extern cl::opt<bool> SectionContents; | extern cl::opt<bool> SectionContents; | ||||||
| extern cl::opt<bool> SymbolTable; | extern cl::opt<bool> SymbolTable; | ||||||
| extern cl::opt<bool> UnwindInfo; | extern cl::opt<bool> UnwindInfo; | ||||||
|  | extern cl::opt<bool> PrintImmHex; | ||||||
|  |  | ||||||
| // Various helper functions. | // Various helper functions. | ||||||
| bool error(std::error_code ec); | bool error(std::error_code ec); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user