diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h index dcacb416792..ae5711e7bde 100644 --- a/include/llvm/IR/DebugInfoMetadata.h +++ b/include/llvm/IR/DebugInfoMetadata.h @@ -1868,13 +1868,16 @@ class DILocalVariable : public DIVariable { friend class LLVMContextImpl; friend class MDNode; - unsigned Arg; - unsigned Flags; + unsigned Arg : 16; + unsigned Flags : 16; DILocalVariable(LLVMContext &C, StorageType Storage, unsigned Line, unsigned Arg, unsigned Flags, ArrayRef Ops) : DIVariable(C, DILocalVariableKind, Storage, Line, Ops), Arg(Arg), - Flags(Flags) {} + Flags(Flags) { + assert(Flags < ((1 << 16) - 1) && "DILocalVariable: Flags out of range"); + assert(Arg < ((1 << 16) - 1) && "DILocalVariable: Arg out of range"); + } ~DILocalVariable() = default; static DILocalVariable *getImpl(LLVMContext &Context, DIScope *Scope,