summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-10 20:44:09 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-10 20:44:09 +0000
commit2d0746fb97fee01608e3dce95dd95520aaa953d2 (patch)
treed3cf2a4692b6708513720035c8e94218992d1172 /clang/lib/CodeGen/CodeGenFunction.cpp
parent4e7ae06b00b11a2d8b2d6c7d5ec1f396757560fb (diff)
downloadbcm5719-llvm-2d0746fb97fee01608e3dce95dd95520aaa953d2.tar.gz
bcm5719-llvm-2d0746fb97fee01608e3dce95dd95520aaa953d2.zip
Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
llvm-svn: 64235
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 827ad6cc97a..b46d24a2fcb 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -429,41 +429,6 @@ void CodeGenFunction::EmitIndirectSwitches() {
}
}
-llvm::Value *CodeGenFunction::EmitVAArg(llvm::Value *VAListAddr, QualType Ty)
-{
- // FIXME: This entire method is hardcoded for 32-bit X86.
-
- const char *TargetPrefix = getContext().Target.getTargetPrefix();
-
- if (strcmp(TargetPrefix, "x86") != 0 ||
- getContext().Target.getPointerWidth(0) != 32)
- return 0;
-
- const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
- const llvm::Type *BPP = llvm::PointerType::getUnqual(BP);
-
- llvm::Value *VAListAddrAsBPP = Builder.CreateBitCast(VAListAddr, BPP,
- "ap");
- llvm::Value *Addr = Builder.CreateLoad(VAListAddrAsBPP, "ap.cur");
- llvm::Value *AddrTyped =
- Builder.CreateBitCast(Addr,
- llvm::PointerType::getUnqual(ConvertType(Ty)));
-
- uint64_t SizeInBytes = getContext().getTypeSize(Ty) / 8;
- const unsigned ArgumentSizeInBytes = 4;
- if (SizeInBytes < ArgumentSizeInBytes)
- SizeInBytes = ArgumentSizeInBytes;
-
- llvm::Value *NextAddr =
- Builder.CreateGEP(Addr,
- llvm::ConstantInt::get(llvm::Type::Int32Ty, SizeInBytes),
- "ap.next");
- Builder.CreateStore(NextAddr, VAListAddrAsBPP);
-
- return AddrTyped;
-}
-
-
llvm::Value *CodeGenFunction::GetVLASize(const VariableArrayType *VAT)
{
llvm::Value *&SizeEntry = VLASizeMap[VAT];
OpenPOWER on IntegriCloud