This revision was automatically updated to reflect the committed changes.
Closed by commit rL330861: [TargetInfo] Sort target features before passing 
them to the backend (authored by efriedma, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D46030?vs=143821&id=143984#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46030

Files:
  cfe/trunk/lib/Basic/Targets.cpp
  cfe/trunk/test/CodeGen/arm-build-attributes.c


Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -638,6 +638,9 @@
   Opts->Features.clear();
   for (const auto &F : Features)
     Opts->Features.push_back((F.getValue() ? "+" : "-") + F.getKey().str());
+  // Sort here, so we handle the features in a predictable order. (This matters
+  // when we're dealing with features that overlap.)
+  llvm::sort(Opts->Features.begin(), Opts->Features.end());
 
   if (!Target->handleTargetFeatures(Opts->Features, Diags))
     return nullptr;
Index: cfe/trunk/test/CodeGen/arm-build-attributes.c
===================================================================
--- cfe/trunk/test/CodeGen/arm-build-attributes.c
+++ cfe/trunk/test/CodeGen/arm-build-attributes.c
@@ -0,0 +1,4 @@
+// RUN: %clang --target=arm-none-eabi -x c - -o - -S < %s -mcpu=cortex-a5 
-mfpu=vfpv4-d16 | FileCheck %s
+// REQUIRES: arm-registered-target
+// CHECK: .fpu vfpv4-d16
+void foo() {}


Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -638,6 +638,9 @@
   Opts->Features.clear();
   for (const auto &F : Features)
     Opts->Features.push_back((F.getValue() ? "+" : "-") + F.getKey().str());
+  // Sort here, so we handle the features in a predictable order. (This matters
+  // when we're dealing with features that overlap.)
+  llvm::sort(Opts->Features.begin(), Opts->Features.end());
 
   if (!Target->handleTargetFeatures(Opts->Features, Diags))
     return nullptr;
Index: cfe/trunk/test/CodeGen/arm-build-attributes.c
===================================================================
--- cfe/trunk/test/CodeGen/arm-build-attributes.c
+++ cfe/trunk/test/CodeGen/arm-build-attributes.c
@@ -0,0 +1,4 @@
+// RUN: %clang --target=arm-none-eabi -x c - -o - -S < %s -mcpu=cortex-a5 -mfpu=vfpv4-d16 | FileCheck %s
+// REQUIRES: arm-registered-target
+// CHECK: .fpu vfpv4-d16
+void foo() {}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to