mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
538dfe3e23
Implement options in clang to enable recording the driver command-line in an ELF section. Implement a new special named metadata, llvm.commandline, to support frontends embedding their command-line options in IR/ASM/ELF. This differs from the GCC implementation in some key ways: * In GCC there is only one command-line possible per compilation-unit, in LLVM it mirrors llvm.ident and multiple are allowed. * In GCC individual options are separated by NULL bytes, in LLVM entire command-lines are separated by NULL bytes. The advantage of the GCC approach is to clearly delineate options in the face of embedded spaces. The advantage of the LLVM approach is to support merging multiple command-lines unambiguously, while handling embedded spaces with escaping. Differential Revision: https://reviews.llvm.org/D54487 Clang Differential Revision: https://reviews.llvm.org/D54489 llvm-svn: 349155
10 lines
418 B
LLVM
10 lines
418 B
LLVM
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
|
|
; Verify that llvm.commandline is properly structured.
|
|
; llvm.commandline takes a list of metadata entries.
|
|
; Each metadata entry can contain one string only.
|
|
|
|
!llvm.commandline = !{!0}
|
|
!0 = !{null}
|
|
; CHECK: assembly parsed, but does not verify as correct!
|
|
; CHECK-NEXT: invalid value for llvm.commandline metadata entry operand(the operand should be a string)
|