From 067986e534121a0226b5580d026c7afaf5ee514d Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 24 Feb 2009 21:08:09 +0000 Subject: [PATCH] Set flag for -fobjc-gc in IMAGE_INFO variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65387 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjCMac.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index a9cb833c73..3dec1dd796 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -3428,7 +3428,11 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() { // FIXME. flags can be 0 | 1 | 2 | 6. For now just use 0 std::vector Values(2); Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, 0); - Values[1] = llvm::ConstantInt::get(ObjCTypes.IntTy, 0); + unsigned int flags = 0; + // FIXME -fobjc-gc-only flags is 6. + if (CGM.getContext().getLangOptions().getGCMode() != LangOptions::NonGC) + flags |= 2; + Values[1] = llvm::ConstantInt::get(ObjCTypes.IntTy, flags); llvm::Constant* Init = llvm::ConstantArray::get( llvm::ArrayType::get(ObjCTypes.IntTy, 2), Values);