aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils')
-rwxr-xr-xllvm/utils/Misc/zkill14
-rw-r--r--llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp28
-rw-r--r--llvm/utils/TableGen/Common/Types.cpp8
-rw-r--r--llvm/utils/TableGen/FastISelEmitter.cpp2
-rwxr-xr-xllvm/utils/clang-parse-diagnostics-file10
-rwxr-xr-xllvm/utils/git/code-format-helper.py2
-rw-r--r--llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn1
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/BUILD.gn1
-rw-r--r--llvm/utils/profcheck-xfail.txt8
-rwxr-xr-xllvm/utils/unicode-case-fold.py6
10 files changed, 35 insertions, 45 deletions
diff --git a/llvm/utils/Misc/zkill b/llvm/utils/Misc/zkill
index bc0bfd5..8e10144 100755
--- a/llvm/utils/Misc/zkill
+++ b/llvm/utils/Misc/zkill
@@ -14,7 +14,7 @@ def _write_message(kind, message):
file,line,_,_,_ = inspect.getframeinfo(f)
location = '%s:%d' % (os.path.basename(file), line)
- print >>sys.stderr, '%s: %s: %s' % (location, kind, message)
+ print('%s: %s: %s' % (location, kind, message), file=sys.stderr)
note = lambda message: _write_message('note', message)
warning = lambda message: _write_message('warning', message)
@@ -53,7 +53,7 @@ def extractExecutable(command):
class Struct:
def __init__(self, **kwargs):
- self.fields = kwargs.keys()
+ self.fields = list(kwargs.keys())
self.__dict__.update(kwargs)
def __repr__(self):
@@ -144,7 +144,7 @@ def main():
parser.add_option("-s", "", dest="signalName",
help="Name of the signal to use (default=%default)",
action="store", default='INT',
- choices=kSignals.keys())
+ choices=list(kSignals.keys()))
parser.add_option("-l", "", dest="listSignals",
help="List known signal names",
action="store_true", default=False)
@@ -202,18 +202,18 @@ def main():
(opts, args) = parser.parse_args()
if opts.listSignals:
- items = [(v,k) for k,v in kSignals.items()]
+ items = [(v,k) for k,v in list(kSignals.items())]
items.sort()
for i in range(0, len(items), 4):
- print '\t'.join(['%2d) SIG%s' % (k,v)
- for k,v in items[i:i+4]])
+ print('\t'.join(['%2d) SIG%s' % (k,v)
+ for k,v in items[i:i+4]]))
sys.exit(0)
# Figure out the signal to use.
signal = kSignals[opts.signalName]
signalValueName = str(signal)
if opts.verbose:
- name = dict((v,k) for k,v in kSignals.items()).get(signal,None)
+ name = dict((v,k) for k,v in list(kSignals.items())).get(signal,None)
if name:
signalValueName = name
note('using signal %d (SIG%s)' % (signal, name))
diff --git a/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
index df14c77..f795937 100644
--- a/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
@@ -68,13 +68,14 @@ static void emitRISCVExtensions(const RecordKeeper &Records, raw_ostream &OS) {
if (!Extensions.empty()) {
OS << "\nstatic constexpr ImpliedExtsEntry ImpliedExts[] = {\n";
for (const Record *Ext : Extensions) {
- auto ImpliesList = Ext->getValueAsListOfDefs("Implies");
+ std::vector<const Record *> ImpliesList =
+ Ext->getValueAsListOfDefs("Implies");
if (ImpliesList.empty())
continue;
StringRef Name = getExtensionName(Ext);
- for (auto *ImpliedExt : ImpliesList) {
+ for (const Record *ImpliedExt : ImpliesList) {
if (!ImpliedExt->isSubClassOf("RISCVExtension"))
continue;
@@ -150,11 +151,12 @@ static void emitRISCVProfiles(const RecordKeeper &Records, raw_ostream &OS) {
OS << "#ifdef GET_SUPPORTED_PROFILES\n";
OS << "#undef GET_SUPPORTED_PROFILES\n\n";
- auto Profiles = Records.getAllDerivedDefinitionsIfDefined("RISCVProfile");
+ ArrayRef<const Record *> Profiles =
+ Records.getAllDerivedDefinitionsIfDefined("RISCVProfile");
if (!Profiles.empty()) {
printProfileTable(OS, Profiles, /*Experimental=*/false);
- bool HasExperimentalProfiles = any_of(Profiles, [&](auto &Rec) {
+ bool HasExperimentalProfiles = any_of(Profiles, [&](const Record *Rec) {
return Rec->getValueAsBit("Experimental");
});
if (HasExperimentalProfiles)
@@ -173,15 +175,17 @@ static void emitRISCVProcs(const RecordKeeper &RK, raw_ostream &OS) {
// Iterate on all definition records.
for (const Record *Rec :
RK.getAllDerivedDefinitionsIfDefined("RISCVProcessorModel")) {
- const std::vector<const Record *> &Features =
+ std::vector<const Record *> Features =
Rec->getValueAsListOfDefs("Features");
- bool FastScalarUnalignedAccess = any_of(Features, [&](auto &Feature) {
- return Feature->getValueAsString("Name") == "unaligned-scalar-mem";
- });
-
- bool FastVectorUnalignedAccess = any_of(Features, [&](auto &Feature) {
- return Feature->getValueAsString("Name") == "unaligned-vector-mem";
- });
+ bool FastScalarUnalignedAccess =
+ any_of(Features, [&](const Record *Feature) {
+ return Feature->getValueAsString("Name") == "unaligned-scalar-mem";
+ });
+
+ bool FastVectorUnalignedAccess =
+ any_of(Features, [&](const Record *Feature) {
+ return Feature->getValueAsString("Name") == "unaligned-vector-mem";
+ });
OS << "PROC(" << Rec->getName() << ", {\"" << Rec->getValueAsString("Name")
<< "\"}, {\"";
diff --git a/llvm/utils/TableGen/Common/Types.cpp b/llvm/utils/TableGen/Common/Types.cpp
index 35b79b3..8e8d6f6 100644
--- a/llvm/utils/TableGen/Common/Types.cpp
+++ b/llvm/utils/TableGen/Common/Types.cpp
@@ -8,16 +8,12 @@
#include "Types.h"
-// For LLVM_ATTRIBUTE_UNUSED
-#include "llvm/Support/Compiler.h"
-
#include <cassert>
using namespace llvm;
-const char *
-llvm::getMinimalTypeForRange(uint64_t Range,
- unsigned MaxSize LLVM_ATTRIBUTE_UNUSED) {
+const char *llvm::getMinimalTypeForRange(uint64_t Range,
+ [[maybe_unused]] unsigned MaxSize) {
// TODO: The original callers only used 32 and 64 so these are the only
// values permitted. Rather than widen the supported values we should
// allow 64 for the callers that currently use 32 and remove the
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp
index dba8bde..e0be104 100644
--- a/llvm/utils/TableGen/FastISelEmitter.cpp
+++ b/llvm/utils/TableGen/FastISelEmitter.cpp
@@ -555,7 +555,7 @@ void FastISelMap::collectPatterns(const CodeGenDAGPatterns &CGP) {
raw_string_ostream SuffixOS(ManglingSuffix);
Operands.PrintManglingSuffix(SuffixOS, ImmediatePredicates, true);
if (!StringSwitch<bool>(ManglingSuffix)
- .Cases("", "r", "rr", "ri", "i", "f", true)
+ .Cases({"", "r", "rr", "ri", "i", "f"}, true)
.Default(false))
continue;
diff --git a/llvm/utils/clang-parse-diagnostics-file b/llvm/utils/clang-parse-diagnostics-file
index 1f720c3..fac5866 100755
--- a/llvm/utils/clang-parse-diagnostics-file
+++ b/llvm/utils/clang-parse-diagnostics-file
@@ -87,14 +87,14 @@ Utility for dumping Clang-style logged diagnostics.\
return
# Otherwise, print out the diagnostics.
- print
- print "**** BUILD DIAGNOSTICS ****"
+ print()
+ print("**** BUILD DIAGNOSTICS ****")
for file,selected_diags in to_report:
- print "*** %s ***" % file
+ print(("*** %s ***" % file))
for d in selected_diags:
- print " %s:%s:%s: %s: %s" % (
+ print((" %s:%s:%s: %s: %s" % (
d.get('filename'), d.get('line'), d.get('column'),
- d.get('level'), d.get('message'))
+ d.get('level'), d.get('message'))))
if __name__ == "__main__":
main()
diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py
index e9fd132..406a728 100755
--- a/llvm/utils/git/code-format-helper.py
+++ b/llvm/utils/git/code-format-helper.py
@@ -391,7 +391,7 @@ You can test this locally with the following command:
return None
# Use git to find files that have had a change in the number of undefs
- regex = "([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)"
+ regex = "([^a-zA-Z0-9#_-]undef([^a-zA-Z0-9_-]|$)|UndefValue::get)"
cmd = ["git", "diff", "-U0", "--pickaxe-regex", "-S", regex]
if args.start_rev and args.end_rev:
diff --git a/llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn
index 1449dc7..954de88 100644
--- a/llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/unittests/Basic/BUILD.gn
@@ -14,6 +14,7 @@ unittest("BasicTests") {
"DiagnosticTest.cpp",
"FileEntryTest.cpp",
"FileManagerTest.cpp",
+ "LangOptionsTest.cpp",
"LineOffsetMappingTest.cpp",
"OffloadArchTest.cpp",
"SanitizersTest.cpp",
diff --git a/llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/BUILD.gn
index 9b69a44..8438421 100644
--- a/llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/BUILD.gn
@@ -68,6 +68,7 @@ static_library("Orc") {
"SectCreate.cpp",
"SelfExecutorProcessControl.cpp",
"SimpleRemoteEPC.cpp",
+ "SimpleRemoteMemoryMapper.cpp",
"SpeculateAnalyses.cpp",
"Speculation.cpp",
"TaskDispatch.cpp",
diff --git a/llvm/utils/profcheck-xfail.txt b/llvm/utils/profcheck-xfail.txt
index a5c5426..3f8be5e 100644
--- a/llvm/utils/profcheck-xfail.txt
+++ b/llvm/utils/profcheck-xfail.txt
@@ -1310,14 +1310,6 @@ Transforms/SimpleLoopUnswitch/pr60736.ll
Transforms/SimpleLoopUnswitch/trivial-unswitch-freeze-individual-conditions.ll
Transforms/SimpleLoopUnswitch/trivial-unswitch.ll
Transforms/SimpleLoopUnswitch/trivial-unswitch-logical-and-or.ll
-Transforms/SROA/phi-gep.ll
-Transforms/SROA/scalable-vectors-with-known-vscale.ll
-Transforms/SROA/select-gep.ll
-Transforms/SROA/select-load.ll
-Transforms/SROA/slice-width.ll
-Transforms/SROA/vector-conversion.ll
-Transforms/SROA/vector-promotion-cannot-tree-structure-merge.ll
-Transforms/SROA/vector-promotion.ll
Transforms/StackProtector/cross-dso-cfi-stack-chk-fail.ll
Transforms/StructurizeCFG/AMDGPU/uniform-regions.ll
Transforms/StructurizeCFG/hoist-zerocost.ll
diff --git a/llvm/utils/unicode-case-fold.py b/llvm/utils/unicode-case-fold.py
index 9639aa0..4afb41d 100755
--- a/llvm/utils/unicode-case-fold.py
+++ b/llvm/utils/unicode-case-fold.py
@@ -21,11 +21,7 @@ from __future__ import print_function
import sys
import re
-
-try:
- from urllib.request import urlopen
-except ImportError:
- from urllib2 import urlopen
+from urllib.request import urlopen
# This variable will body of the mappings function