Index: include/llvm/IR/Function.h =================================================================== --- include/llvm/IR/Function.h +++ include/llvm/IR/Function.h @@ -61,10 +61,12 @@ /* * Value::SubclassData * - * bit 0 : HasLazyArguments - * bit 1 : HasPrefixData - * bit 2 : HasPrologueData - * bit 3-6: CallingConvention + * bit 0 : HasLazyArguments + * bit 1 : HasPrefixData + * bit 2 : HasPrologueData + * bit 3 : [reserved] + * bits 4-13 : CallingConvention + * bits 14-15 : [reserved] */ /// Bits from GlobalObject::GlobalObjectSubclassData. @@ -158,11 +160,12 @@ /// calling convention of this function. The enum values for the known /// calling conventions are defined in CallingConv.h. CallingConv::ID getCallingConv() const { - return static_cast(getSubclassDataFromValue() >> 3); + return static_cast((getSubclassDataFromValue() >> 4) & + 0x3ff); } void setCallingConv(CallingConv::ID CC) { - setValueSubclassData((getSubclassDataFromValue() & 7) | - (static_cast(CC) << 3)); + setValueSubclassData((getSubclassDataFromValue() & 0xc00f) | + ((static_cast(CC) & 0x3ff) << 4)); } /// @brief Return the attribute list for this Function. Index: test/Bitcode/compatibility-3.6.ll =================================================================== --- test/Bitcode/compatibility-3.6.ll +++ test/Bitcode/compatibility-3.6.ll @@ -375,8 +375,8 @@ ; CHECK: declare x86_vectorcallcc void @f.cc80() declare x86_vectorcallcc void @f.x86_vectorcallcc() ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc() -declare cc8191 void @f.cc8191() -; CHECK: declare cc8191 void @f.cc8191() +declare cc1023 void @f.cc1023() +; CHECK: declare cc1023 void @f.cc1023() ; Functions -- ret attrs (Return attributes) declare zeroext i64 @f.zeroext() Index: test/Bitcode/compatibility-3.7.ll =================================================================== --- test/Bitcode/compatibility-3.7.ll +++ test/Bitcode/compatibility-3.7.ll @@ -375,8 +375,8 @@ ; CHECK: declare x86_vectorcallcc void @f.cc80() declare x86_vectorcallcc void @f.x86_vectorcallcc() ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc() -declare cc8191 void @f.cc8191() -; CHECK: declare cc8191 void @f.cc8191() +declare cc1023 void @f.cc1023() +; CHECK: declare cc1023 void @f.cc1023() ; Functions -- ret attrs (Return attributes) declare zeroext i64 @f.zeroext() Index: test/Bitcode/compatibility.ll =================================================================== --- test/Bitcode/compatibility.ll +++ test/Bitcode/compatibility.ll @@ -377,8 +377,8 @@ ; CHECK: declare x86_vectorcallcc void @f.cc80() declare x86_vectorcallcc void @f.x86_vectorcallcc() ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc() -declare cc8191 void @f.cc8191() -; CHECK: declare cc8191 void @f.cc8191() +declare cc1023 void @f.cc1023() +; CHECK: declare cc1023 void @f.cc1023() ; Functions -- ret attrs (Return attributes) declare zeroext i64 @f.zeroext() Index: test/Bitcode/tailcall.ll =================================================================== --- test/Bitcode/tailcall.ll +++ test/Bitcode/tailcall.ll @@ -3,16 +3,16 @@ ; Check that musttail and tail roundtrip. -declare cc8191 void @t1_callee() -define cc8191 void @t1() { -; CHECK: tail call cc8191 void @t1_callee() - tail call cc8191 void @t1_callee() +declare cc1023 void @t1_callee() +define cc1023 void @t1() { +; CHECK: tail call cc1023 void @t1_callee() + tail call cc1023 void @t1_callee() ret void } -declare cc8191 void @t2_callee() -define cc8191 void @t2() { -; CHECK: musttail call cc8191 void @t2_callee() - musttail call cc8191 void @t2_callee() +declare cc1023 void @t2_callee() +define cc1023 void @t2() { +; CHECK: musttail call cc1023 void @t2_callee() + musttail call cc1023 void @t2_callee() ret void }