summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-17 06:40:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-17 06:40:14 +0000
commitdbe6e0f17187f02c836bbd34b8b153dd83225b59 (patch)
tree8de52267f95b8b60b0d6c02fa2bffe4979073214 /llvm/lib/Bitcode/Writer
parente6aba2806cc3380b7c2cb29aa6ceba8af4c71534 (diff)
downloadbcm5719-llvm-dbe6e0f17187f02c836bbd34b8b153dd83225b59.tar.gz
bcm5719-llvm-dbe6e0f17187f02c836bbd34b8b153dd83225b59.zip
[opaque pointer type] Explicit pointee type for call instruction
Use an extra bit in the CCInfo to flag the newer version of the instructiont hat includes the type explicitly. Tested the newer error cases I added, but didn't add tests for the finer granularity improvements to existing error paths. llvm-svn: 235160
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index aa4a6a4c28a..bfcaac11257 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1935,14 +1935,14 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
break;
case Instruction::Call: {
const CallInst &CI = cast<CallInst>(I);
- PointerType *PTy = cast<PointerType>(CI.getCalledValue()->getType());
- FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
+ FunctionType *FTy = CI.getFunctionType();
Code = bitc::FUNC_CODE_INST_CALL;
Vals.push_back(VE.getAttributeID(CI.getAttributes()));
Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()) |
- unsigned(CI.isMustTailCall()) << 14);
+ unsigned(CI.isMustTailCall()) << 14 | 1 << 15);
+ Vals.push_back(VE.getTypeID(FTy));
PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee
// Emit value #'s for the fixed parameters.
OpenPOWER on IntegriCloud