<div dir="ltr">Ping.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 19, 2013 at 2:53 AM, Logan Chien <span dir="ltr"><<a href="mailto:tzuhsiang.chien@gmail.com" target="_blank">tzuhsiang.chien@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Address the comments.<br>
<br>
Hi richard.barton.arm, rengolin,<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2424" target="_blank">http://llvm-reviews.chandlerc.com/D2424</a><br>
<br>
CHANGE SINCE LAST DIFF<br>
  <a href="http://llvm-reviews.chandlerc.com/D2424?vs=6142&id=6169#toc" target="_blank">http://llvm-reviews.chandlerc.com/D2424?vs=6142&id=6169#toc</a><br>
<div class="im"><br>
Files:<br>
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>
  test/MC/ARM/directive-eabi_attribute-str.s<br>
<br>
Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>
===================================================================<br>
--- lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>
+++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>
</div>@@ -8024,11 +8024,66 @@<br>
<div class="im"><br>
 /// parseDirectiveEabiAttr<br>
 ///  ::= .eabi_attribute int, int<br>
</div>+///  ::= .eabi_attribute Tag_name, int<br>
<div class="im"> bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) {<br>
-  if (Parser.getTok().isNot(AsmToken::Integer))<br>
-    return Error(L, "integer expected");<br>
-  int64_t Tag = Parser.getTok().getIntVal();<br>
-  Parser.Lex(); // eat tag integer<br>
+  // Parse the eabi_attribute tag<br>
+  const AsmToken &Token = Parser.getTok();<br>
+  if (Token.isNot(AsmToken::Integer) && Token.isNot(AsmToken::Identifier))<br>
+    return Error(L, "eabi_attribute tag expected");<br>
+<br>
+  int Tag = -1;<br>
+  if (Token.is(AsmToken::Integer)) {<br>
+    Tag = Parser.getTok().getIntVal();<br>
+  } else {<br>
+    Tag = StringSwitch<int>(Token.getString())<br>
+#define CASE_EABI_ATTR_TAG(NAME) .Case("Tag_" #NAME, ARMBuildAttrs::NAME)<br>
+      CASE_EABI_ATTR_TAG(CPU_raw_name)<br>
+      CASE_EABI_ATTR_TAG(CPU_name)<br>
+      CASE_EABI_ATTR_TAG(CPU_arch)<br>
+      CASE_EABI_ATTR_TAG(CPU_arch_profile)<br>
+      CASE_EABI_ATTR_TAG(ARM_ISA_use)<br>
+      CASE_EABI_ATTR_TAG(THUMB_ISA_use)<br>
</div>+      CASE_EABI_ATTR_TAG(FP_arch)<br>
<div><div class="h5">+      CASE_EABI_ATTR_TAG(WMMX_arch)<br>
+      CASE_EABI_ATTR_TAG(Advanced_SIMD_arch)<br>
+      CASE_EABI_ATTR_TAG(PCS_config)<br>
+      CASE_EABI_ATTR_TAG(ABI_PCS_R9_use)<br>
+      CASE_EABI_ATTR_TAG(ABI_PCS_RW_data)<br>
+      CASE_EABI_ATTR_TAG(ABI_PCS_RO_data)<br>
+      CASE_EABI_ATTR_TAG(ABI_PCS_GOT_use)<br>
+      CASE_EABI_ATTR_TAG(ABI_PCS_wchar_t)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_rounding)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_denormal)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_exceptions)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_user_exceptions)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_number_model)<br>
+      CASE_EABI_ATTR_TAG(ABI_align8_needed)<br>
+      CASE_EABI_ATTR_TAG(ABI_align8_preserved)<br>
+      CASE_EABI_ATTR_TAG(ABI_enum_size)<br>
+      CASE_EABI_ATTR_TAG(ABI_HardFP_use)<br>
+      CASE_EABI_ATTR_TAG(ABI_VFP_args)<br>
+      CASE_EABI_ATTR_TAG(ABI_WMMX_args)<br>
+      CASE_EABI_ATTR_TAG(ABI_optimization_goals)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_optimization_goals)<br>
+      CASE_EABI_ATTR_TAG(compatibility)<br>
+      CASE_EABI_ATTR_TAG(CPU_unaligned_access)<br>
+      CASE_EABI_ATTR_TAG(FP_HP_extension)<br>
+      CASE_EABI_ATTR_TAG(ABI_FP_16bit_format)<br>
+      CASE_EABI_ATTR_TAG(MPextension_use)<br>
+      CASE_EABI_ATTR_TAG(DIV_use)<br>
+      CASE_EABI_ATTR_TAG(nodefaults)<br>
</div></div>+      CASE_EABI_ATTR_TAG(also_compatible_with)<br>
+      CASE_EABI_ATTR_TAG(T2EE_use)<br>
+      CASE_EABI_ATTR_TAG(conformance)<br>
+      CASE_EABI_ATTR_TAG(Virtualization_use)<br>
+#undef CASE_EABI_ATTR_TAG<br>
+      .Case("Tag_VFP_arch", ARMBuildAttrs::FP_arch)<br>
<div><div class="h5">+      .Default(-1);<br>
+<br>
+    if (Tag == -1)<br>
+      return Error(L, Twine("unknown eabi_attribute tag ", Token.getString()));<br>
+  }<br>
+  Parser.Lex(); // eat tag token<br>
<br>
   if (Parser.getTok().isNot(AsmToken::Comma))<br>
     return Error(L, "comma expected");<br>
Index: test/MC/ARM/directive-eabi_attribute-str.s<br>
===================================================================<br>
--- /dev/null<br>
+++ test/MC/ARM/directive-eabi_attribute-str.s<br>
@@ -0,0 +1,86 @@<br>
+@ Check the mapping between Tag_names and build attribute number<br>
+<br>
+@ RUN: llvm-mc < %s -triple armv7-unknown-linux-gnueabi -o - | FileCheck %s<br>
+<br>
+@ FIXME: Special cases not supported by assembly parser at the moment.<br>
+@      .eabi_attribute Tag_CPU_raw_name, "cortex-a15"<br>
+@ FIXME-CHECK: .eabi_attribute 4, "cortex-a15"<br>
+@      .eabi_attribute Tag_CPU_name, "cortex-a15"<br>
+@ FIXME-CHECK: .eabi_attribute 5, "cortex-a15"<br>
+@      .eabi_attribute Tag_compatibility, 1, "aeabi"<br>
+@ FIXME-CHECK: .eabi_attribute 32, 1, "aeabi"<br>
+@      .eabi_attribute Tag_also_compatible_with, 1, ""<br>
+@ FIXME-CHECK: .eabi_attribute 65, 1, ""<br>
+@      .eabi_attribute Tag_conformance, "2.09"<br>
+@ FIXME-CHECK: .eabi_attribute 67, "2.09"<br>
+<br>
</div></div>+       .eabi_attribute Tag_CPU_arch, 10<br>
<div class="im">+@ CHECK: .eabi_attribute 6, 10<br>
</div>+       .eabi_attribute Tag_CPU_arch_profile, 65<br>
+@ CHECK: .eabi_attribute 7, 65<br>
+       .eabi_attribute Tag_ARM_ISA_use, 1<br>
+@ CHECK: .eabi_attribute 8, 1<br>
+       .eabi_attribute Tag_THUMB_ISA_use, 2<br>
+@ CHECK: .eabi_attribute 9, 2<br>
+       .eabi_attribute Tag_FP_arch, 5<br>
+@ CHECK: .eabi_attribute 10, 5<br>
+       .eabi_attribute Tag_VFP_arch, 5<br>
<div><div class="h5">+@ CHECK: .eabi_attribute 10, 5<br>
+       .eabi_attribute Tag_WMMX_arch, 1<br>
+@ CHECK: .eabi_attribute 11, 1<br>
+       .eabi_attribute Tag_Advanced_SIMD_arch, 2<br>
+@ CHECK: .eabi_attribute 12, 2<br>
+       .eabi_attribute Tag_PCS_config, 2<br>
+@ CHECK: .eabi_attribute 13, 2<br>
+       .eabi_attribute Tag_ABI_PCS_R9_use, 2<br>
+@ CHECK: .eabi_attribute 14, 2<br>
+       .eabi_attribute Tag_ABI_PCS_RW_data, 1<br>
+@ CHECK: .eabi_attribute 15, 1<br>
+       .eabi_attribute Tag_ABI_PCS_RO_data, 1<br>
+@ CHECK: .eabi_attribute 16, 1<br>
+       .eabi_attribute Tag_ABI_PCS_GOT_use, 1<br>
+@ CHECK: .eabi_attribute 17, 1<br>
+       .eabi_attribute Tag_ABI_PCS_wchar_t, 2<br>
+@ CHECK: .eabi_attribute 18, 2<br>
+       .eabi_attribute Tag_ABI_FP_rounding, 1<br>
+@ CHECK: .eabi_attribute 19, 1<br>
+       .eabi_attribute Tag_ABI_FP_denormal, 1<br>
+@ CHECK: .eabi_attribute 20, 1<br>
+       .eabi_attribute Tag_ABI_FP_exceptions, 1<br>
+@ CHECK: .eabi_attribute 21, 1<br>
+       .eabi_attribute Tag_ABI_FP_user_exceptions, 1<br>
+@ CHECK: .eabi_attribute 22, 1<br>
+       .eabi_attribute Tag_ABI_FP_number_model, 1<br>
+@ CHECK: .eabi_attribute 23, 1<br>
+       .eabi_attribute Tag_ABI_align8_needed, 1<br>
+@ CHECK: .eabi_attribute 24, 1<br>
+       .eabi_attribute Tag_ABI_align8_preserved, 1<br>
+@ CHECK: .eabi_attribute 25, 1<br>
+       .eabi_attribute Tag_ABI_enum_size, 2<br>
+@ CHECK: .eabi_attribute 26, 2<br>
+       .eabi_attribute Tag_ABI_HardFP_use, 0<br>
+@ CHECK: .eabi_attribute 27, 0<br>
</div></div>+       .eabi_attribute Tag_ABI_VFP_args, 1<br>
+@ CHECK: .eabi_attribute 28, 1<br>
+       .eabi_attribute Tag_ABI_WMMX_args, 1<br>
+@ CHECK: .eabi_attribute 29, 1<br>
+       .eabi_attribute Tag_ABI_optimization_goals, 2<br>
+@ CHECK: .eabi_attribute 30, 2<br>
+       .eabi_attribute Tag_ABI_FP_optimization_goals, 1<br>
<div class="im">+@ CHECK: .eabi_attribute 31, 1<br>
</div>+       .eabi_attribute Tag_CPU_unaligned_access, 1<br>
<div class="im">+@ CHECK: .eabi_attribute 34, 1<br>
</div>+       .eabi_attribute Tag_FP_HP_extension, 1<br>
<div class="im">+@ CHECK: .eabi_attribute 36, 1<br>
</div>+       .eabi_attribute Tag_ABI_FP_16bit_format, 1<br>
+@ CHECK: .eabi_attribute 38, 1<br>
+       .eabi_attribute Tag_MPextension_use, 1<br>
<div class="im">+@ CHECK: .eabi_attribute 42, 1<br>
</div><div class="im">+       .eabi_attribute Tag_DIV_use, 2<br>
+@ CHECK: .eabi_attribute 44, 2<br>
+       .eabi_attribute Tag_nodefaults, 0<br>
+@ CHECK: .eabi_attribute 64, 0<br>
</div>+       .eabi_attribute Tag_T2EE_use, 1<br>
+@ CHECK: .eabi_attribute 66, 1<br>
+       .eabi_attribute Tag_Virtualization_use, 2<br>
+@ CHECK: .eabi_attribute 68, 2<br>
</blockquote></div><br></div>