summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-07-01 01:07:12 +0000
committerEric Christopher <echristo@gmail.com>2015-07-01 01:07:12 +0000
commitad55a96ee4a670e9fce438e40d701bb5740aaf39 (patch)
tree8f4ba23fab6f5ba8eada966ba5482cd5c01b52a6 /lib/CodeGen/CGCall.cpp
parent64d489d083d8f27d2cff3546c99b30a61aeb84aa (diff)
Use a stable sort to guarantee target feature ordering in the IR
in order to make testing somewhat more feasible. Has the advantage of making it easier to find target features as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 245b8274a9..fd20bf15e0 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1544,6 +1544,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
if (TargetCPU != "")
FuncAttrs.addAttribute("target-cpu", TargetCPU);
if (!Features.empty()) {
+ std::stable_sort(Features.begin(), Features.end());
std::stringstream TargetFeatures;
std::copy(Features.begin(), Features.end(),
std::ostream_iterator<std::string>(TargetFeatures, ","));