diff --git a/include/llvm/IR/DIBuilder.h b/include/llvm/IR/DIBuilder.h index fc035de79bc..7c7a0ebe5d3 100644 --- a/include/llvm/IR/DIBuilder.h +++ b/include/llvm/IR/DIBuilder.h @@ -181,7 +181,9 @@ namespace llvm { DIFile *File); /// Create a single enumerator value. - DIEnumerator *createEnumerator(StringRef Name, int64_t Val, bool IsUnsigned = false); + DIEnumerator *createEnumerator(StringRef Name, APSInt Value); + DIEnumerator *createEnumerator(StringRef Name, int64_t Val, + bool IsUnsigned = false); /// Create a DWARF unspecified type. DIBasicType *createUnspecifiedType(StringRef Name); diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 1256749b749..4eddf4737b7 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -250,6 +250,11 @@ DIEnumerator *DIBuilder::createEnumerator(StringRef Name, int64_t Val, Name); } +DIEnumerator *DIBuilder::createEnumerator(StringRef Name, APSInt Value) { + assert(!Name.empty() && "Unable to create enumerator without name"); + return DIEnumerator::get(VMContext, APInt(Value), Value.isUnsigned(), Name); +} + DIBasicType *DIBuilder::createUnspecifiedType(StringRef Name) { assert(!Name.empty() && "Unable to create type without name"); return DIBasicType::get(VMContext, dwarf::DW_TAG_unspecified_type, Name);