Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51,

the last commit before the upstream release/17.x branch was created.
This commit is contained in:
Dimitry Andric
2023-07-26 21:03:47 +02:00
parent e3b5578096
commit 7fa27ce4a0
6331 changed files with 408751 additions and 222714 deletions
+6 -9
View File
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <vector>
using namespace llvm;
@@ -17,7 +18,7 @@ namespace {
class Attributes {
public:
Attributes(RecordKeeper &R) : Records(R) {}
void emit(raw_ostream &OS);
void run(raw_ostream &OS);
private:
void emitTargetIndependentNames(raw_ostream &OS);
@@ -54,6 +55,7 @@ void Attributes::emitTargetIndependentNames(raw_ostream &OS) {
// Emit attribute enums in the same order llvm::Attribute::operator< expects.
Emit({"EnumAttr", "TypeAttr", "IntAttr"}, "ATTRIBUTE_ENUM");
Emit({"StrBoolAttr"}, "ATTRIBUTE_STRBOOL");
Emit({"ComplexStrAttr"}, "ATTRIBUTE_COMPLEXSTR");
OS << "#undef ATTRIBUTE_ALL\n";
OS << "#endif\n\n";
@@ -123,16 +125,11 @@ void Attributes::emitAttributeProperties(raw_ostream &OS) {
OS << "#endif\n";
}
void Attributes::emit(raw_ostream &OS) {
void Attributes::run(raw_ostream &OS) {
emitTargetIndependentNames(OS);
emitFnAttrCompatCheck(OS, false);
emitAttributeProperties(OS);
}
namespace llvm {
void EmitAttributes(RecordKeeper &RK, raw_ostream &OS) {
Attributes(RK).emit(OS);
}
} // End llvm namespace.
static TableGen::Emitter::OptClass<Attributes> X("gen-attrs",
"Generate attributes");