From: Charlie Turner Date: Thu, 27 Nov 2014 12:13:56 +0000 (+0000) Subject: Stop uppercasing build attribute data. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d43369163182f5176ed6d9f652a227dc0d7e4ce;p=platform%2Fupstream%2Fllvm.git Stop uppercasing build attribute data. The string data for string-valued build attributes were being unconditionally uppercased. There is no mention in the ARM ABI addenda about case conventions, so it's technically implementation defined as to whether the data are capitialised in some way or not. However, there are good reasons not to captialise the data. * It's less work. * Some vendors may legitimately have case-sensitive checks for these attributes which would fail on LLVM generated object files. * There could be locale issues with uppercasing. The original reasons for uppercasing appear to have stemmed from an old codesourcery toolchain behaviour, see http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/87133 This patch makes the object file emitted no longer captialise string data, it encodes as seen in the assembly source. Change-Id: Ibe20dd6e60d2773d57ff72a78470839033aa5538 llvm-svn: 222882 --- diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp index 24ee537..e92a43c 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp @@ -979,12 +979,12 @@ void ARMTargetELFStreamer::finishAttributeSection() { Streamer.EmitULEB128IntValue(item.IntValue); break; case AttributeItem::TextAttribute: - Streamer.EmitBytes(item.StringValue.upper()); + Streamer.EmitBytes(item.StringValue); Streamer.EmitIntValue(0, 1); // '\0' break; case AttributeItem::NumericAndTextAttributes: Streamer.EmitULEB128IntValue(item.IntValue); - Streamer.EmitBytes(item.StringValue.upper()); + Streamer.EmitBytes(item.StringValue); Streamer.EmitIntValue(0, 1); // '\0' break; } diff --git a/llvm/test/CodeGen/ARM/build-attributes-encoding.s b/llvm/test/CodeGen/ARM/build-attributes-encoding.s index 34a1ad3..29f13f0 100644 --- a/llvm/test/CodeGen/ARM/build-attributes-encoding.s +++ b/llvm/test/CodeGen/ARM/build-attributes-encoding.s @@ -78,7 +78,7 @@ // CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 41460000 00616561 62690001 3C000000 -// CHECK-NEXT: 0010: 05434F52 5445582D 41380006 0A074108 +// CHECK-NEXT: 0010: 05636F72 7465782D 61380006 0A074108 // CHECK-NEXT: 0020: 0109020A 030C0214 01150117 01180119 // CHECK-NEXT: 0030: 011B001C 0124012A 012C0244 036EA001 // CHECK-NEXT: 0040: 81013100 FA0101 diff --git a/llvm/test/MC/ARM/directive-arch-iwmmxt.s b/llvm/test/MC/ARM/directive-arch-iwmmxt.s index db25ec6..c54846d 100644 --- a/llvm/test/MC/ARM/directive-arch-iwmmxt.s +++ b/llvm/test/MC/ARM/directive-arch-iwmmxt.s @@ -16,7 +16,7 @@ @ CHECK-ATTR: FileAttributes { @ CHECK-ATTR: Attribute { @ CHECK-ATTR: TagName: CPU_name -@ CHECK-ATTR: Value: IWMMXT +@ CHECK-ATTR: Value: iwmmxt @ CHECK-ATTR: } @ CHECK-ATTR: Attribute { @ CHECK-ATTR: TagName: CPU_arch diff --git a/llvm/test/MC/ARM/directive-arch-iwmmxt2.s b/llvm/test/MC/ARM/directive-arch-iwmmxt2.s index de94f97..a4e59b5 100644 --- a/llvm/test/MC/ARM/directive-arch-iwmmxt2.s +++ b/llvm/test/MC/ARM/directive-arch-iwmmxt2.s @@ -16,7 +16,7 @@ @ CHECK-ATTR: FileAttributes { @ CHECK-ATTR: Attribute { @ CHECK-ATTR: TagName: CPU_name -@ CHECK-ATTR: Value: IWMMXT2 +@ CHECK-ATTR: Value: iwmmxt2 @ CHECK-ATTR: } @ CHECK-ATTR: Attribute { @ CHECK-ATTR: TagName: CPU_arch diff --git a/llvm/test/MC/ARM/directive-cpu.s b/llvm/test/MC/ARM/directive-cpu.s index 952dd93..d81a03e 100644 --- a/llvm/test/MC/ARM/directive-cpu.s +++ b/llvm/test/MC/ARM/directive-cpu.s @@ -20,7 +20,6 @@ @ CHECK: 10000000 .cpu cortex-a8 -@ CHECK: 05 -@ CHECK: 434F52 5445582D 413800 +@ CHECK: 05636F72 7465782D 613800 @ CHECK: ) diff --git a/llvm/test/MC/ARM/directive-eabi_attribute-overwrite.s b/llvm/test/MC/ARM/directive-eabi_attribute-overwrite.s index 6fdded3..69342b2 100644 --- a/llvm/test/MC/ARM/directive-eabi_attribute-overwrite.s +++ b/llvm/test/MC/ARM/directive-eabi_attribute-overwrite.s @@ -3,13 +3,13 @@ .syntax unified .thumb - +@ FIXME: The next directive is not correct, Tag_compatibility isn't getting parsed correctly. .eabi_attribute Tag_compatibility, 1 .eabi_attribute Tag_compatibility, 1, "aeabi" @ CHECK-ATTR: FileAttributes { @ CHECK-ATTR: Attribute { -@ CHECK-ATTR: Value: 1, AEABI +@ CHECK-ATTR: Value: 1, aeabi @ CHECK-ATTR: TagName: compatibility @ CHECK-ATTR: Description: AEABI Conformant @ CHECK-ATTR: } diff --git a/llvm/test/MC/ARM/directive-eabi_attribute.s b/llvm/test/MC/ARM/directive-eabi_attribute.s index e2f1f9b..135afa7 100644 --- a/llvm/test/MC/ARM/directive-eabi_attribute.s +++ b/llvm/test/MC/ARM/directive-eabi_attribute.s @@ -9,12 +9,12 @@ @ CHECK: .eabi_attribute 4, "Cortex-A9" @ CHECK-OBJ: Tag: 4 @ CHECK-OBJ-NEXT: TagName: CPU_raw_name -@ CHECK-OBJ-NEXT: Value: CORTEX-A9 +@ CHECK-OBJ-NEXT: Value: Cortex-A9 .eabi_attribute Tag_CPU_name, "cortex-a9" @ CHECK: .cpu cortex-a9 @ CHECK-OBJ: Tag: 5 @ CHECK-OBJ-NEXT: TagName: CPU_name -@ CHECK-OBJ-NEXT: Value: CORTEX-A9 +@ CHECK-OBJ-NEXT: Value: cortex-a9 .eabi_attribute Tag_CPU_arch, 10 @ CHECK: .eabi_attribute 6, 10 @ CHECK-OBJ: Tag: 6 @@ -170,7 +170,7 @@ .eabi_attribute Tag_compatibility, 1, "aeabi" @ CHECK: .eabi_attribute 32, 1, "aeabi" @ CHECK-OBJ: Tag: 32 -@ CHECK-OBJ-NEXT: Value: 1, AEABI +@ CHECK-OBJ-NEXT: Value: 1, aeabi @ CHECK-OBJ-NEXT: TagName: compatibility @ CHECK-OBJ-NEXT: Description: AEABI Conformant .eabi_attribute Tag_CPU_unaligned_access, 0 @@ -213,7 +213,7 @@ @ CHECK: .eabi_attribute 65, "gnu" @ CHECK-OBJ: Tag: 65 @ CHECK-OBJ-NEXT: TagName: also_compatible_with -@ CHECK-OBJ-NEXT: Value: GNU +@ CHECK-OBJ-NEXT: Value: gnu .eabi_attribute Tag_T2EE_use, 0 @ CHECK: .eabi_attribute 66, 0 @ CHECK-OBJ: Tag: 66 diff --git a/llvm/test/tools/llvm-readobj/ARM/attributes.s b/llvm/test/tools/llvm-readobj/ARM/attributes.s index 594bab8..59cefad 100644 --- a/llvm/test/tools/llvm-readobj/ARM/attributes.s +++ b/llvm/test/tools/llvm-readobj/ARM/attributes.s @@ -54,12 +54,12 @@ @ CHECK: Attribute { @ CHECK: Tag: 4 @ CHECK: TagName: CPU_raw_name -@ CHECK: Value: CORTEX-A9 +@ CHECK: Value: Cortex-A9 @ CHECK: } @ CHECK: Attribute { @ CHECK: Tag: 5 @ CHECK: TagName: CPU_name -@ CHECK: Value: CORTEX-A9 +@ CHECK: Value: cortex-a9 @ CHECK: } @ CHECK: Attribute { @ CHECK: Tag: 6 @@ -219,7 +219,7 @@ @ CHECK: } @ CHECK: Attribute { @ CHECK: Tag: 32 -@ CHECK: Value: 1, AEABI +@ CHECK: Value: 1, aeabi @ CHECK: TagName: compatibility @ CHECK: Description: AEABI Conformant @ CHECK: } @@ -262,7 +262,7 @@ @ CHECK: Attribute { @ CHECK: Tag: 65 @ CHECK: TagName: also_compatible_with -@ CHECK: Value: GNU +@ CHECK: Value: gnu @ CHECK: } @ CHECK: Attribute { @ CHECK: Tag: 66