[lld] r344359 - Make YAML quote forward slashes.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 09:31:20 PDT 2018


Author: zturner
Date: Fri Oct 12 09:31:20 2018
New Revision: 344359

URL: http://llvm.org/viewvc/llvm-project?rev=344359&view=rev
Log:
Make YAML quote forward slashes.

If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer.  But a string like C:\src would
be, due to the presence of a backslash.  This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).

While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.

Differential Revision: https://reviews.llvm.org/D53169

Modified:
    lld/trunk/test/mach-o/cstring-sections.yaml
    lld/trunk/test/mach-o/parse-data-relocs-x86_64.yaml
    lld/trunk/test/mach-o/parse-data.yaml
    lld/trunk/test/mach-o/sectcreate.yaml

Modified: lld/trunk/test/mach-o/cstring-sections.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/cstring-sections.yaml?rev=344359&r1=344358&r2=344359&view=diff
==============================================================================
--- lld/trunk/test/mach-o/cstring-sections.yaml (original)
+++ lld/trunk/test/mach-o/cstring-sections.yaml Fri Oct 12 09:31:20 2018
@@ -36,25 +36,25 @@ sections:
 # CHECK:     content:         [ 61, 62, 63, 00 ]
 # CHECK:     merge:           by-content
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __TEXT/__objc_methname
+# CHECK:     section-name:    '__TEXT/__objc_methname'
 # CHECK:   - scope:           hidden
 # CHECK:     type:            c-string
 # CHECK:     content:         [ 64, 65, 66, 00 ]
 # CHECK:     merge:           by-content
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __TEXT/__objc_methname
+# CHECK:     section-name:    '__TEXT/__objc_methname'
 # CHECK:   - scope:           hidden
 # CHECK:     type:            c-string
 # CHECK:     content:         [ 61, 62, 63, 00 ]
 # CHECK:     merge:           by-content
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __TEXT/__objc_classname
+# CHECK:     section-name:    '__TEXT/__objc_classname'
 # CHECK:   - scope:           hidden
 # CHECK:     type:            c-string
 # CHECK:     content:         [ 67, 68, 69, 00 ]
 # CHECK:     merge:           by-content
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __TEXT/__objc_classname
+# CHECK:     section-name:    '__TEXT/__objc_classname'
 # CHECK:   - scope:           hidden
 # CHECK:     type:            c-string
 # CHECK:     content:         [ 61, 62, 63, 00 ]

Modified: lld/trunk/test/mach-o/parse-data-relocs-x86_64.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/parse-data-relocs-x86_64.yaml?rev=344359&r1=344358&r2=344359&view=diff
==============================================================================
--- lld/trunk/test/mach-o/parse-data-relocs-x86_64.yaml (original)
+++ lld/trunk/test/mach-o/parse-data-relocs-x86_64.yaml Fri Oct 12 09:31:20 2018
@@ -367,6 +367,6 @@ page-size:       0x00000000
 # CHECK:    type:            unknown
 # CHECK:    content:         [ 00, 00, 00, 00, 00, 00, 00, 00 ]
 # CHECK:    section-choice:  custom-required
-# CHECK:    section-name:    __DATA/__custom
+# CHECK:    section-name:    '__DATA/__custom'
 # CHECK:    dead-strip:      never
 

Modified: lld/trunk/test/mach-o/parse-data.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/parse-data.yaml?rev=344359&r1=344358&r2=344359&view=diff
==============================================================================
--- lld/trunk/test/mach-o/parse-data.yaml (original)
+++ lld/trunk/test/mach-o/parse-data.yaml Fri Oct 12 09:31:20 2018
@@ -115,5 +115,5 @@ global-symbols:
 # CHECK:     type:            unknown
 # CHECK:     content:         [ 01, 02, 03, 04, 05, 06, 07, 08 ]
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __CUST/__custom
+# CHECK:     section-name:    '__CUST/__custom'
 

Modified: lld/trunk/test/mach-o/sectcreate.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/sectcreate.yaml?rev=344359&r1=344358&r2=344359&view=diff
==============================================================================
--- lld/trunk/test/mach-o/sectcreate.yaml (original)
+++ lld/trunk/test/mach-o/sectcreate.yaml Fri Oct 12 09:31:20 2018
@@ -8,5 +8,5 @@
 # CHECK:     type:            sectcreate
 # CHECK:     content:         [ 68, 65, 6C, 6C, 6F, 0A ]
 # CHECK:     section-choice:  custom-required
-# CHECK:     section-name:    __DATA/__data
+# CHECK:     section-name:    '__DATA/__data'
 # CHECK:     dead-strip:      never




More information about the llvm-commits mailing list