-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][YAML][IR] Output CfiFunction sorted #130379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][YAML][IR] Output CfiFunction sorted #130379
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-llvm-ir Author: Vitaly Buka (vitalybuka) ChangesWe are changing internals of Sorting by name is unnecessary but good for Full diff: https://github.com/llvm/llvm-project/pull/130379.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
index 14b8ce5df8536..adcd17783d6c0 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
@@ -9,8 +9,10 @@
#ifndef LLVM_IR_MODULESUMMARYINDEXYAML_H
#define LLVM_IR_MODULESUMMARYINDEXYAML_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/Support/YAMLTraits.h"
+#include <algorithm>
namespace llvm {
namespace yaml {
@@ -345,11 +347,13 @@ template <> struct MappingTraits<ModuleSummaryIndex> {
index.WithGlobalValueDeadStripping);
if (io.outputting()) {
- std::vector<std::string> CfiFunctionDefs(index.CfiFunctionDefs.begin(),
- index.CfiFunctionDefs.end());
+ std::vector<StringRef> CfiFunctionDefs(index.CfiFunctionDefs.begin(),
+ index.CfiFunctionDefs.end());
+ std::sort(CfiFunctionDefs.begin(), CfiFunctionDefs.end());
io.mapOptional("CfiFunctionDefs", CfiFunctionDefs);
- std::vector<std::string> CfiFunctionDecls(index.CfiFunctionDecls.begin(),
- index.CfiFunctionDecls.end());
+ std::vector<StringRef> CfiFunctionDecls(index.CfiFunctionDecls.begin(),
+ index.CfiFunctionDecls.end());
+ std::sort(CfiFunctionDecls.begin(), CfiFunctionDecls.end());
io.mapOptional("CfiFunctionDecls", CfiFunctionDecls);
} else {
std::vector<std::string> CfiFunctionDefs;
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/21492 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/168/builds/9504 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/6648 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/164/builds/7910 Here is the relevant piece of the build log for the reference
|
As-is it's NFC, as internally
CfiFunction*
are std::set<>.We are changing internals of
CfiFunctionDefs
andCfiFunctionDecls
so they will be ordered by GUID.Sorting by name is unnecessary but good for
readability and tests.