mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
Revert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute"
This reverts commit 0bcfd95c268bcb180a525e1837e84475df8acdc7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266259 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4cd20e7e7d
commit
609cf3b89c
@ -476,9 +476,6 @@ unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
|
||||
unsigned SLen);
|
||||
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
|
||||
|
||||
unsigned LLVMGetAttrKindIDInContext(LLVMContextRef C, const char *Name,
|
||||
size_t SLen);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -13,8 +13,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm-c/Core.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "AttributeImpl.h"
|
||||
#include "llvm/Bitcode/ReaderWriter.h"
|
||||
#include "llvm/IR/Attributes.h"
|
||||
#include "llvm/IR/CallSite.h"
|
||||
@ -121,16 +119,6 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen) {
|
||||
return LLVMGetMDKindIDInContext(LLVMGetGlobalContext(), Name, SLen);
|
||||
}
|
||||
|
||||
#define GET_ATTR_KIND_FROM_NAME
|
||||
#include "AttributesCompatFunc.inc"
|
||||
|
||||
unsigned LLVMGetAttrKindIDInContext(LLVMContextRef C, const char *Name,
|
||||
size_t SLen) {
|
||||
auto K = getAttrKindFromName(StringRef(Name, SLen));
|
||||
assert(K != Attribute::None && "Invalid attribute");
|
||||
return AttributeImpl::getAttrMask(K);
|
||||
}
|
||||
|
||||
char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI) {
|
||||
std::string MsgStorage;
|
||||
raw_string_ostream Stream(MsgStorage);
|
||||
|
@ -27,7 +27,6 @@ public:
|
||||
|
||||
private:
|
||||
void emitTargetIndependentEnums(raw_ostream &OS);
|
||||
void emitConversionFn(raw_ostream &OS);
|
||||
void emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr);
|
||||
|
||||
void printEnumAttrClasses(raw_ostream &OS,
|
||||
@ -53,27 +52,6 @@ void Attributes::emitTargetIndependentEnums(raw_ostream &OS) {
|
||||
OS << "#endif\n";
|
||||
}
|
||||
|
||||
void Attributes::emitConversionFn(raw_ostream &OS) {
|
||||
OS << "#ifdef GET_ATTR_KIND_FROM_NAME\n";
|
||||
OS << "#undef GET_ATTR_KIND_FROM_NAME\n";
|
||||
|
||||
std::vector<Record*> Attrs =
|
||||
Records.getAllDerivedDefinitions("EnumAttr");
|
||||
|
||||
OS << "static Attribute::AttrKind getAttrKindFromName(StringRef AttrName) {\n";
|
||||
OS << " return StringSwitch<Attribute::AttrKind>(AttrName)\n";
|
||||
|
||||
for (auto A : Attrs) {
|
||||
OS << " .Case(\"" << A->getValueAsString("AttrString");
|
||||
OS << "\", Attribute::" << A->getName() << ")\n";
|
||||
}
|
||||
|
||||
OS << " .Default(Attribute::None);\n";
|
||||
OS << "}\n\n";
|
||||
|
||||
OS << "#endif\n";
|
||||
}
|
||||
|
||||
void Attributes::emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr) {
|
||||
OS << "#ifdef GET_ATTR_COMPAT_FUNC\n";
|
||||
OS << "#undef GET_ATTR_COMPAT_FUNC\n";
|
||||
@ -166,7 +144,6 @@ void Attributes::printStrBoolAttrClasses(raw_ostream &OS,
|
||||
|
||||
void Attributes::emit(raw_ostream &OS) {
|
||||
emitTargetIndependentEnums(OS);
|
||||
emitConversionFn(OS);
|
||||
emitFnAttrCompatCheck(OS, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user