llvm.org GIT mirror llvm / 2ff41ce
[Bitcode] Add enums for call instruction markers and flags. NFC. This commit adds enums in LLVMBitCodes.h to improve readability and maintainability. This is a follow-up to r252368 which was discussed here: http://reviews.llvm.org/D12923 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252395 91177308-0d34-0410-b5e6-96231b3b80d8 Akira Hatanaka 4 years ago
3 changed file(s) with 19 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
332332 enum AtomicSynchScopeCodes {
333333 SYNCHSCOPE_SINGLETHREAD = 0,
334334 SYNCHSCOPE_CROSSTHREAD = 1
335 };
336
337 /// Markers and flags for call instruction.
338 enum CallMarkersFlags {
339 CALL_TAIL = 0,
340 CALL_CCONV = 1,
341 CALL_MUSTTAIL = 14,
342 CALL_EXPLICIT_TYPE = 15,
343 CALL_NOTAIL = 16
335344 };
336345
337346 // The function body block (FUNCTION_BLOCK_ID) describes function bodies. It
49454945 unsigned CCInfo = Record[OpNum++];
49464946
49474947 FunctionType *FTy = nullptr;
4948 if (CCInfo >> 15 & 1 &&
4948 if (CCInfo >> bitc::CALL_EXPLICIT_TYPE & 1 &&
49494949 !(FTy = dyn_cast(getTypeByID(Record[OpNum++]))))
49504950 return error("Explicit call type is not a function type");
49514951
49954995 OperandBundles.clear();
49964996 InstructionList.push_back(I);
49974997 cast(I)->setCallingConv(
4998 static_cast((0x7ff & CCInfo) >> 1));
4998 static_cast((0x7ff & CCInfo) >> bitc::CALL_CCONV));
49994999 CallInst::TailCallKind TCK = CallInst::TCK_None;
5000 if (CCInfo & 1)
5000 if (CCInfo & 1 << bitc::CALL_TAIL)
50015001 TCK = CallInst::TCK_Tail;
5002 if (CCInfo & (1 << 14))
5002 if (CCInfo & (1 << bitc::CALL_MUSTTAIL))
50035003 TCK = CallInst::TCK_MustTail;
5004 if (CCInfo & (1 << 16))
5004 if (CCInfo & (1 << bitc::CALL_NOTAIL))
50055005 TCK = CallInst::TCK_NoTail;
50065006 cast(I)->setTailCallKind(TCK);
50075007 cast(I)->setAttributes(PAL);
21292129 Code = bitc::FUNC_CODE_INST_CALL;
21302130
21312131 Vals.push_back(VE.getAttributeID(CI.getAttributes()));
2132 Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()) |
2133 unsigned(CI.isMustTailCall()) << 14 | 1 << 15 |
2134 unsigned(CI.isNoTailCall()) << 16);
2132 Vals.push_back(CI.getCallingConv() << bitc::CALL_CCONV |
2133 unsigned(CI.isTailCall()) << bitc::CALL_TAIL |
2134 unsigned(CI.isMustTailCall()) << bitc::CALL_MUSTTAIL |
2135 1 << bitc::CALL_EXPLICIT_TYPE |
2136 unsigned(CI.isNoTailCall()) << bitc::CALL_NOTAIL);
21352137 Vals.push_back(VE.getTypeID(FTy));
21362138 PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee
21372139