diff options
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 43a25838369..4a66c26d623 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -13,6 +13,8 @@ //===----------------------------------------------------------------------===// #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" @@ -119,6 +121,18 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen) { return LLVMGetMDKindIDInContext(LLVMGetGlobalContext(), Name, SLen); } +#define GET_ATTR_KIND_FROM_NAME +#include "AttributesCompatFunc.inc" + +unsigned LLVMGetAttrKindID(const char *Name, size_t SLen) { + auto K = getAttrKindFromName(StringRef(Name, SLen)); + if (K == Attribute::None) { + return 0; + } + + return AttributeImpl::getAttrMask(K); +} + char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI) { std::string MsgStorage; raw_string_ostream Stream(MsgStorage); |