From 17a9cff55c43e85dcc118c51ca80b9729d8a2c1f Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Wed, 10 Sep 2014 18:00:17 +0000 Subject: Make CallingConv::ID an alias of "unsigned". Summary: Make CallingConv::ID a plain unsigned instead of enum with a fixed set of valus. LLVM IR allows arbitraty calling conventions (you are free to write cc12345), and loading them as enum is an undefined behavior. This was reported by UBSan. Test Plan: llvm regression test suite Reviewers: nicholas Reviewed By: nicholas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5248 llvm-svn: 217529 --- llvm/lib/AsmParser/LLParser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/AsmParser/LLParser.h') diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index b7d8f21442b..aa62bcc8daf 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -226,7 +226,7 @@ namespace llvm { } bool ParseOptionalVisibility(unsigned &Visibility); bool ParseOptionalDLLStorageClass(unsigned &DLLStorageClass); - bool ParseOptionalCallingConv(CallingConv::ID &CC); + bool ParseOptionalCallingConv(unsigned &CC); bool ParseOptionalAlignment(unsigned &Alignment); bool ParseOptionalDereferenceableBytes(uint64_t &Bytes); bool ParseScopeAndOrdering(bool isAtomic, SynchronizationScope &Scope, -- cgit v1.2.3