From anton at korobeynikov.info Mon Jul 28 02:45:20 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 28 Jul 2008 11:45:20 +0400 Subject: [llvm-commits] [llvm] r53309 - in /llvm/trunk/lib/Target: TargetAsmInfo.cpp X86/X86ATTAsmPrinter.cpp In-Reply-To: References: <200807091324.m69DOdAb019528@zion.cs.uiuc.edu> Message-ID: Hi, Bill > !!! Please remove this. This was added by accident, but it seem Dan already removed this. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From evan.cheng at apple.com Mon Jul 28 12:59:45 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jul 2008 10:59:45 -0700 Subject: [llvm-commits] minor vector comparison patch In-Reply-To: <4751CB6D-414B-45E1-9B18-95EB8FBE1411@apple.com> References: <4751CB6D-414B-45E1-9B18-95EB8FBE1411@apple.com> Message-ID: <36B9A2C4-CE52-4363-950B-6A40BCEAFA0B@apple.com> I am not a good person to review this. FP math always confuse me. :-) Dan, can you take a look? Thanks, Evan On Jul 25, 2008, at 11:32 AM, Mon P Wang wrote: > Hi, > > Here is a minor patch to add support for some floating point > comparison cases that we missed. > > -- Mon Ping > > > Index: lib/Target/X86/X86ISelLowering.cpp > =================================================================== > --- lib/Target/X86/X86ISelLowering.cpp (revision 54030) > +++ lib/Target/X86/X86ISelLowering.cpp (working copy) > @@ -4772,6 +4772,7 @@ > > switch (SetCCOpcode) { > default: break; > + case ISD::SETOEQ: > case ISD::SETEQ: SSECC = 0; break; > case ISD::SETOGT: > case ISD::SETGT: Swap = true; // Fallthrough > @@ -4782,7 +4783,7 @@ > case ISD::SETLE: > case ISD::SETOLE: SSECC = 2; break; > case ISD::SETUO: SSECC = 3; break; > - case ISD::SETONE: > + case ISD::SETUNE: > case ISD::SETNE: SSECC = 4; break; > case ISD::SETULE: Swap = true; > case ISD::SETUGE: SSECC = 5; break; > @@ -4795,13 +4796,19 @@ > > // In the one special case we can't handle, emit two comparisons. > if (SSECC == 8) { > - SDOperand UNORD, EQ; > - > - assert(SetCCOpcode == ISD::SETUEQ && "Illegal FP comparison"); > - > - UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, > MVT::i8)); > - EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, > MVT::i8)); > - return DAG.getNode(ISD::OR, VT, UNORD, EQ); > + if (SetCCOpcode == ISD::SETUEQ) { > + SDOperand UNORD, EQ; > + UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, > MVT::i8)); > + EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, > MVT::i8)); > + return DAG.getNode(ISD::OR, VT, UNORD, EQ); > + } > + else if (SetCCOpcode == ISD::SETONE) { > + SDOperand ORD, NEQ; > + ORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(7, > MVT::i8)); > + NEQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(4, > MVT::i8)); > + return DAG.getNode(ISD::AND, VT, ORD, NEQ); > + } > + assert(0 && "Illegal FP comparison"); > } > // Handle all other FP comparisons here. > return DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(SSECC, > MVT::i8)); > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Mon Jul 28 11:01:03 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 28 Jul 2008 16:01:03 -0000 Subject: [llvm-commits] [llvm] r54132 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200807281601.m6SG1434011433@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 28 11:00:58 2008 New Revision: 54132 URL: http://llvm.org/viewvc/llvm-project?rev=54132&view=rev Log: Fix a subtle bug when removing instructions from memdep. In very specific circumstances we could end up remapping a dependee to the same instruction that we're trying to remove. Handle this properly by just falling back to a conservative solution. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=54132&r1=54131&r2=54132&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Jul 28 11:00:58 2008 @@ -528,6 +528,10 @@ // If we have dep info for rem, set them to it BasicBlock::iterator RI = depGraphEntry->second.first; RI++; + + // If RI is rem, then we use rem's immediate successor. + if (RI == (BasicBlock::iterator)rem) RI++; + newDep = RI; } else if ( (depGraphEntry->second.first == NonLocal || depGraphEntry->second.first == None ) && From resistor at mac.com Mon Jul 28 11:14:43 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 28 Jul 2008 16:14:43 -0000 Subject: [llvm-commits] [llvm] r54133 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll Message-ID: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 28 11:14:26 2008 New Revision: 54133 URL: http://llvm.org/viewvc/llvm-project?rev=54133&view=rev Log: Add support for eliminating stores that store the same value that was just loaded. This fixes PR2599. Added: llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=54133&r1=54132&r2=54133&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon Jul 28 11:14:26 2008 @@ -26,6 +26,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/Local.h" @@ -85,9 +86,11 @@ // Dependence Graph) virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.addRequired(); + AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); } @@ -172,8 +175,37 @@ // No known stores after the free last = 0; } else { - // Update our most-recent-store map. - last = cast(BBI); + StoreInst* S = cast(BBI); + + // If we're storing the same value back to a pointer that we just + // loaded from, then the store can be removed; + if (LoadInst* L = dyn_cast(S->getOperand(0))) { + Instruction* dep = MD.getDependency(S); + DominatorTree& DT = getAnalysis(); + + if (S->getParent() == L->getParent() && + S->getPointerOperand() == L->getPointerOperand() && + ( dep == MemoryDependenceAnalysis::None || + dep == MemoryDependenceAnalysis::NonLocal || + DT.dominates(dep, L))) { + if (Instruction* D = dyn_cast(S->getOperand(0))) + possiblyDead.insert(D); + if (Instruction* D = dyn_cast(S->getOperand(1))) + possiblyDead.insert(D); + + // Avoid iterator invalidation. + BBI--; + + MD.removeInstruction(S); + S->eraseFromParent(); + NumFastStores++; + MadeChange = true; + } else + // Update our most-recent-store map. + last = S; + } else + // Update our most-recent-store map. + last = S; } } @@ -287,6 +319,7 @@ possiblyDead.insert(D); BBI++; + MD.removeInstruction(S); S->eraseFromParent(); NumFastStores++; MadeChange = true; Added: llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll?rev=54133&view=auto ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll (added) +++ llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll Mon Jul 28 11:14:26 2008 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep tmp5 +; PR2599 + +define void @foo({ i32, i32 }* %x) nounwind { +entry: + %tmp4 = getelementptr { i32, i32 }* %x, i32 0, i32 0 ; [#uses=2] + %tmp5 = load i32* %tmp4, align 4 ; [#uses=1] + %tmp7 = getelementptr { i32, i32 }* %x, i32 0, i32 1 ; [#uses=2] + %tmp8 = load i32* %tmp7, align 4 ; [#uses=1] + %tmp17 = sub i32 0, %tmp8 ; [#uses=1] + store i32 %tmp5, i32* %tmp4, align 4 + store i32 %tmp17, i32* %tmp7, align 4 + ret void +} From natebegeman at mac.com Mon Jul 28 13:06:07 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 28 Jul 2008 11:06:07 -0700 Subject: [llvm-commits] minor vector comparison patch In-Reply-To: <36B9A2C4-CE52-4363-950B-6A40BCEAFA0B@apple.com> References: <4751CB6D-414B-45E1-9B18-95EB8FBE1411@apple.com> <36B9A2C4-CE52-4363-950B-6A40BCEAFA0B@apple.com> Message-ID: <9188FB30-8AE7-468B-8D06-28C2150E16A2@mac.com> I reviewed it and checked it in. On Jul 28, 2008, at 10:59 AM, Evan Cheng wrote: > I am not a good person to review this. FP math always confuse me. :-) > Dan, can you take a look? > > Thanks, > > Evan > > On Jul 25, 2008, at 11:32 AM, Mon P Wang wrote: > >> Hi, >> >> Here is a minor patch to add support for some floating point >> comparison cases that we missed. >> >> -- Mon Ping >> >> >> Index: lib/Target/X86/X86ISelLowering.cpp >> =================================================================== >> --- lib/Target/X86/X86ISelLowering.cpp (revision 54030) >> +++ lib/Target/X86/X86ISelLowering.cpp (working copy) >> @@ -4772,6 +4772,7 @@ >> >> switch (SetCCOpcode) { >> default: break; >> + case ISD::SETOEQ: >> case ISD::SETEQ: SSECC = 0; break; >> case ISD::SETOGT: >> case ISD::SETGT: Swap = true; // Fallthrough >> @@ -4782,7 +4783,7 @@ >> case ISD::SETLE: >> case ISD::SETOLE: SSECC = 2; break; >> case ISD::SETUO: SSECC = 3; break; >> - case ISD::SETONE: >> + case ISD::SETUNE: >> case ISD::SETNE: SSECC = 4; break; >> case ISD::SETULE: Swap = true; >> case ISD::SETUGE: SSECC = 5; break; >> @@ -4795,13 +4796,19 @@ >> >> // In the one special case we can't handle, emit two comparisons. >> if (SSECC == 8) { >> - SDOperand UNORD, EQ; >> - >> - assert(SetCCOpcode == ISD::SETUEQ && "Illegal FP comparison"); >> - >> - UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, >> MVT::i8)); >> - EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, >> MVT::i8)); >> - return DAG.getNode(ISD::OR, VT, UNORD, EQ); >> + if (SetCCOpcode == ISD::SETUEQ) { >> + SDOperand UNORD, EQ; >> + UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, >> MVT::i8)); >> + EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, >> MVT::i8)); >> + return DAG.getNode(ISD::OR, VT, UNORD, EQ); >> + } >> + else if (SetCCOpcode == ISD::SETONE) { >> + SDOperand ORD, NEQ; >> + ORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(7, >> MVT::i8)); >> + NEQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(4, >> MVT::i8)); >> + return DAG.getNode(ISD::AND, VT, ORD, NEQ); >> + } >> + assert(0 && "Illegal FP comparison"); >> } >> // Handle all other FP comparisons here. >> return DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(SSECC, >> MVT::i8)); >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Jul 28 13:06:33 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 11:06:33 -0700 Subject: [llvm-commits] Intrinsic address space patch In-Reply-To: <94C73779-F283-497B-8693-A941EDA70238@apple.com> References: <51805.76.220.41.203.1216827883.squirrel@webmail.apple.com> <261636C4-D514-4CE7-8EB7-360A7EA4454E@apple.com> <94C73779-F283-497B-8693-A941EDA70238@apple.com> Message-ID: <443EBAA5-D8DA-4894-8D24-64EB9593CAB1@apple.com> Hi Mon Ping, Looks good; I like the iPTRAny idea. Comments below. > // Print function. > std::string OpVTStr; > - if (OpVT == MVT::iPTR) { > + if (OpVT == MVT::iPTR || OpVT == MVT::iPTRAny) { > OpVTStr = "_iPTR"; It probably doesn't break anything, but it seems a little confusing to have iPTRAny rendered as iPTR here. Could this print iPTRAny separately? > @@ -495,7 +496,8 @@ > setTypes(ExtVTs); > return true; > } > - if (getExtTypeNum(0) == EMVT::isInt && ExtVTs[0] == MVT::iPTR) { > + if (getExtTypeNum(0) == EMVT::isInt && > + (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTR)) { Looks like the second iPTR here should be iPTRAny. > @@ -527,6 +529,7 @@ > case EMVT::isFP : OS << ":isFP"; break; > case EMVT::isUnknown: ; /*OS << ":?";*/ break; > case MVT::iPTR: OS << ":iPTR"; break; > + case MVT::iPTRAny: OS << ":iPTR"; break; As above, can iPTRAny be rendered as "iPTRAny"? > + } > + } else if (VT == MVT::iPTRAny) { > + // Outside of TableGen, we don't distinguish iPTRAny (to any address > + // space) and iPTR. In the verifier, we can not distinguish which case > + // we have so allow either case to be legal. > + if (const PointerType* PTyp = dyn_cast(Ty)) { > + Suffix += ".p" + utostr(PTyp->getAddressSpace()) + > + MVT::getMVT(PTyp->getElementType()).getMVTString(); > + } > + else { Put the else on the same line with the } please :-). Thanks, Dan On Jul 25, 2008, at 3:51 PM, Mon P Wang wrote: > Hi, > > Here is an updated patch for intrinsic address space. The effects > are the same. The main difference between this patch and the other > one is that instead of assuming a pointer may or may not be > overloaded, I have introduced a new type iPTRAny which indicates > that the pointer can be overloaded based on an address spaces. > This would allow us to overload intrinsics based only on a pointer. > The iPTRAny should only be used in TableGen (and part of the > Verifier) and has the same semantics of iPTR except for the > overloading. Please let me know if you have any comments. > > -- Mon Ping > > > > > > > On Thu, July 17, 2008 3:56 pm, Mon P Wang wrote: >> >> Here is a patch to enable intrinsic to have pointers to different >> address spaces. This changes overloaded intrinsics with pointer >> arguments to pass also an address space as part of their name. >> For example, atomic.load.add.i32 => atomic.load.add.i32.p0i32 >> >> The above syntax indicates that the result is i32 with a pointer >> argument to address space 0 (generic address space) whose domain type >> is i32. The patch here doesn't include the documentation change but >> that will be included as part of the checkin. Let me know if you >> have >> any comments. >> >> -- Mon Ping > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Mon Jul 28 13:19:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jul 2008 11:19:10 -0700 Subject: [llvm-commits] [llvm] r53309 - in /llvm/trunk/lib/Target: TargetAsmInfo.cpp X86/X86ATTAsmPrinter.cpp In-Reply-To: References: <200807091324.m69DOdAb019528@zion.cs.uiuc.edu> Message-ID: <16e5fdf90807281119k37e512cxc013887bc8d1a4f6@mail.gmail.com> On Mon, Jul 28, 2008 at 12:45 AM, Anton Korobeynikov wrote: > Hi, Bill > >> !!! Please remove this. > This was added by accident, but it seem Dan already removed this. > I noticed it was removed after I sent this email. Sorry for the noise. :-) -bw From gohman at apple.com Mon Jul 28 13:41:04 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 18:41:04 -0000 Subject: [llvm-commits] [llvm] r54134 - /llvm/trunk/test/TestRunner.sh Message-ID: <200807281841.m6SIf4uX016928@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 13:41:03 2008 New Revision: 54134 URL: http://llvm.org/viewvc/llvm-project?rev=54134&view=rev Log: Fix a bashism in TestRunner.sh. Modified: llvm/trunk/test/TestRunner.sh Modified: llvm/trunk/test/TestRunner.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TestRunner.sh?rev=54134&r1=54133&r2=54134&view=diff ============================================================================== Binary files - no diff available. From gohman at apple.com Mon Jul 28 13:42:58 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 18:42:58 -0000 Subject: [llvm-commits] [llvm] r54135 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200807281842.m6SIgwmu017014@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 13:42:57 2008 New Revision: 54135 URL: http://llvm.org/viewvc/llvm-project?rev=54135&view=rev Log: Reword a comment to be less ambiguous. Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=54135&r1=54134&r2=54135&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Jul 28 13:42:57 2008 @@ -227,7 +227,7 @@ /// findLiveInMBBs - Given a live range, if the value of the range /// is live in any MBB returns true as well as the list of basic blocks - /// where the value is live in. + /// in which the value is live. bool findLiveInMBBs(const LiveRange &LR, SmallVectorImpl &MBBs) const; From dpatel at apple.com Mon Jul 28 13:43:10 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 28 Jul 2008 11:43:10 -0700 Subject: [llvm-commits] [llvm] r54133 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll In-Reply-To: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> References: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> Message-ID: <83DB401D-ED41-4432-9EB7-E8F7DC75405E@apple.com> On Jul 28, 2008, at 9:14 AM, Owen Anderson wrote: > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > AU.setPreservesCFG(); > + AU.addRequired(); > AU.addRequired(); > AU.addRequired(); > AU.addRequired(); > + AU.addPreserved(); If a pass preserves CFG then it implicitly preserves DominatorTree because DominatorTree is registered as CFG pass. - Devang From gohman at apple.com Mon Jul 28 13:43:52 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 18:43:52 -0000 Subject: [llvm-commits] [llvm] r54136 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200807281843.m6SIhqYP017058@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 13:43:51 2008 New Revision: 54136 URL: http://llvm.org/viewvc/llvm-project?rev=54136&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54136&r1=54135&r2=54136&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Jul 28 13:43:51 2008 @@ -816,7 +816,7 @@ if (!EnableAggressiveRemat) return false; - // If the instruction access memory but the memoperands have been lost, + // If the instruction accesses memory but the memoperands have been lost, // we can't analyze it. const TargetInstrDesc &TID = MI->getDesc(); if ((TID.mayLoad() || TID.mayStore()) && MI->memoperands_empty()) From isanbard at gmail.com Mon Jul 28 13:45:37 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jul 2008 18:45:37 -0000 Subject: [llvm-commits] [llvm] r54137 - /llvm/trunk/utils/buildit/build_llvm Message-ID: <200807281845.m6SIjbLH017123@zion.cs.uiuc.edu> Author: void Date: Mon Jul 28 13:45:36 2008 New Revision: 54137 URL: http://llvm.org/viewvc/llvm-project?rev=54137&view=rev Log: Don't build with 4.0. Modified: llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=54137&r1=54136&r2=54137&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Mon Jul 28 13:45:36 2008 @@ -138,8 +138,7 @@ make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \ LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \ LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \ - CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \ - CC=/usr/bin/gcc-4.0 CXX=/usr/bin/g++-4.0 + CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" if ! test $? == 0 ; then echo "error: LLVM 'make' failed!" From wangmp at apple.com Mon Jul 28 13:54:30 2008 From: wangmp at apple.com (Mon P Wang) Date: Mon, 28 Jul 2008 11:54:30 -0700 Subject: [llvm-commits] Intrinsic address space patch In-Reply-To: <443EBAA5-D8DA-4894-8D24-64EB9593CAB1@apple.com> References: <51805.76.220.41.203.1216827883.squirrel@webmail.apple.com> <261636C4-D514-4CE7-8EB7-360A7EA4454E@apple.com> <94C73779-F283-497B-8693-A941EDA70238@apple.com> <443EBAA5-D8DA-4894-8D24-64EB9593CAB1@apple.com> Message-ID: Thanks Dan. I'll make those changes and revalidate. -- Mon Ping On Jul 28, 2008, at 11:06 AM, Dan Gohman wrote: > Hi Mon Ping, > > Looks good; I like the iPTRAny idea. Comments below. > >> // Print function. >> std::string OpVTStr; >> - if (OpVT == MVT::iPTR) { >> + if (OpVT == MVT::iPTR || OpVT == MVT::iPTRAny) { >> OpVTStr = "_iPTR"; > > It probably doesn't break anything, but it seems a little confusing > to have iPTRAny rendered as iPTR here. Could this print iPTRAny > separately? > >> @@ -495,7 +496,8 @@ >> setTypes(ExtVTs); >> return true; >> } >> - if (getExtTypeNum(0) == EMVT::isInt && ExtVTs[0] == MVT::iPTR) { >> + if (getExtTypeNum(0) == EMVT::isInt && >> + (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTR)) { > > Looks like the second iPTR here should be iPTRAny. > >> @@ -527,6 +529,7 @@ >> case EMVT::isFP : OS << ":isFP"; break; >> case EMVT::isUnknown: ; /*OS << ":?";*/ break; >> case MVT::iPTR: OS << ":iPTR"; break; >> + case MVT::iPTRAny: OS << ":iPTR"; break; > > As above, can iPTRAny be rendered as "iPTRAny"? > >> + } >> + } else if (VT == MVT::iPTRAny) { >> + // Outside of TableGen, we don't distinguish iPTRAny (to any > address >> + // space) and iPTR. In the verifier, we can not distinguish > which case >> + // we have so allow either case to be legal. >> + if (const PointerType* PTyp = dyn_cast(Ty)) { >> + Suffix += ".p" + utostr(PTyp->getAddressSpace()) + >> + MVT::getMVT(PTyp->getElementType()).getMVTString(); >> + } >> + else { > > Put the else on the same line with the } please :-). > > Thanks, > > Dan > > On Jul 25, 2008, at 3:51 PM, Mon P Wang wrote: > >> Hi, >> >> Here is an updated patch for intrinsic address space. The effects >> are the same. The main difference between this patch and the other >> one is that instead of assuming a pointer may or may not be >> overloaded, I have introduced a new type iPTRAny which indicates >> that the pointer can be overloaded based on an address spaces. >> This would allow us to overload intrinsics based only on a pointer. >> The iPTRAny should only be used in TableGen (and part of the >> Verifier) and has the same semantics of iPTR except for the >> overloading. Please let me know if you have any comments. >> >> -- Mon Ping >> >> >> >> >> >> >> On Thu, July 17, 2008 3:56 pm, Mon P Wang wrote: >>> >>> Here is a patch to enable intrinsic to have pointers to different >>> address spaces. This changes overloaded intrinsics with pointer >>> arguments to pass also an address space as part of their name. >>> For example, atomic.load.add.i32 => atomic.load.add.i32.p0i32 >>> >>> The above syntax indicates that the result is i32 with a pointer >>> argument to address space 0 (generic address space) whose domain >>> type >>> is i32. The patch here doesn't include the documentation change but >>> that will be included as part of the checkin. Let me know if you >>> have >>> any comments. >>> >>> -- Mon Ping >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Jul 28 14:03:05 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jul 2008 21:03:05 +0200 Subject: [llvm-commits] [llvm] r54133 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll In-Reply-To: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> References: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> Message-ID: <200807282103.06350.baldrick@free.fr> Hi Owen, > + // If we're storing the same value back to a pointer that we just > + // loaded from, then the store can be removed; except if it is volatile. Ciao, Duncan. From baldrick at free.fr Mon Jul 28 14:09:02 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jul 2008 19:09:02 -0000 Subject: [llvm-commits] [llvm] r54138 - /llvm/trunk/test/Other/invalid-commandline-option.ll Message-ID: <200807281909.m6SJ92xc017878@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 28 14:09:01 2008 New Revision: 54138 URL: http://llvm.org/viewvc/llvm-project?rev=54138&view=rev Log: Test this differently: I saw this test fail because opt exited while llvm-as was still writing to the pipe, causing it to get a SIGPIPE. It seems best to change things to avoid the race altogether. Modified: llvm/trunk/test/Other/invalid-commandline-option.ll Modified: llvm/trunk/test/Other/invalid-commandline-option.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/invalid-commandline-option.ll?rev=54138&r1=54137&r2=54138&view=diff ============================================================================== --- llvm/trunk/test/Other/invalid-commandline-option.ll (original) +++ llvm/trunk/test/Other/invalid-commandline-option.ll Mon Jul 28 14:09:01 2008 @@ -1,3 +1,3 @@ -; RUN: llvm-as < /dev/null | not opt --foo >& /dev/null +; RUN: not opt --foo |& grep {Unknown command line argument} ; there is no --foo From bruno.cardoso at gmail.com Mon Jul 28 14:11:26 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 28 Jul 2008 19:11:26 -0000 Subject: [llvm-commits] [llvm] r54139 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsISelLowering.cpp MipsISelLowering.h MipsInstrFPU.td MipsInstrInfo.cpp MipsInstrInfo.h MipsTargetAsmInfo.cpp Message-ID: <200807281911.m6SJBR04017970@zion.cs.uiuc.edu> Author: bruno Date: Mon Jul 28 14:11:24 2008 New Revision: 54139 URL: http://llvm.org/viewvc/llvm-project?rev=54139&view=rev Log: Added floating point lowering for setcc and brcond. Fixed COMM asm directive usage. ConstantPool using custom FourByteConstantSection. Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h llvm/trunk/lib/Target/Mips/MipsInstrFPU.td llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.h llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Jul 28 14:11:24 2008 @@ -518,17 +518,13 @@ (GVar->hasInternalLinkage() || GVar->isWeakForLinker())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. - if (GVar->hasInternalLinkage()) { - if (TAI->getLCOMMDirective()) - O << TAI->getLCOMMDirective() << name << ',' << Size; - else - O << "\t.local\t" << name << '\n'; - } else { - O << TAI->getCOMMDirective() << name << ',' << Size; - // The .comm alignment in bytes. - if (TAI->getCOMMDirectiveTakesAlignment()) - O << ',' << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); - } + if (GVar->hasInternalLinkage()) + O << "\t.local\t" << name << '\n'; + + O << TAI->getCOMMDirective() << name << ',' << Size; + if (TAI->getCOMMDirectiveTakesAlignment()) + O << ',' << (1 << Align); + O << '\n'; return; } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jul 28 14:11:24 2008 @@ -89,6 +89,8 @@ setOperationAction(ISD::ConstantPool, MVT::i32, Custom); setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); setOperationAction(ISD::SELECT_CC, MVT::f32, Custom); + setOperationAction(ISD::SETCC, MVT::f32, Custom); + setOperationAction(ISD::BRCOND, MVT::Other, Custom); // Operations not directly supported by Mips. setOperationAction(ISD::BR_JT, MVT::Other, Expand); @@ -150,6 +152,8 @@ case ISD::JumpTable: return LowerJumpTable(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); + case ISD::SETCC: return LowerSETCC(Op, DAG); + case ISD::BRCOND: return LowerBRCOND(Op, DAG); } return SDValue(); } @@ -265,10 +269,87 @@ return IsInSmallSection(Size); } +// Get fp branch code (not opcode) from condition code. +static Mips::FPBranchCode GetFPBranchCodeFromCond(Mips::CondCode CC) { + if (CC >= Mips::FCOND_F && CC <= Mips::FCOND_NGT) + return Mips::BRANCH_T; + + if (CC >= Mips::FCOND_T && CC <= Mips::FCOND_GT) + return Mips::BRANCH_F; + + return Mips::BRANCH_INVALID; +} + + +static Mips::CondCode FPCondCCodeToFCC(ISD::CondCode CC) { + switch (CC) { + default: assert(0 && "Unknown fp condition code!"); + case ISD::SETEQ: + case ISD::SETOEQ: return Mips::FCOND_EQ; + case ISD::SETUNE: return Mips::FCOND_OGL; + case ISD::SETLT: + case ISD::SETOLT: return Mips::FCOND_OLT; + case ISD::SETGT: + case ISD::SETOGT: return Mips::FCOND_OGT; + case ISD::SETLE: + case ISD::SETOLE: return Mips::FCOND_OLE; + case ISD::SETGE: + case ISD::SETOGE: return Mips::FCOND_OGE; + case ISD::SETULT: return Mips::FCOND_ULT; + case ISD::SETULE: return Mips::FCOND_ULE; + case ISD::SETUGT: return Mips::FCOND_UGT; + case ISD::SETUGE: return Mips::FCOND_UGE; + case ISD::SETUO: return Mips::FCOND_UN; + case ISD::SETO: return Mips::FCOND_OR; + case ISD::SETNE: + case ISD::SETONE: return Mips::FCOND_NEQ; + case ISD::SETUEQ: return Mips::FCOND_UEQ; + } +} + //===----------------------------------------------------------------------===// // Misc Lower Operation implementation //===----------------------------------------------------------------------===// SDValue MipsTargetLowering:: +LowerBRCOND(SDValue Op, SelectionDAG &DAG) +{ + // The first operand is the chain, the second is the condition, the third is + // the block to branch to if the condition is true. + SDValue Chain = Op.getOperand(0); + SDValue Dest = Op.getOperand(2); + SDValue CondRes; + + if (Op.getOperand(1).getOpcode() == ISD::AND) + CondRes = Op.getOperand(1).getOperand(0); + else if (Op.getOperand(1).getOpcode() == MipsISD::FPCmp) + CondRes = Op.getOperand(1); + else + assert(0 && "Incoming condition flag unknown"); + + SDValue CCNode = CondRes.getOperand(2); + Mips::CondCode CC = (Mips::CondCode)cast(CCNode)->getValue(); + SDValue BrCode = DAG.getConstant(GetFPBranchCodeFromCond(CC), MVT::i32); + + return DAG.getNode(MipsISD::FPBrcond, Op.getValueType(), Chain, BrCode, + Dest, CondRes); +} + +SDValue MipsTargetLowering:: +LowerSETCC(SDValue Op, SelectionDAG &DAG) +{ + // The operands to this are the left and right operands to compare (ops #0, + // and #1) and the condition code to compare them with (op #2) as a + // CondCodeSDNode. + SDValue LHS = Op.getOperand(0); + SDValue RHS = Op.getOperand(1); + + ISD::CondCode CC = cast(Op.getOperand(2))->get(); + + return DAG.getNode(MipsISD::FPCmp, Op.getValueType(), LHS, RHS, + DAG.getConstant(FPCondCCodeToFCC(CC), MVT::i32)); +} + +SDValue MipsTargetLowering:: LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) { GlobalValue *GV = cast(Op)->getGlobal(); Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Mon Jul 28 14:11:24 2008 @@ -96,6 +96,8 @@ SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG); SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG); + SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG); + SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG); virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB); Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Mon Jul 28 14:11:24 2008 @@ -238,12 +238,12 @@ /// Floating Point Branch of False/True (Likely) let isBranch=1, isTerminator=1, hasDelaySlot=1, base=0x8, Uses=[FCR31] in { - class FBRANCH : FFI<0x11, (ops), + class FBRANCH : FFI<0x11, (outs), (ins brtarget:$dst), !strconcat(asmstr, " $dst"), [(MipsFPBrcond op, bb:$dst, FCR31)]>; } -def BC1F : FBRANCH; -def BC1T : FBRANCH; +def BC1F : FBRANCH; +def BC1T : FBRANCH; def BC1FL : FBRANCH; def BC1TL : FBRANCH; @@ -271,19 +271,16 @@ /// Floating Point Compare let hasDelaySlot = 1, Defs=[FCR31] in { - -//multiclass FCC1_1 - def FCMP_SO32 : FCC<0x0, (outs), (ins FGR32:$fs, FGR32:$ft, condcode:$cc), - "c.$cc.s $fs $ft", [(MipsFPCmp FGR32:$fs, FGR32:$ft, imm:$cc), + "c.$cc.s $fs, $ft", [(MipsFPCmp FGR32:$fs, FGR32:$ft, imm:$cc), (implicit FCR31)]>, Requires<[IsSingleFloat]>; def FCMP_AS32 : FCC<0x0, (outs), (ins AFGR32:$fs, AFGR32:$ft, condcode:$cc), - "c.$cc.s $fs $ft", [(MipsFPCmp AFGR32:$fs, AFGR32:$ft, imm:$cc), + "c.$cc.s $fs, $ft", [(MipsFPCmp AFGR32:$fs, AFGR32:$ft, imm:$cc), (implicit FCR31)]>, Requires<[In32BitMode]>; def FCMP_D32 : FCC<0x1, (outs), (ins AFGR64:$fs, AFGR64:$ft, condcode:$cc), - "c.$cc.d $fs $ft", [(MipsFPCmp AFGR64:$fs, AFGR64:$ft, imm:$cc), + "c.$cc.d $fs, $ft", [(MipsFPCmp AFGR64:$fs, AFGR64:$ft, imm:$cc), (implicit FCR31)]>, Requires<[In32BitMode]>; } Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Mon Jul 28 14:11:24 2008 @@ -137,7 +137,13 @@ else if ((DestRC == Mips::AFGR32RegisterClass) && (SrcRC == Mips::CPURegsRegisterClass)) BuildMI(MBB, I, get(Mips::MTC1A), DestReg).addReg(SrcReg); - else + else if ((SrcRC == Mips::CCRRegisterClass) && + (SrcReg == Mips::FCR31)) + return; // This register is used implicitly, no copy needed. + else if ((DestRC == Mips::CCRRegisterClass) && + (DestReg == Mips::FCR31)) + return; // This register is used implicitly, no copy needed. + else assert (0 && "DestRC != SrcRC, Can't copy this register"); } @@ -332,12 +338,16 @@ { switch (BrOpc) { default: return Mips::COND_INVALID; - case Mips::BEQ : return Mips::COND_E; - case Mips::BNE : return Mips::COND_NE; - case Mips::BGTZ : return Mips::COND_GZ; - case Mips::BGEZ : return Mips::COND_GEZ; - case Mips::BLTZ : return Mips::COND_LZ; - case Mips::BLEZ : return Mips::COND_LEZ; + case Mips::BEQ : return Mips::COND_E; + case Mips::BNE : return Mips::COND_NE; + case Mips::BGTZ : return Mips::COND_GZ; + case Mips::BGEZ : return Mips::COND_GEZ; + case Mips::BLTZ : return Mips::COND_LZ; + case Mips::BLEZ : return Mips::COND_LEZ; + + // We dont do fp branch analysis yet! + case Mips::BC1T : + case Mips::BC1F : return Mips::COND_INVALID; } } @@ -353,6 +363,40 @@ case Mips::COND_GEZ : return Mips::BGEZ; case Mips::COND_LZ : return Mips::BLTZ; case Mips::COND_LEZ : return Mips::BLEZ; + + case Mips::FCOND_F: + case Mips::FCOND_UN: + case Mips::FCOND_EQ: + case Mips::FCOND_UEQ: + case Mips::FCOND_OLT: + case Mips::FCOND_ULT: + case Mips::FCOND_OLE: + case Mips::FCOND_ULE: + case Mips::FCOND_SF: + case Mips::FCOND_NGLE: + case Mips::FCOND_SEQ: + case Mips::FCOND_NGL: + case Mips::FCOND_LT: + case Mips::FCOND_NGE: + case Mips::FCOND_LE: + case Mips::FCOND_NGT: return Mips::BC1T; + + case Mips::FCOND_T: + case Mips::FCOND_OR: + case Mips::FCOND_NEQ: + case Mips::FCOND_OGL: + case Mips::FCOND_UGE: + case Mips::FCOND_OGE: + case Mips::FCOND_UGT: + case Mips::FCOND_OGT: + case Mips::FCOND_ST: + case Mips::FCOND_GLE: + case Mips::FCOND_SNE: + case Mips::FCOND_GL: + case Mips::FCOND_NLT: + case Mips::FCOND_GE: + case Mips::FCOND_NLE: + case Mips::FCOND_GT: return Mips::BC1F; } } Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.h?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.h Mon Jul 28 14:11:24 2008 @@ -22,6 +22,15 @@ namespace Mips { + // Mips Branch Codes + enum FPBranchCode { + BRANCH_F, + BRANCH_T, + BRANCH_FL, + BRANCH_TL, + BRANCH_INVALID + }; + // Mips Condition Codes enum CondCode { // To be used with float branch True @@ -74,7 +83,7 @@ // Turn condition code into conditional branch opcode. unsigned GetCondBranchFromCond(CondCode CC); - + /// GetOppositeBranchCondition - Return the inverse of the specified cond, /// e.g. turning COND_E to COND_NE. CondCode GetOppositeBranchCondition(Mips::CondCode CC); Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=54139&r1=54138&r2=54139&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jul 28 14:11:24 2008 @@ -32,9 +32,8 @@ ReadOnlySection = "\t.rdata"; ZeroDirective = "\t.space\t"; BSSSection = "\t.section\t.bss"; - LCOMMDirective = "\t.lcomm\t"; CStringSection = ".rodata.str"; - FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; + FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; if (!Subtarget->hasABICall()) { JumpTableDirective = "\t.word\t"; From baldrick at free.fr Mon Jul 28 14:16:31 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jul 2008 19:16:31 -0000 Subject: [llvm-commits] [llvm] r54140 - /llvm/trunk/test/TestRunner.sh Message-ID: <200807281916.m6SJGVve018130@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 28 14:16:31 2008 New Revision: 54140 URL: http://llvm.org/viewvc/llvm-project?rev=54140&view=rev Log: This is not a binary file. Modified: llvm/trunk/test/TestRunner.sh (props changed) Propchange: llvm/trunk/test/TestRunner.sh ------------------------------------------------------------------------------ --- svn:mime-type (original) +++ svn:mime-type Mon Jul 28 14:16:31 2008 @@ -1 +1 @@ -application/x-sh +text/x-sh From baldrick at free.fr Mon Jul 28 14:17:22 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jul 2008 19:17:22 -0000 Subject: [llvm-commits] [llvm] r54141 - /llvm/trunk/lib/Target/TargetSelectionDAG.td Message-ID: <200807281917.m6SJHMsf018168@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 28 14:17:21 2008 New Revision: 54141 URL: http://llvm.org/viewvc/llvm-project?rev=54141&view=rev Log: Since build_vector is a variadic node, the number of operands should be -1 not 0. Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=54141&r1=54140&r2=54141&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetSelectionDAG.td (original) +++ llvm/trunk/lib/Target/TargetSelectionDAG.td Mon Jul 28 14:17:21 2008 @@ -389,7 +389,7 @@ [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; def vector_shuffle : SDNode<"ISD::VECTOR_SHUFFLE", SDTVecShuffle, []>; -def build_vector : SDNode<"ISD::BUILD_VECTOR", SDTypeProfile<1, 0, []>, []>; +def build_vector : SDNode<"ISD::BUILD_VECTOR", SDTypeProfile<1, -1, []>, []>; def scalar_to_vector : SDNode<"ISD::SCALAR_TO_VECTOR", SDTypeProfile<1, 1, []>, []>; def vector_extract : SDNode<"ISD::EXTRACT_VECTOR_ELT", From mikael.lepisto at tut.fi Mon Jul 28 14:21:01 2008 From: mikael.lepisto at tut.fi (=?ISO-8859-1?Q?Mikael_Lepist=F6?=) Date: Mon, 28 Jul 2008 22:21:01 +0300 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp Message-ID: <488E1C1D.5040400@tut.fi> Patch makes it possible for -loop-unroll pass to partially unroll loop until -unroll-threshold size is reached if -unroll-allow-partial switch is given. Instead of giving up if loop cannot be completely unrolled, patched version tries to find greatest unroll count which is modulo of trip count and still results loop which is smaller that threshold size. Mikael Lepist? -------------- next part -------------- A non-text attachment was scrubbed... Name: partial-loopunroll.patch Type: text/x-diff Size: 1926 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080728/f15188aa/attachment.bin From bruno.cardoso at gmail.com Mon Jul 28 14:26:26 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 28 Jul 2008 19:26:26 -0000 Subject: [llvm-commits] [llvm] r54142 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200807281926.m6SJQQO2018432@zion.cs.uiuc.edu> Author: bruno Date: Mon Jul 28 14:26:25 2008 New Revision: 54142 URL: http://llvm.org/viewvc/llvm-project?rev=54142&view=rev Log: Disable gp_rel relocation for constant pools access for now. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54142&r1=54141&r2=54142&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jul 28 14:26:25 2008 @@ -440,16 +440,20 @@ SDValue CP = DAG.getTargetConstantPool(C, MVT::i32, N->getAlignment()); // gp_rel relocation - if (!Subtarget->hasABICall() && - IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) { - SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP); - SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); - ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); - } else { // %hi/%lo relocation + // FIXME: we should reference the constant pool using small data sections, + // but the asm printer currently doens't support this feature without + // hacking it. This feature should come soon so we can uncomment the + // stuff below. + //if (!Subtarget->hasABICall() && + // IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) { + // SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP); + // SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); + // ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); + //} else { // %hi/%lo relocation SDValue HiPart = DAG.getNode(MipsISD::Hi, MVT::i32, CP); SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, CP); ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo); - } + //} return ResNode; } From clattner at apple.com Mon Jul 28 15:29:24 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jul 2008 13:29:24 -0700 Subject: [llvm-commits] [llvm] r54133 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll In-Reply-To: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> References: <200807281614.m6SGEleh011895@zion.cs.uiuc.edu> Message-ID: On Jul 28, 2008, at 9:14 AM, Owen Anderson wrote: > Log: > Add support for eliminating stores that store the same value that > was just loaded. > This fixes PR2599. nice. > + if (S->getParent() == L->getParent() && Why do you need this? Why not allow any case where L dominates S? > > + S->getPointerOperand() == L->getPointerOperand() && Please check to see if the pointers mustalias instead of being exactly equal. If you do this, make sure the loaded and stored value have the same type though. Thanks for adding this Owen, -Chris From isanbard at gmail.com Mon Jul 28 15:50:25 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jul 2008 20:50:25 -0000 Subject: [llvm-commits] [llvm] r54143 - /llvm/trunk/README.txt Message-ID: <200807282050.m6SKoPuM021115@zion.cs.uiuc.edu> Author: void Date: Mon Jul 28 15:50:25 2008 New Revision: 54143 URL: http://llvm.org/viewvc/llvm-project?rev=54143&view=rev Log: Remove extra lines Modified: llvm/trunk/README.txt Modified: llvm/trunk/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/README.txt?rev=54143&r1=54142&r2=54143&view=diff ============================================================================== --- llvm/trunk/README.txt (original) +++ llvm/trunk/README.txt Mon Jul 28 15:50:25 2008 @@ -10,6 +10,3 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. - - - From resistor at mac.com Mon Jul 28 15:52:42 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 28 Jul 2008 20:52:42 -0000 Subject: [llvm-commits] [llvm] r54144 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200807282052.m6SKqgEA021200@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 28 15:52:42 2008 New Revision: 54144 URL: http://llvm.org/viewvc/llvm-project?rev=54144&view=rev Log: Don't remove volatile loads. Thanks to Duncan for noticing this one. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=54144&r1=54143&r2=54144&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon Jul 28 15:52:42 2008 @@ -183,7 +183,7 @@ Instruction* dep = MD.getDependency(S); DominatorTree& DT = getAnalysis(); - if (S->getParent() == L->getParent() && + if (!S->isVolatile() && S->getParent() == L->getParent() && S->getPointerOperand() == L->getPointerOperand() && ( dep == MemoryDependenceAnalysis::None || dep == MemoryDependenceAnalysis::NonLocal || From gohman at apple.com Mon Jul 28 16:05:16 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 21:05:16 -0000 Subject: [llvm-commits] [test-suite] r54145 - /test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c Message-ID: <200807282105.m6SL5GEF021628@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 16:05:16 2008 New Revision: 54145 URL: http://llvm.org/viewvc/llvm-project?rev=54145&view=rev Log: Give this test's main function a return value so that it doesn't spuriously fail. Modified: test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c Modified: test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c?rev=54145&r1=54144&r2=54145&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc/fbench.c Mon Jul 28 16:05:16 2008 @@ -675,6 +675,7 @@ /* Initialise when called the first time */ +int main(argc, argv) int argc; char *argv[]; @@ -824,4 +825,5 @@ } else printf("\nNo errors in results.\n"); #endif + return 0; } From gohman at apple.com Mon Jul 28 16:51:05 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 21:51:05 -0000 Subject: [llvm-commits] [llvm] r54146 - in /llvm/trunk: include/llvm/ include/llvm/ADT/ include/llvm/Analysis/ include/llvm/Bitcode/ include/llvm/CodeGen/ include/llvm/Support/ lib/Archive/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Support/ lib/VMCore/ Message-ID: <200807282151.m6SLp7Lk023199@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 16:51:04 2008 New Revision: 54146 URL: http://llvm.org/viewvc/llvm-project?rev=54146&view=rev Log: Fold the useful features of alist and alist_node into ilist, and a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. Added: llvm/trunk/include/llvm/ADT/ilist_node.h Removed: llvm/trunk/include/llvm/ADT/alist.h llvm/trunk/include/llvm/ADT/alist_node.h Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h llvm/trunk/include/llvm/ADT/ilist.h llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/include/llvm/Argument.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/Bitcode/Archive.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/MachineInstr.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/Function.h llvm/trunk/include/llvm/GlobalAlias.h llvm/trunk/include/llvm/GlobalVariable.h llvm/trunk/include/llvm/Instruction.h llvm/trunk/include/llvm/Support/Recycler.h llvm/trunk/include/llvm/Support/RecyclingAllocator.h llvm/trunk/include/llvm/SymbolTableListTraits.h llvm/trunk/lib/Archive/Archive.cpp llvm/trunk/lib/Archive/ArchiveReader.cpp llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/MachineInstr.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Support/Allocator.cpp llvm/trunk/lib/VMCore/BasicBlock.cpp llvm/trunk/lib/VMCore/SymbolTableListTraitsImpl.h Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original) +++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Mon Jul 28 16:51:04 2008 @@ -39,7 +39,8 @@ template -struct SparseBitVectorElement { +struct SparseBitVectorElement + : ilist_node > { public: typedef unsigned long BitWord; enum { @@ -48,56 +49,23 @@ BITS_PER_ELEMENT = ElementSize }; - SparseBitVectorElement *getNext() const { - return Next; - } - SparseBitVectorElement *getPrev() const { - return Prev; - } - - void setNext(SparseBitVectorElement *RHS) { - Next = RHS; - } - void setPrev(SparseBitVectorElement *RHS) { - Prev = RHS; - } - private: - SparseBitVectorElement *Next; - SparseBitVectorElement *Prev; // Index of Element in terms of where first bit starts. unsigned ElementIndex; BitWord Bits[BITWORDS_PER_ELEMENT]; // Needed for sentinels + friend class ilist_sentinel_traits; SparseBitVectorElement() { ElementIndex = ~0U; memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT); } - friend struct ilist_traits >; public: explicit SparseBitVectorElement(unsigned Idx) { ElementIndex = Idx; memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT); } - ~SparseBitVectorElement() { - } - - // Copy ctor. - SparseBitVectorElement(const SparseBitVectorElement &RHS) { - ElementIndex = RHS.ElementIndex; - std::copy(&RHS.Bits[0], &RHS.Bits[BITWORDS_PER_ELEMENT], Bits); - } - - // Assignment - SparseBitVectorElement& operator=(const SparseBitVectorElement& RHS) { - ElementIndex = RHS.ElementIndex; - std::copy(&RHS.Bits[0], &RHS.Bits[BITWORDS_PER_ELEMENT], Bits); - - return *this; - } - // Comparison. bool operator==(const SparseBitVectorElement &RHS) const { if (ElementIndex != RHS.ElementIndex) Removed: llvm/trunk/include/llvm/ADT/alist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/alist.h?rev=54145&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/alist.h (original) +++ llvm/trunk/include/llvm/ADT/alist.h (removed) @@ -1,296 +0,0 @@ -//==- llvm/ADT/alist.h - Linked lists with hooks -----------------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the alist class template, and related infrastructure. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ADT_ALIST_H -#define LLVM_ADT_ALIST_H - -#include "llvm/ADT/alist_node.h" -#include "llvm/ADT/STLExtras.h" - -namespace llvm { - -/// alist_iterator - An iterator class for alist. -/// -template > > -class alist_iterator : public bidirectional_iterator { -public: - typedef bidirectional_iterator super; - typedef alist_node NodeTy; - -private: - /// NodeIter - The underlying iplist iterator that is being wrapped. - NodeIterT NodeIter; - -public: - typedef size_t size_type; - - // FIX for MSVC++. This should be reviewed more. - // typedef typename super::pointer pointer; - typedef ValueT* pointer; - - typedef typename super::reference reference; - - alist_iterator(NodeIterT NI) : NodeIter(NI) {} - alist_iterator(pointer EP) : NodeIter(NodeTy::getNode(EP)) {} - alist_iterator() : NodeIter() {} - - // This is templated so that we can allow constructing a const iterator from - // a nonconst iterator... - template - alist_iterator(const alist_iterator &RHS) - : NodeIter(RHS.getNodeIterUnchecked()) {} - - // This is templated so that we can allow assigning to a const iterator from - // a nonconst iterator... - template - const alist_iterator &operator=(const alist_iterator &RHS) { - NodeIter = RHS.getNodeIterUnchecked(); - return *this; - } - - operator pointer() const { return NodeIter->getElement((T*)0); } - - reference operator*() const { return *NodeIter->getElement((T*)0); } - pointer operator->() const { return &operator*(); } - - bool operator==(const alist_iterator &RHS) const { - return NodeIter == RHS.NodeIter; - } - bool operator!=(const alist_iterator &RHS) const { - return NodeIter != RHS.NodeIter; - } - - alist_iterator &operator--() { - --NodeIter; - return *this; - } - alist_iterator &operator++() { - ++NodeIter; - return *this; - } - alist_iterator operator--(int) { - alist_iterator tmp = *this; - --*this; - return tmp; - } - alist_iterator operator++(int) { - alist_iterator tmp = *this; - ++*this; - return tmp; - } - - NodeIterT getNodeIterUnchecked() const { return NodeIter; } -}; - -// do not implement. this is to catch errors when people try to use -// them as random access iterators -template -void operator-(int, alist_iterator); -template -void operator-(alist_iterator,int); - -template -void operator+(int, alist_iterator); -template -void operator+(alist_iterator,int); - -// operator!=/operator== - Allow mixed comparisons without dereferencing -// the iterator, which could very likely be pointing to end(). -template -bool operator!=(T* LHS, const alist_iterator &RHS) { - return LHS != RHS.getNodeIterUnchecked().getNodePtrUnchecked() - ->getElement((T*)0); -} -template -bool operator==(T* LHS, const alist_iterator &RHS) { - return LHS == RHS.getNodeIterUnchecked().getNodePtrUnchecked() - ->getElement((T*)0); -} - -// Allow alist_iterators to convert into pointers to a node automatically when -// used by the dyn_cast, cast, isa mechanisms... - -template struct simplify_type; - -template -struct simplify_type > { - typedef alist_node NodeTy; - typedef NodeTy* SimpleType; - - static SimpleType - getSimplifiedValue(const alist_iterator &Node) { - return &*Node; - } -}; -template -struct simplify_type > { - typedef alist_node NodeTy; - typedef NodeTy* SimpleType; - - static SimpleType - getSimplifiedValue(const alist_iterator &Node) { - return &*Node; - } -}; - -/// Template traits for alist. By specializing this template class, you -/// can register custom actions to be run when a node is added to or removed -/// from an alist. A common use of this is to update parent pointers. -/// -template -class alist_traits { -public: - typedef alist_iterator iterator; - - void addNodeToList(T *) {} - void removeNodeFromList(T *) {} - void transferNodesFromList(alist_traits &, iterator, iterator) {} - void deleteNode(T *E) { delete alist_node::getNode(E); } -}; - -/// alist - This class is an ilist-style container that automatically -/// adds the next/prev pointers. It is designed to work in cooperation -/// with . -/// -template -class alist { -public: - typedef alist_node NodeTy; - typedef typename ilist::size_type size_type; - -private: - /// NodeListTraits - ilist traits for NodeList. - /// - struct NodeListTraits : ilist_traits > { - alist_traits UserTraits; - - void addNodeToList(NodeTy *N) { - UserTraits.addNodeToList(N->getElement((T*)0)); - } - void removeNodeFromList(NodeTy *N) { - UserTraits.removeNodeFromList(N->getElement((T*)0)); - } - void transferNodesFromList(iplist &L2, - ilist_iterator first, - ilist_iterator last) { - UserTraits.transferNodesFromList(L2.UserTraits, - iterator(first), - iterator(last)); - } - }; - - /// NodeList - Doubly-linked list of nodes that have constructed - /// contents and may be in active use. - /// - iplist NodeList; - -public: - ~alist() { clear(); } - - typedef alist_iterator > - iterator; - typedef alist_iterator > - const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - iterator begin() { return iterator(NodeList.begin()); } - iterator end() { return iterator(NodeList.end()); } - const_iterator begin() const { return const_iterator(NodeList.begin()); } - const_iterator end() const { return const_iterator(NodeList.end()); } - reverse_iterator rbegin() { return reverse_iterator(NodeList.rbegin()); } - reverse_iterator rend() { return reverse_iterator(NodeList.rend()); } - const_reverse_iterator rbegin() const { - return const_reverse_iterator(NodeList.rbegin()); - } - const_reverse_iterator rend() const { - return const_reverse_iterator(NodeList.rend()); - } - - typedef T& reference; - typedef const T& const_reference; - reference front() { return *NodeList.front().getElement((T*)0); } - reference back() { return *NodeList.back().getElement((T*)0); } - const_reference front() const { return *NodeList.front().getElement((T*)0); } - const_reference back() const { return *NodeList.back().getElement((T*)0); } - - bool empty() const { return NodeList.empty(); } - size_type size() const { return NodeList.size(); } - - void push_front(T *E) { - NodeTy *N = alist_node::getNode(E); - assert(N->getPrev() == 0); - assert(N->getNext() == 0); - NodeList.push_front(N); - } - void push_back(T *E) { - NodeTy *N = alist_node::getNode(E); - assert(N->getPrev() == 0); - assert(N->getNext() == 0); - NodeList.push_back(N); - } - iterator insert(iterator I, T *E) { - NodeTy *N = alist_node::getNode(E); - assert(N->getPrev() == 0); - assert(N->getNext() == 0); - return iterator(NodeList.insert(I.getNodeIterUnchecked(), N)); - } - void splice(iterator where, alist &Other) { - NodeList.splice(where.getNodeIterUnchecked(), Other.NodeList); - } - void splice(iterator where, alist &Other, iterator From) { - NodeList.splice(where.getNodeIterUnchecked(), Other.NodeList, - From.getNodeIterUnchecked()); - } - void splice(iterator where, alist &Other, iterator From, - iterator To) { - NodeList.splice(where.getNodeIterUnchecked(), Other.NodeList, - From.getNodeIterUnchecked(), To.getNodeIterUnchecked()); - } - - void pop_front() { - erase(NodeList.begin()); - } - void pop_back() { - erase(prior(NodeList.end())); - } - iterator erase(iterator I) { - iterator Next = next(I); - NodeTy *N = NodeList.remove(I.getNodeIterUnchecked()); - NodeList.UserTraits.deleteNode(N->getElement((T*)0)); - return Next; - } - iterator erase(iterator first, iterator last) { - while (first != last) - first = erase(first); - return last; - } - - T *remove(T *E) { - NodeTy *N = alist_node::getNode(E); - return NodeList.remove(N)->getElement((T*)0); - } - - void clear() { - while (!empty()) pop_front(); - } - - alist_traits &getTraits() { - return NodeList.UserTraits; - } -}; - -} - -#endif Removed: llvm/trunk/include/llvm/ADT/alist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/alist_node.h?rev=54145&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/alist_node.h (original) +++ llvm/trunk/include/llvm/ADT/alist_node.h (removed) @@ -1,123 +0,0 @@ -//==- llvm/ADT/alist_node.h - Next/Prev helper class for alist ---*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the alist_node class template, which is used by the alist -// class template to provide next/prev pointers for arbitrary objects. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ADT_ALIST_NODE_H -#define LLVM_ADT_ALIST_NODE_H - -#include "llvm/ADT/ilist.h" -#include "llvm/Support/AlignOf.h" -#include "llvm/Support/DataTypes.h" -#include - -namespace llvm { - -/// alist_node - This is a utility class used by alist. It holds prev and next -/// pointers for use with ilists, as well as storage for objects as large as -/// LargestT, that are in T's inheritance tree. -/// -template -class alist_node { - alist_node *Prev, *Next; - -public: - alist_node() : Prev(0), Next(0) {} - - alist_node *getPrev() const { return Prev; } - alist_node *getNext() const { return Next; } - void setPrev(alist_node *N) { Prev = N; } - void setNext(alist_node *N) { Next = N; } - - union { - char Bytes[sizeof(LargestT)]; - long long L; - void *P; - } Storage; - - template - SubClass *getElement(SubClass *) { - assert(sizeof(SubClass) <= sizeof(LargestT)); - return reinterpret_cast(&Storage.Bytes); - } - - template - const SubClass *getElement(SubClass *) const { - assert(sizeof(SubClass) <= sizeof(LargestT)); - return reinterpret_cast(&Storage.Bytes); - } - - // This code essentially does offsetof, but actual offsetof hits an ICE in - // GCC 4.0 relating to offsetof being used inside a template. - static alist_node* getNode(T *D) { - return reinterpret_cast(reinterpret_cast(D) - - (uintptr_t)&getNull()->Storage); - } - static const alist_node* getNode(const T *D) { - return reinterpret_cast(reinterpret_cast(D) - - (uintptr_t)&getNull()->Storage); - } -private: - static alist_node* getNull() { return 0; } -}; - -// A specialization of ilist_traits for alist_nodes. -template -class ilist_traits > { -public: - typedef alist_node NodeTy; - -protected: - // Allocate a sentinel inside the traits class. This works - // because iplist carries an instance of the traits class. - NodeTy Sentinel; - -public: - static NodeTy *getPrev(NodeTy *N) { return N->getPrev(); } - static NodeTy *getNext(NodeTy *N) { return N->getNext(); } - static const NodeTy *getPrev(const NodeTy *N) { return N->getPrev(); } - static const NodeTy *getNext(const NodeTy *N) { return N->getNext(); } - - static void setPrev(NodeTy *N, NodeTy *Prev) { N->setPrev(Prev); } - static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); } - - NodeTy *createSentinel() const { - assert(Sentinel.getPrev() == 0); - assert(Sentinel.getNext() == 0); - return const_cast(&Sentinel); - } - - void destroySentinel(NodeTy *N) { - assert(N == &Sentinel); N = N; - Sentinel.setPrev(0); - Sentinel.setNext(0); - } - - void addNodeToList(NodeTy *) {} - void removeNodeFromList(NodeTy *) {} - void transferNodesFromList(iplist &, - ilist_iterator /*first*/, - ilist_iterator /*last*/) {} - - // Ideally we wouldn't implement this, but ilist's clear calls it, - // which is called from ilist's destructor. We won't ever call - // either of those with a non-empty list, but statically this - // method needs to exist. - void deleteNode(NodeTy *) { assert(0); } - -private: - static NodeTy *createNode(const NodeTy &V); // do not implement -}; - -} - -#endif Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Mon Jul 28 16:51:04 2008 @@ -47,10 +47,11 @@ template class iplist; template class ilist_iterator; -// Template traits for intrusive list. By specializing this template class, you -// can change what next/prev fields are used to store the links... +/// ilist_nextprev_traits - A fragment for template traits for intrusive list +/// that provides default next/prev implementations for common operations. +/// template -struct ilist_traits { +struct ilist_nextprev_traits { static NodeTy *getPrev(NodeTy *N) { return N->getPrev(); } static NodeTy *getNext(NodeTy *N) { return N->getNext(); } static const NodeTy *getPrev(const NodeTy *N) { return N->getPrev(); } @@ -58,25 +59,43 @@ static void setPrev(NodeTy *N, NodeTy *Prev) { N->setPrev(Prev); } static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); } +}; - static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); } - static void deleteNode(NodeTy *V) { delete V; } - +/// ilist_sentinel_traits - A fragment for template traits for intrusive list +/// that provides default sentinel implementations for common operations. +/// +template +struct ilist_sentinel_traits { static NodeTy *createSentinel() { return new NodeTy(); } static void destroySentinel(NodeTy *N) { delete N; } +}; + +/// ilist_default_traits - Default template traits for intrusive list. +/// By inheriting from this, you can easily use default implementations +/// for all common operations. +/// +template +struct ilist_default_traits : ilist_nextprev_traits, + ilist_sentinel_traits { + static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); } + static void deleteNode(NodeTy *V) { delete V; } void addNodeToList(NodeTy *NTy) {} void removeNodeFromList(NodeTy *NTy) {} - void transferNodesFromList(iplist &L2, + void transferNodesFromList(ilist_default_traits &SrcTraits, ilist_iterator first, ilist_iterator last) {} }; +// Template traits for intrusive list. By specializing this template class, you +// can change what next/prev fields are used to store the links... +template +struct ilist_traits : ilist_default_traits {}; + // Const traits are the same as nonconst traits... template struct ilist_traits : public ilist_traits {}; - //===----------------------------------------------------------------------===// // ilist_iterator - Iterator for intrusive list. // Added: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=54146&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (added) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Mon Jul 28 16:51:04 2008 @@ -0,0 +1,43 @@ +//==-- llvm/ADT/ilist_node.h - Intrusive Linked List Helper ------*- C++ -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the ilist_node class template, which is a convenient +// base class for creating classes that can be used with ilists. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_ILIST_NODE_H +#define LLVM_ADT_ILIST_NODE_H + +namespace llvm { + +template +struct ilist_nextprev_traits; + +/// ilist_node - Base class that provides next/prev services for nodes +/// that use ilist_nextprev_traits or ilist_default_traits. +/// +template +class ilist_node { +private: + friend struct ilist_nextprev_traits; + NodeTy *Prev, *Next; + NodeTy *getPrev() { return Prev; } + NodeTy *getNext() { return Next; } + const NodeTy *getPrev() const { return Prev; } + const NodeTy *getNext() const { return Next; } + void setPrev(NodeTy *N) { Prev = N; } + void setNext(NodeTy *N) { Next = N; } +protected: + ilist_node() : Prev(0), Next(0) {} +}; + +} // End llvm namespace + +#endif Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Jul 28 16:51:04 2008 @@ -22,6 +22,7 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/hash_map.h" #include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { @@ -33,7 +34,7 @@ class AliasSetTracker; class AliasSet; -class AliasSet { +class AliasSet : public ilist_node { friend class AliasSetTracker; class PointerRec; @@ -118,12 +119,6 @@ // Volatile - True if this alias set contains volatile loads or stores. bool Volatile : 1; - friend struct ilist_traits; - AliasSet *getPrev() const { return Prev; } - AliasSet *getNext() const { return Next; } - void setPrev(AliasSet *P) { Prev = P; } - void setNext(AliasSet *N) { Next = N; } - void addRef() { ++RefCount; } void dropRef(AliasSetTracker &AST) { assert(RefCount >= 1 && "Invalid reference count detected!"); @@ -197,15 +192,15 @@ }; private: - // Can only be created by AliasSetTracker + // Can only be created by AliasSetTracker. Also, ilist creates one + // to serve as a sentinel. + friend struct ilist_sentinel_traits; AliasSet() : PtrList(0), PtrListEnd(&PtrList), Forward(0), RefCount(0), AccessTy(NoModRef), AliasTy(MustAlias), Volatile(false) { } - AliasSet(const AliasSet &AS) { - assert(0 && "Copy ctor called!?!?!"); - abort(); - } + AliasSet(const AliasSet &AS); // do not implement + void operator=(const AliasSet &AS); // do not implement HashNodePair *getSomePointer() const { return PtrList; Modified: llvm/trunk/include/llvm/Argument.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Argument.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Argument.h (original) +++ llvm/trunk/include/llvm/Argument.h Mon Jul 28 16:51:04 2008 @@ -27,12 +27,9 @@ /// in the body of a function, it represents the value of the actual argument /// the function was called with. /// @brief LLVM Argument representation -class Argument : public Value { // Defined in the Function.cpp file +class Argument : public Value, public ilist_node { Function *Parent; - Argument *Prev, *Next; // Next and Prev links for our intrusive linked list - void setNext(Argument *N) { Next = N; } - void setPrev(Argument *N) { Prev = N; } friend class SymbolTableListTraits; void setParent(Function *parent); @@ -80,13 +77,6 @@ static inline bool classof(const Value *V) { return V->getValueID() == ArgumentVal; } - -private: - // getNext/Prev - Return the next or previous argument in the list. - Argument *getNext() { return Next; } - const Argument *getNext() const { return Next; } - Argument *getPrev() { return Prev; } - const Argument *getPrev() const { return Prev; } }; } // End llvm namespace Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Mon Jul 28 16:51:04 2008 @@ -49,17 +49,15 @@ /// modifying a program. However, the verifier will ensure that basic blocks /// are "well formed". /// @brief LLVM Basic Block Representation -class BasicBlock : public Value { // Basic blocks are data objects also +class BasicBlock : public Value, // Basic blocks are data objects also + public ilist_node { public: typedef iplist InstListType; private : InstListType InstList; - BasicBlock *Prev, *Next; // Next and Prev links for our intrusive linked list Function *Parent; void setParent(Function *parent); - void setNext(BasicBlock *N) { Next = N; } - void setPrev(BasicBlock *N) { Prev = N; } friend class SymbolTableListTraits; BasicBlock(const BasicBlock &); // Do not implement @@ -204,14 +202,6 @@ BasicBlock *Obj = 0; return unsigned(reinterpret_cast(&Obj->InstList)); } - -private: - // getNext/Prev - Return the next or previous basic block in the list. Access - // these with Function::iterator. - BasicBlock *getNext() { return Next; } - const BasicBlock *getNext() const { return Next; } - BasicBlock *getPrev() { return Prev; } - const BasicBlock *getPrev() const { return Prev; } }; inline int Modified: llvm/trunk/include/llvm/Bitcode/Archive.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Archive.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/Archive.h (original) +++ llvm/trunk/include/llvm/Bitcode/Archive.h Mon Jul 28 16:51:04 2008 @@ -18,6 +18,7 @@ #define LLVM_BITCODE_ARCHIVE_H #include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" #include "llvm/System/Path.h" #include #include @@ -39,7 +40,7 @@ /// construct ArchiveMember instances. You should obtain them from the methods /// of the Archive class instead. /// @brief This class represents a single archive member. -class ArchiveMember { +class ArchiveMember : public ilist_node { /// @name Types /// @{ public: @@ -165,22 +166,9 @@ bool replaceWith(const sys::Path &aFile, std::string* ErrMsg); /// @} - /// @name ilist methods - do not use - /// @{ - public: - const ArchiveMember *getNext() const { return next; } - const ArchiveMember *getPrev() const { return prev; } - ArchiveMember *getNext() { return next; } - ArchiveMember *getPrev() { return prev; } - void setPrev(ArchiveMember* p) { prev = p; } - void setNext(ArchiveMember* n) { next = n; } - - /// @} /// @name Data /// @{ private: - ArchiveMember* next; ///< Pointer to next archive member - ArchiveMember* prev; ///< Pointer to previous archive member Archive* parent; ///< Pointer to parent archive sys::PathWithStatus path; ///< Path of file containing the member sys::FileStatus info; ///< Status info (size,mode,date) Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Jul 28 16:51:04 2008 @@ -19,30 +19,34 @@ #include "llvm/Support/Streams.h" namespace llvm { - class MachineFunction; + +class BasicBlock; +class MachineFunction; template <> -struct alist_traits { -protected: +class ilist_traits : public ilist_default_traits { + mutable MachineInstr Sentinel; + // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; MachineBasicBlock* Parent; - typedef alist_iterator iterator; - public: - alist_traits() : Parent(0) { } + MachineInstr *createSentinel() const { return &Sentinel; } + void destroySentinel(MachineInstr *) const {} void addNodeToList(MachineInstr* N); void removeNodeFromList(MachineInstr* N); - void transferNodesFromList(alist_traits &, iterator, iterator); + void transferNodesFromList(ilist_traits &SrcTraits, + ilist_iterator first, + ilist_iterator last); void deleteNode(MachineInstr *N); +private: + void createNode(const MachineInstr &); }; -class BasicBlock; - -class MachineBasicBlock { - typedef alist Instructions; +class MachineBasicBlock : public ilist_node { + typedef ilist Instructions; Instructions Insts; const BasicBlock *BB; int Number; @@ -65,6 +69,10 @@ /// exception handler. bool IsLandingPad; + // Intrusive list support + friend class ilist_sentinel_traits; + MachineBasicBlock() {} + explicit MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb); ~MachineBasicBlock(); @@ -287,7 +295,7 @@ void setNumber(int N) { Number = N; } private: // Methods used to maintain doubly linked list of blocks... - friend struct alist_traits; + friend struct ilist_traits; // Machine-CFG mutators Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Jul 28 16:51:04 2008 @@ -18,7 +18,7 @@ #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H #define LLVM_CODEGEN_MACHINEFUNCTION_H -#include "llvm/ADT/alist.h" +#include "llvm/ADT/ilist.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/Support/Annotation.h" #include "llvm/Support/Allocator.h" @@ -34,15 +34,18 @@ class MachineJumpTableInfo; template <> -class alist_traits { - typedef alist_iterator iterator; +class ilist_traits + : public ilist_default_traits { + mutable MachineBasicBlock Sentinel; public: + MachineBasicBlock *createSentinel() const { return &Sentinel; } + void destroySentinel(MachineBasicBlock *) const {} + void addNodeToList(MachineBasicBlock* MBB); void removeNodeFromList(MachineBasicBlock* MBB); - void transferNodesFromList(alist_traits &, - iterator, - iterator) {} void deleteNode(MachineBasicBlock *MBB); +private: + void createNode(const MachineBasicBlock &); }; /// MachineFunctionInfo - This class can be derived from and used by targets to @@ -87,11 +90,8 @@ // Allocation management for basic blocks in function. Recycler BasicBlockRecycler; - // Allocation management for memoperands in function. - Recycler MemOperandRecycler; - // List of machine basic blocks in function - typedef alist BasicBlockListType; + typedef ilist BasicBlockListType; BasicBlockListType BasicBlocks; public: @@ -302,15 +302,6 @@ /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock. /// void DeleteMachineBasicBlock(MachineBasicBlock *MBB); - - /// CreateMachineMemOperand - Allocate a new MachineMemOperand. Use this - /// instead of `new MachineMemOperand'. - /// - MachineMemOperand *CreateMachineMemOperand(const MachineMemOperand &MMO); - - /// DeleteMachineMemOperand - Delete the given MachineMemOperand. - /// - void DeleteMachineMemOperand(MachineMemOperand *MMO); }; //===--------------------------------------------------------------------===// Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Mon Jul 28 16:51:04 2008 @@ -16,9 +16,12 @@ #ifndef LLVM_CODEGEN_MACHINEINSTR_H #define LLVM_CODEGEN_MACHINEINSTR_H -#include "llvm/ADT/alist.h" +#include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include #include namespace llvm { @@ -31,13 +34,13 @@ //===----------------------------------------------------------------------===// /// MachineInstr - Representation of each machine instruction. /// -class MachineInstr { +class MachineInstr : public ilist_node { const TargetInstrDesc *TID; // Instruction descriptor. unsigned short NumImplicitOps; // Number of implicit operands (which // are determined at construction time). std::vector Operands; // the operands - alist MemOperands; // information on memory references + std::list MemOperands; // information on memory references MachineBasicBlock *Parent; // Pointer to the owning basic block. // OperandComplete - Return true if it's illegal to add a new operand @@ -47,8 +50,9 @@ void operator=(const MachineInstr&); // DO NOT IMPLEMENT // Intrusive list support - friend struct alist_traits; - friend struct alist_traits; + friend struct ilist_traits; + friend struct ilist_traits; + friend struct ilist_sentinel_traits; void setParent(MachineBasicBlock *P) { Parent = P; } /// MachineInstr ctor - This constructor creates a copy of the given @@ -105,13 +109,13 @@ unsigned getNumExplicitOperands() const; /// Access to memory operands of the instruction - alist::iterator memoperands_begin() + std::list::iterator memoperands_begin() { return MemOperands.begin(); } - alist::iterator memoperands_end() + std::list::iterator memoperands_end() { return MemOperands.end(); } - alist::const_iterator memoperands_begin() const + std::list::const_iterator memoperands_begin() const { return MemOperands.begin(); } - alist::const_iterator memoperands_end() const + std::list::const_iterator memoperands_end() const { return MemOperands.end(); } bool memoperands_empty() const { return MemOperands.empty(); } Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Jul 28 16:51:04 2008 @@ -15,6 +15,7 @@ #ifndef LLVM_CODEGEN_SELECTIONDAG_H #define LLVM_CODEGEN_SELECTIONDAG_H +#include "llvm/ADT/ilist.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -26,13 +27,38 @@ #include namespace llvm { - class AliasAnalysis; - class TargetLowering; - class TargetMachine; - class MachineModuleInfo; - class MachineFunction; - class MachineConstantPoolValue; - class FunctionLoweringInfo; + +class AliasAnalysis; +class TargetLowering; +class TargetMachine; +class MachineModuleInfo; +class MachineFunction; +class MachineConstantPoolValue; +class FunctionLoweringInfo; + +/// NodeAllocatorType - The AllocatorType for allocating SDNodes. We use +/// pool allocation with recycling. +/// +typedef RecyclingAllocator::Alignment> + NodeAllocatorType; + +template<> class ilist_traits : public ilist_default_traits { + mutable SDNode Sentinel; +public: + ilist_traits() : Sentinel(ISD::DELETED_NODE, SDVTList()) {} + + SDNode *createSentinel() const { + return &Sentinel; + } + static void destroySentinel(SDNode *) {} + + static void deleteNode(SDNode *) { + assert(0 && "ilist_traits shouldn't see a deleteNode call!"); + } +private: + static void createNode(const SDNode &); +}; /// SelectionDAG class - This is used to represent a portion of an LLVM function /// in a low-level Data Dependence DAG representation suitable for instruction @@ -55,7 +81,12 @@ SDValue Root, EntryNode; /// AllNodes - A linked list of nodes in the current DAG. - alist &AllNodes; + ilist AllNodes; + + /// NodeAllocator - Pool allocation for nodes. The allocator isn't + /// allocated inside this class because we want to reuse a single + /// recycler across multiple SelectionDAG runs. + NodeAllocatorType &NodeAllocator; /// CSEMap - This structure is used to memoize nodes, automatically performing /// CSE with existing nodes with a duplicate is requested. @@ -71,8 +102,8 @@ public: SelectionDAG(TargetLowering &tli, MachineFunction &mf, FunctionLoweringInfo &fli, MachineModuleInfo *mmi, - alist &NodePool) - : TLI(tli), MF(mf), FLI(fli), MMI(mmi), AllNodes(NodePool) { + NodeAllocatorType &nodeallocator) + : TLI(tli), MF(mf), FLI(fli), MMI(mmi), NodeAllocator(nodeallocator) { EntryNode = Root = getNode(ISD::EntryToken, MVT::Other); } ~SelectionDAG(); @@ -108,13 +139,13 @@ /// void setGraphColor(const SDNode *N, const char *Color); - typedef alist::const_iterator allnodes_const_iterator; + typedef ilist::const_iterator allnodes_const_iterator; allnodes_const_iterator allnodes_begin() const { return AllNodes.begin(); } allnodes_const_iterator allnodes_end() const { return AllNodes.end(); } - typedef alist::iterator allnodes_iterator; + typedef ilist::iterator allnodes_iterator; allnodes_iterator allnodes_begin() { return AllNodes.begin(); } allnodes_iterator allnodes_end() { return AllNodes.end(); } - alist::size_type allnodes_size() const { + ilist::size_type allnodes_size() const { return AllNodes.size(); } @@ -682,7 +713,6 @@ SDValue getShuffleScalarElt(const SDNode *N, unsigned Idx); private: - inline alist_traits::AllocatorType &getAllocator(); void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op, void *&InsertPos); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Jul 28 16:51:04 2008 @@ -182,7 +182,7 @@ FunctionLoweringInfo &FuncInfo); void SelectBasicBlock(BasicBlock *BB, MachineFunction &MF, FunctionLoweringInfo &FuncInfo, - alist &AllNodes); + NodeAllocatorType &NodeAllocator); void BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB, std::vector > &PHINodesToUpdate, Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jul 28 16:51:04 2008 @@ -25,7 +25,8 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" -#include "llvm/ADT/alist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/Support/Allocator.h" @@ -43,6 +44,7 @@ class CompileUnitDesc; template struct DenseMapInfo; template struct simplify_type; +template class ilist_traits; /// SDVTList - This represents a list of ValueType's that has been intern'd by /// a SelectionDAG. Instances of this simple value class are returned by @@ -1028,7 +1030,7 @@ /// SDNode - Represents one node in the SelectionDAG. /// -class SDNode : public FoldingSetNode { +class SDNode : public FoldingSetNode, public ilist_node { private: /// NodeType - The operation that this node performs. /// @@ -1268,6 +1270,7 @@ protected: friend class SelectionDAG; + friend class ilist_traits; /// getValueTypeList - Return a pointer to the specified value type. /// @@ -2236,27 +2239,10 @@ /// typedef LoadSDNode LargestSDNode; -// alist_traits specialization for pool-allocating SDNodes. -template <> -class alist_traits { - typedef alist_iterator iterator; - -public: - // Pool-allocate and recycle SDNodes. - typedef RecyclingAllocator - AllocatorType; - - // Allocate the allocator immediately inside the traits class. - AllocatorType Allocator; - - void addNodeToList(SDNode*) {} - void removeNodeFromList(SDNode*) {} - void transferNodesFromList(alist_traits &, iterator, iterator) {} - void deleteNode(SDNode *N) { - N->~SDNode(); - Allocator.Deallocate(N); - } -}; +/// MostAlignedSDNode - The SDNode class with the greatest alignment +/// requirement. +/// +typedef ConstantSDNode MostAlignedSDNode; namespace ISD { /// isNormalLoad - Returns true if the specified node is a non-extending Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Mon Jul 28 16:51:04 2008 @@ -51,7 +51,8 @@ static int getListOffset(); }; -class Function : public GlobalValue, public Annotable { +class Function : public GlobalValue, public Annotable, + public ilist_node { public: typedef iplist ArgumentListType; typedef iplist BasicBlockListType; @@ -76,18 +77,6 @@ friend class SymbolTableListTraits; void setParent(Module *parent); - Function *Prev, *Next; - void setNext(Function *N) { Next = N; } - void setPrev(Function *N) { Prev = N; } - - // getNext/Prev - Return the next or previous function in the list. These - // methods should never be used directly, and are only used to implement the - // function list as part of the module. - // - Function *getNext() { return Next; } - const Function *getNext() const { return Next; } - Function *getPrev() { return Prev; } - const Function *getPrev() const { return Prev; } /// hasLazyArguments/CheckLazyArguments - The argument list of a function is /// built on demand, so that the list isn't allocated until the first client Modified: llvm/trunk/include/llvm/GlobalAlias.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalAlias.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalAlias.h (original) +++ llvm/trunk/include/llvm/GlobalAlias.h Mon Jul 28 16:51:04 2008 @@ -17,6 +17,7 @@ #include "llvm/GlobalValue.h" #include "llvm/OperandTraits.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { @@ -26,23 +27,13 @@ template class SymbolTableListTraits; -class GlobalAlias : public GlobalValue { +class GlobalAlias : public GlobalValue, public ilist_node { friend class SymbolTableListTraits; void operator=(const GlobalAlias &); // Do not implement GlobalAlias(const GlobalAlias &); // Do not implement void setParent(Module *parent); - GlobalAlias *Prev, *Next; - void setNext(GlobalAlias *N) { Next = N; } - void setPrev(GlobalAlias *N) { Prev = N; } - - // getNext/Prev - Return the next or previous alias in the list. - GlobalAlias *getNext() { return Next; } - const GlobalAlias *getNext() const { return Next; } - GlobalAlias *getPrev() { return Prev; } - const GlobalAlias *getPrev() const { return Prev; } - public: // allocate space for exactly one operand void *operator new(size_t s) { Modified: llvm/trunk/include/llvm/GlobalVariable.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalVariable.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalVariable.h (original) +++ llvm/trunk/include/llvm/GlobalVariable.h Mon Jul 28 16:51:04 2008 @@ -22,6 +22,7 @@ #include "llvm/GlobalValue.h" #include "llvm/OperandTraits.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { @@ -31,7 +32,7 @@ template class SymbolTableListTraits; -class GlobalVariable : public GlobalValue { +class GlobalVariable : public GlobalValue, public ilist_node { friend class SymbolTableListTraits; void *operator new(size_t, unsigned); // Do not implement void operator=(const GlobalVariable &); // Do not implement @@ -39,10 +40,6 @@ void setParent(Module *parent); - GlobalVariable *Prev, *Next; - void setNext(GlobalVariable *N) { Next = N; } - void setPrev(GlobalVariable *N) { Prev = N; } - bool isConstantGlobal : 1; // Is this a global constant? bool isThreadLocalSymbol : 1; // Is this symbol "Thread Local"? @@ -144,12 +141,6 @@ static inline bool classof(const Value *V) { return V->getValueID() == Value::GlobalVariableVal; } -private: - // getNext/Prev - Return the next or previous global variable in the list. - GlobalVariable *getNext() { return Next; } - const GlobalVariable *getNext() const { return Next; } - GlobalVariable *getPrev() { return Prev; } - const GlobalVariable *getPrev() const { return Prev; } }; template <> Modified: llvm/trunk/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.h (original) +++ llvm/trunk/include/llvm/Instruction.h Mon Jul 28 16:51:04 2008 @@ -16,6 +16,7 @@ #define LLVM_INSTRUCTION_H #include "llvm/User.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { @@ -24,15 +25,11 @@ template class SymbolTableListTraits; -class Instruction : public User { +class Instruction : public User, public ilist_node { void operator=(const Instruction &); // Do not implement Instruction(const Instruction &); // Do not implement BasicBlock *Parent; - Instruction *Prev, *Next; // Next and Prev links for our intrusive linked list - - void setNext(Instruction *N) { Next = N; } - void setPrev(Instruction *N) { Prev = N; } friend class SymbolTableListTraits; void setParent(BasicBlock *P); @@ -230,14 +227,6 @@ #define LAST_OTHER_INST(N) OtherOpsEnd = N+1 #include "llvm/Instruction.def" }; - -private: - // getNext/Prev - Return the next or previous instruction in the list. The - // last node in the list is a terminator instruction. - Instruction *getNext() { return Next; } - const Instruction *getNext() const { return Next; } - Instruction *getPrev() { return Prev; } - const Instruction *getPrev() const { return Prev; } }; } // End llvm namespace Modified: llvm/trunk/include/llvm/Support/Recycler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Recycler.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Recycler.h (original) +++ llvm/trunk/include/llvm/Support/Recycler.h Mon Jul 28 16:51:04 2008 @@ -15,62 +15,81 @@ #ifndef LLVM_SUPPORT_RECYCLER_H #define LLVM_SUPPORT_RECYCLER_H -#include "llvm/ADT/alist_node.h" +#include "llvm/ADT/ilist.h" +#include "llvm/Support/AlignOf.h" +#include namespace llvm { /// PrintRecyclingAllocatorStats - Helper for RecyclingAllocator for /// printing statistics. /// -void PrintRecyclerStats(size_t LargestTypeSize, size_t FreeListSize); +void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize); + +/// RecyclerStruct - Implementation detail for Recycler. This is a +/// class that the recycler imposes on free'd memory to carve out +/// next/prev pointers. +struct RecyclerStruct { + RecyclerStruct *Prev, *Next; +}; + +template<> +struct ilist_traits : ilist_default_traits { + static RecyclerStruct *getPrev(const RecyclerStruct *t) { return t->Prev; } + static RecyclerStruct *getNext(const RecyclerStruct *t) { return t->Next; } + static void setPrev(RecyclerStruct *t, RecyclerStruct *p) { t->Prev = p; } + static void setNext(RecyclerStruct *t, RecyclerStruct *n) { t->Next = n; } + + mutable RecyclerStruct Sentinel; + RecyclerStruct *createSentinel() const { + return &Sentinel; + } + static void destroySentinel(RecyclerStruct *) {} + + static void deleteNode(RecyclerStruct *) { + assert(0 && "Recycler's ilist_traits shouldn't see a deleteNode call!"); + } +}; /// Recycler - This class manages a linked-list of deallocated nodes /// and facilitates reusing deallocated memory in place of allocating -/// new memory. The objects it allocates are stored in alist_node -/// containers, so they may be used in alists. +/// new memory. /// -template +template::Alignment> class Recycler { - typedef alist_node NodeTy; - - /// FreeListTraits - ilist traits for FreeList. - /// - struct FreeListTraits : ilist_traits > { - NodeTy &getSentinel() { return this->Sentinel; } - }; - /// FreeList - Doubly-linked list of nodes that have deleted contents and /// are not in active use. /// - iplist FreeList; - - /// CreateNewNode - Allocate a new node object and initialize its - /// prev and next pointers to 0. - /// - template - NodeTy *CreateNewNode(AllocatorType &Allocator) { - // Note that we're calling new on the *node*, to initialize its - // Next/Prev pointers, not new on the end-user object. - return new (Allocator.Allocate()) NodeTy(); - } + iplist FreeList; public: - ~Recycler() { assert(FreeList.empty()); } + ~Recycler() { + // If this fails, either the callee has lost track of some allocation, + // or the callee isn't tracking allocations and should just call + // clear() before deleting the Recycler. + assert(FreeList.empty() && "Non-empty recycler deleted!"); + } + /// clear - Release all the tracked allocations to the allocator. The + /// recycler must be free of any tracked allocations before being + /// deleted; calling clear is one way to ensure this. template void clear(AllocatorType &Allocator) { - while (!FreeList.empty()) - Allocator.Deallocate(FreeList.remove(FreeList.begin())); + while (!FreeList.empty()) { + T *t = reinterpret_cast(FreeList.remove(FreeList.begin())); + Allocator.Deallocate(t); + } } template SubClass *Allocate(AllocatorType &Allocator) { - NodeTy *N = !FreeList.empty() ? - FreeList.remove(FreeList.front()) : - CreateNewNode(Allocator); - assert(N->getPrev() == 0); - assert(N->getNext() == 0); - return N->getElement((SubClass*)0); + assert(sizeof(SubClass) <= Size && + "Recycler allocation size is less than object size!"); + assert(AlignOf::Alignment <= Align && + "Recycler allocation alignment is less than object alignment!"); + return !FreeList.empty() ? + reinterpret_cast(FreeList.remove(FreeList.begin())) : + static_cast(Allocator.Allocate(Size, Align)); } template @@ -80,14 +99,11 @@ template void Deallocate(AllocatorType & /*Allocator*/, SubClass* Element) { - NodeTy *N = NodeTy::getNode(Element); - assert(N->getPrev() == 0); - assert(N->getNext() == 0); - FreeList.push_front(N); + FreeList.push_front(reinterpret_cast(Element)); } void PrintStats() { - PrintRecyclerStats(sizeof(LargestT), FreeList.size()); + PrintRecyclerStats(Size, Align, FreeList.size()); } }; Modified: llvm/trunk/include/llvm/Support/RecyclingAllocator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/RecyclingAllocator.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/RecyclingAllocator.h (original) +++ llvm/trunk/include/llvm/Support/RecyclingAllocator.h Mon Jul 28 16:51:04 2008 @@ -22,12 +22,13 @@ /// RecyclingAllocator - This class wraps an Allocator, adding the /// functionality of recycling deleted objects. /// -template +template::Alignment> class RecyclingAllocator { private: /// Base - Implementation details. /// - Recycler Base; + Recycler Base; /// Allocator - The wrapped allocator. /// Modified: llvm/trunk/include/llvm/SymbolTableListTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/SymbolTableListTraits.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/include/llvm/SymbolTableListTraits.h (original) +++ llvm/trunk/include/llvm/SymbolTableListTraits.h Mon Jul 28 16:51:04 2008 @@ -25,6 +25,8 @@ #ifndef LLVM_SYMBOLTABLELISTTRAITS_H #define LLVM_SYMBOLTABLELISTTRAITS_H +#include "llvm/ADT/ilist.h" + namespace llvm { template class ilist_iterator; @@ -37,7 +39,7 @@ // inherit from ilist_traits // template -class SymbolTableListTraits { +class SymbolTableListTraits : public ilist_default_traits { typedef ilist_traits TraitsClass; public: SymbolTableListTraits() {} @@ -48,26 +50,14 @@ return reinterpret_cast(reinterpret_cast(this)- TraitsClass::getListOffset()); } - static ValueSubClass *getPrev(ValueSubClass *V) { return V->getPrev(); } - static ValueSubClass *getNext(ValueSubClass *V) { return V->getNext(); } - static const ValueSubClass *getPrev(const ValueSubClass *V) { - return V->getPrev(); - } - static const ValueSubClass *getNext(const ValueSubClass *V) { - return V->getNext(); - } void deleteNode(ValueSubClass *V) { delete V; } - static void setPrev(ValueSubClass *V, ValueSubClass *P) { V->setPrev(P); } - static void setNext(ValueSubClass *V, ValueSubClass *N) { V->setNext(N); } - void addNodeToList(ValueSubClass *V); void removeNodeFromList(ValueSubClass *V); - void transferNodesFromList(iplist > &L2, + void transferNodesFromList(ilist_traits &L2, ilist_iterator first, ilist_iterator last); //private: Modified: llvm/trunk/lib/Archive/Archive.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/Archive/Archive.cpp (original) +++ llvm/trunk/lib/Archive/Archive.cpp Mon Jul 28 16:51:04 2008 @@ -43,7 +43,7 @@ // This default constructor is only use by the ilist when it creates its // sentry node. We give it specific static values to make it stand out a bit. ArchiveMember::ArchiveMember() - : next(0), prev(0), parent(0), path("--invalid--"), flags(0), data(0) + : parent(0), path("--invalid--"), flags(0), data(0) { info.user = sys::Process::GetCurrentUserId(); info.group = sys::Process::GetCurrentGroupId(); @@ -58,7 +58,7 @@ // This is required because correctly setting the data may depend on other // things in the Archive. ArchiveMember::ArchiveMember(Archive* PAR) - : next(0), prev(0), parent(PAR), path(), flags(0), data(0) + : parent(PAR), path(), flags(0), data(0) { } Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/Archive/ArchiveReader.cpp (original) +++ llvm/trunk/lib/Archive/ArchiveReader.cpp Mon Jul 28 16:51:04 2008 @@ -218,8 +218,6 @@ ArchiveMember* member = new ArchiveMember(this); // Fill in fields of the ArchiveMember - member->next = 0; - member->prev = 0; member->parent = this; member->path.set(pathname); member->info.fileSize = MemberSize; Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Jul 28 16:51:04 2008 @@ -828,7 +828,7 @@ // If the instruction accesses memory and the memory could be non-constant, // assume the instruction is not rematerializable. - for (alist::const_iterator I = MI->memoperands_begin(), + for (std::list::const_iterator I = MI->memoperands_begin(), E = MI->memoperands_end(); I != E; ++I) { const MachineMemOperand &MMO = *I; if (MMO.isVolatile() || MMO.isStore()) Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Jul 28 16:51:04 2008 @@ -24,7 +24,7 @@ MachineBasicBlock::MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb) : BB(bb), Number(-1), xParent(&mf), Alignment(0), IsLandingPad(false) { - Insts.getTraits().Parent = this; + Insts.Parent = this; } MachineBasicBlock::~MachineBasicBlock() { @@ -43,7 +43,7 @@ /// MBBs start out as #-1. When a MBB is added to a MachineFunction, it /// gets the next available unique MBB number. If it is removed from a /// MachineFunction, it goes back to being #-1. -void alist_traits::addNodeToList(MachineBasicBlock* N) { +void ilist_traits::addNodeToList(MachineBasicBlock* N) { MachineFunction &MF = *N->getParent(); N->Number = MF.addToMBBNumbering(N); @@ -55,7 +55,7 @@ LeakDetector::removeGarbageObject(N); } -void alist_traits::removeNodeFromList(MachineBasicBlock* N) { +void ilist_traits::removeNodeFromList(MachineBasicBlock* N) { N->getParent()->removeFromMBBNumbering(N->Number); N->Number = -1; LeakDetector::addGarbageObject(N); @@ -65,7 +65,7 @@ /// addNodeToList (MI) - When we add an instruction to a basic block /// list, we update its parent pointer and add its operands from reg use/def /// lists if appropriate. -void alist_traits::addNodeToList(MachineInstr* N) { +void ilist_traits::addNodeToList(MachineInstr* N) { assert(N->getParent() == 0 && "machine instruction already in a basic block"); N->setParent(Parent); @@ -80,7 +80,7 @@ /// removeNodeFromList (MI) - When we remove an instruction from a basic block /// list, we update its parent pointer and remove its operands from reg use/def /// lists if appropriate. -void alist_traits::removeNodeFromList(MachineInstr* N) { +void ilist_traits::removeNodeFromList(MachineInstr* N) { assert(N->getParent() != 0 && "machine instruction not in a basic block"); // Remove from the use/def lists. @@ -94,35 +94,23 @@ /// transferNodesFromList (MI) - When moving a range of instructions from one /// MBB list to another, we need to update the parent pointers and the use/def /// lists. -void alist_traits::transferNodesFromList( - alist_traits& fromList, +void ilist_traits::transferNodesFromList( + ilist_traits& fromList, MachineBasicBlock::iterator first, MachineBasicBlock::iterator last) { + assert(Parent->getParent() == fromList.Parent->getParent() && + "MachineInstr parent mismatch!"); + // Splice within the same MBB -> no change. if (Parent == fromList.Parent) return; // If splicing between two blocks within the same function, just update the // parent pointers. - if (Parent->getParent() == fromList.Parent->getParent()) { - for (; first != last; ++first) - first->setParent(Parent); - return; - } - - // Otherwise, we have to update the parent and the use/def lists. The common - // case when this occurs is if we're splicing from a block in a MF to a block - // that is not in an MF. - bool HasOldMF = fromList.Parent->getParent() != 0; - MachineFunction *NewMF = Parent->getParent(); - - for (; first != last; ++first) { - if (HasOldMF) first->RemoveRegOperandsFromUseLists(); + for (; first != last; ++first) first->setParent(Parent); - if (NewMF) first->AddRegOperandsToUseLists(NewMF->getRegInfo()); - } } -void alist_traits::deleteNode(MachineInstr* MI) { +void ilist_traits::deleteNode(MachineInstr* MI) { assert(!MI->getParent() && "MI is still in a block!"); Parent->getParent()->DeleteMachineInstr(MI); } Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Jul 28 16:51:04 2008 @@ -102,7 +102,7 @@ // MachineFunction implementation //===---------------------------------------------------------------------===// -void alist_traits::deleteNode(MachineBasicBlock *MBB) { +void ilist_traits::deleteNode(MachineBasicBlock *MBB) { MBB->getParent()->DeleteMachineBasicBlock(MBB); } @@ -131,7 +131,6 @@ BasicBlocks.clear(); InstructionRecycler.clear(Allocator); BasicBlockRecycler.clear(Allocator); - MemOperandRecycler.clear(Allocator); RegInfo->~MachineRegisterInfo(); Allocator.Deallocate(RegInfo); if (MFInfo) { MFInfo->~MachineFunctionInfo(); Allocator.Deallocate(MFInfo); @@ -234,23 +233,6 @@ BasicBlockRecycler.Deallocate(Allocator, MBB); } -/// CreateMachineMemOperand - Allocate a new MachineMemOperand. Use this -/// instead of `new MachineMemOperand'. -/// -MachineMemOperand * -MachineFunction::CreateMachineMemOperand(const MachineMemOperand &MMO) { - return new (MemOperandRecycler.Allocate(Allocator)) - MachineMemOperand(MMO); -} - -/// DeleteMachineMemOperand - Delete the given MachineMemOperand. -/// -void -MachineFunction::DeleteMachineMemOperand(MachineMemOperand *MO) { - MO->~MachineMemOperand(); - MemOperandRecycler.Deallocate(Allocator, MO); -} - void MachineFunction::dump() const { print(*cerr.stream()); } Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Jul 28 16:51:04 2008 @@ -322,7 +322,7 @@ NumImplicitOps = MI.NumImplicitOps; // Add memory operands. - for (alist::const_iterator i = MI.memoperands_begin(), + for (std::list::const_iterator i = MI.memoperands_begin(), j = MI.memoperands_end(); i != j; ++i) addMemOperand(MF, *i); @@ -506,13 +506,12 @@ /// referencing arbitrary storage. void MachineInstr::addMemOperand(MachineFunction &MF, const MachineMemOperand &MO) { - MemOperands.push_back(MF.CreateMachineMemOperand(MO)); + MemOperands.push_back(MO); } /// clearMemOperands - Erase all of this MachineInstr's MachineMemOperands. void MachineInstr::clearMemOperands(MachineFunction &MF) { - while (!MemOperands.empty()) - MF.DeleteMachineMemOperand(MemOperands.remove(MemOperands.begin())); + MemOperands.clear(); } @@ -731,7 +730,7 @@ if (!memoperands_empty()) { OS << ", Mem:"; - for (alist::const_iterator i = memoperands_begin(), + for (std::list::const_iterator i = memoperands_begin(), e = memoperands_end(); i != e; ++i) { const MachineMemOperand &MRO = *i; const Value *V = MRO.getValue(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jul 28 16:51:04 2008 @@ -468,11 +468,6 @@ // SelectionDAG Class //===----------------------------------------------------------------------===// -inline alist_traits::AllocatorType & -SelectionDAG::getAllocator() { - return AllNodes.getTraits().Allocator; -} - /// RemoveDeadNodes - This method deletes all unreachable nodes in the /// SelectionDAG. void SelectionDAG::RemoveDeadNodes() { @@ -527,7 +522,7 @@ N->NumOperands = 0; // Finally, remove N itself. - AllNodes.erase(N); + AllNodes.remove(N); } } @@ -558,7 +553,7 @@ N->OperandList = 0; N->NumOperands = 0; - AllNodes.erase(N); + AllNodes.remove(N); } /// RemoveNodeFromCSEMaps - Take the specified node out of the CSE map that @@ -772,14 +767,13 @@ SelectionDAG::~SelectionDAG() { while (!AllNodes.empty()) { - SDNode *N = AllNodes.begin(); + SDNode *N = AllNodes.remove(AllNodes.begin()); N->SetNextInBucket(0); if (N->OperandsNeedDelete) { delete [] N->OperandList; } N->OperandList = 0; N->NumOperands = 0; - AllNodes.pop_front(); } } @@ -813,7 +807,7 @@ if (!VT.isVector()) return SDValue(N, 0); if (!N) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) ConstantSDNode(isT, Val, EltVT); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -852,7 +846,7 @@ if (!VT.isVector()) return SDValue(N, 0); if (!N) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) ConstantFPSDNode(isTarget, V, EltVT); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -900,7 +894,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) GlobalAddressSDNode(isTargetGA, GV, VT, Offset); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -915,7 +909,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) FrameIndexSDNode(FI, VT, isTarget); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -930,7 +924,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) JumpTableSDNode(JTI, VT, isTarget); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -949,7 +943,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) ConstantPoolSDNode(isTarget, C, VT, Offset, Alignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -969,7 +963,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) ConstantPoolSDNode(isTarget, C, VT, Offset, Alignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -984,7 +978,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) BasicBlockSDNode(MBB); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -998,7 +992,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) ARG_FLAGSSDNode(Flags); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -1013,7 +1007,7 @@ ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT()]; if (N) return SDValue(N, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) VTSDNode(VT); AllNodes.push_back(N); return SDValue(N, 0); @@ -1022,7 +1016,7 @@ SDValue SelectionDAG::getExternalSymbol(const char *Sym, MVT VT) { SDNode *&N = ExternalSymbols[Sym]; if (N) return SDValue(N, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) ExternalSymbolSDNode(false, Sym, VT); AllNodes.push_back(N); return SDValue(N, 0); @@ -1031,7 +1025,7 @@ SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, MVT VT) { SDNode *&N = TargetExternalSymbols[Sym]; if (N) return SDValue(N, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) ExternalSymbolSDNode(true, Sym, VT); AllNodes.push_back(N); return SDValue(N, 0); @@ -1042,7 +1036,7 @@ CondCodeNodes.resize(Cond+1); if (CondCodeNodes[Cond] == 0) { - CondCodeSDNode *N = getAllocator().Allocate(); + CondCodeSDNode *N = NodeAllocator.Allocate(); new (N) CondCodeSDNode(Cond); CondCodeNodes[Cond] = N; AllNodes.push_back(N); @@ -1057,7 +1051,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) RegisterSDNode(RegNo, VT); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -1065,9 +1059,9 @@ } SDValue SelectionDAG::getDbgStopPoint(SDValue Root, - unsigned Line, unsigned Col, - const CompileUnitDesc *CU) { - SDNode *N = getAllocator().Allocate(); + unsigned Line, unsigned Col, + const CompileUnitDesc *CU) { + SDNode *N = NodeAllocator.Allocate(); new (N) DbgStopPointSDNode(Root, Line, Col, CU); AllNodes.push_back(N); return SDValue(N, 0); @@ -1083,7 +1077,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) LabelSDNode(Opcode, Root, LabelID); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -1102,7 +1096,7 @@ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) SrcValueSDNode(V); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -1126,7 +1120,7 @@ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) MemOperandSDNode(MO); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -1979,7 +1973,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) SDNode(Opcode, SDNode::getSDVTList(VT)); CSEMap.InsertNode(N, IP); @@ -2176,11 +2170,11 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) UnarySDNode(Opcode, VTs, Operand); CSEMap.InsertNode(N, IP); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) UnarySDNode(Opcode, VTs, Operand); } @@ -2530,11 +2524,11 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) BinarySDNode(Opcode, VTs, N1, N2); CSEMap.InsertNode(N, IP); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) BinarySDNode(Opcode, VTs, N1, N2); } @@ -2599,11 +2593,11 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) TernarySDNode(Opcode, VTs, N1, N2, N3); CSEMap.InsertNode(N, IP); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) TernarySDNode(Opcode, VTs, N1, N2, N3); } AllNodes.push_back(N); @@ -3121,7 +3115,7 @@ void* IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode* N = getAllocator().Allocate(); + SDNode* N = NodeAllocator.Allocate(); new (N) AtomicSDNode(Opcode, VTs, Chain, Ptr, Cmp, Swp, PtrVal, Alignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -3152,7 +3146,7 @@ void* IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode* N = getAllocator().Allocate(); + SDNode* N = NodeAllocator.Allocate(); new (N) AtomicSDNode(Opcode, VTs, Chain, Ptr, Val, PtrVal, Alignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -3216,7 +3210,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) LoadSDNode(Ops, VTs, AM, ExtType, EVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -3276,7 +3270,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) StoreSDNode(Ops, VTs, ISD::UNINDEXED, false, VT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -3313,7 +3307,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) StoreSDNode(Ops, VTs, ISD::UNINDEXED, true, SVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -3339,7 +3333,7 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = getAllocator().Allocate(); + SDNode *N = NodeAllocator.Allocate(); new (N) StoreSDNode(Ops, VTs, AM, ST->isTruncatingStore(), ST->getMemoryVT(), ST->getSrcValue(), ST->getSrcValueOffset(), @@ -3411,11 +3405,11 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) SDNode(Opcode, VTs, Ops, NumOps); CSEMap.InsertNode(N, IP); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) SDNode(Opcode, VTs, Ops, NumOps); } AllNodes.push_back(N); @@ -3477,31 +3471,31 @@ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); if (NumOps == 1) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) UnarySDNode(Opcode, VTList, Ops[0]); } else if (NumOps == 2) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) BinarySDNode(Opcode, VTList, Ops[0], Ops[1]); } else if (NumOps == 3) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) TernarySDNode(Opcode, VTList, Ops[0], Ops[1], Ops[2]); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) SDNode(Opcode, VTList, Ops, NumOps); } CSEMap.InsertNode(N, IP); } else { if (NumOps == 1) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) UnarySDNode(Opcode, VTList, Ops[0]); } else if (NumOps == 2) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) BinarySDNode(Opcode, VTList, Ops[0], Ops[1]); } else if (NumOps == 3) { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) TernarySDNode(Opcode, VTList, Ops[0], Ops[1], Ops[2]); } else { - N = getAllocator().Allocate(); + N = NodeAllocator.Allocate(); new (N) SDNode(Opcode, VTList, Ops, NumOps); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jul 28 16:51:04 2008 @@ -5425,24 +5425,23 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, FunctionLoweringInfo &FuncInfo) { - // Define AllNodes here so that memory allocation is reused for + // Define NodeAllocator here so that memory allocation is reused for // each basic block. - alist AllNodes; + NodeAllocatorType NodeAllocator; - for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { - SelectBasicBlock(I, MF, FuncInfo, AllNodes); - AllNodes.clear(); - } + for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) + SelectBasicBlock(I, MF, FuncInfo, NodeAllocator); } -void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, - FunctionLoweringInfo &FuncInfo, - alist &AllNodes) { +void +SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, + FunctionLoweringInfo &FuncInfo, + NodeAllocatorType &NodeAllocator) { std::vector > PHINodesToUpdate; { SelectionDAG DAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &DAG; // First step, lower LLVM code to some DAG. This DAG may use operations and @@ -5478,7 +5477,7 @@ if (!BitTestCases[i].Emitted) { SelectionDAG HSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &HSDAG; SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5493,7 +5492,7 @@ for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) { SelectionDAG BSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &BSDAG; SelectionDAGLowering BSDL(BSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5552,7 +5551,7 @@ if (!JTCases[i].first.Emitted) { SelectionDAG HSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &HSDAG; SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5566,7 +5565,7 @@ SelectionDAG JSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &JSDAG; SelectionDAGLowering JSDL(JSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5616,7 +5615,7 @@ for (unsigned i = 0, e = SwitchCases.size(); i != e; ++i) { SelectionDAG SDAG(TLI, MF, FuncInfo, getAnalysisToUpdate(), - AllNodes); + NodeAllocator); CurDAG = &SDAG; SelectionDAGLowering SDL(SDAG, TLI, *AA, FuncInfo, GCI); Modified: llvm/trunk/lib/Support/Allocator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Allocator.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/Support/Allocator.cpp (original) +++ llvm/trunk/lib/Support/Allocator.cpp Mon Jul 28 16:51:04 2008 @@ -132,8 +132,10 @@ cerr << "Bytes allocated: " << BytesUsed << "\n"; } -void llvm::PrintRecyclerStats(size_t LargestTypeSize, +void llvm::PrintRecyclerStats(size_t Size, + size_t Align, size_t FreeListSize) { - cerr << "Recycler element size: " << LargestTypeSize << '\n'; + cerr << "Recycler element size: " << Size << '\n'; + cerr << "Recycler element alignment: " << Align << '\n'; cerr << "Number of elements free for recycling: " << FreeListSize << '\n'; } Modified: llvm/trunk/lib/VMCore/BasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/BasicBlock.cpp?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/BasicBlock.cpp (original) +++ llvm/trunk/lib/VMCore/BasicBlock.cpp Mon Jul 28 16:51:04 2008 @@ -15,6 +15,7 @@ #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Type.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/CFG.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/Compiler.h" @@ -260,7 +261,9 @@ assert(I != InstList.end() && "Trying to get me to create degenerate basic block!"); - BasicBlock *New = BasicBlock::Create(BBName, getParent(), getNext()); + BasicBlock *InsertBefore = next(Function::iterator(this)) + .getNodePtrUnchecked(); + BasicBlock *New = BasicBlock::Create(BBName, getParent(), InsertBefore); // Move all of the specified instructions from the original basic block into // the new basic block. Modified: llvm/trunk/lib/VMCore/SymbolTableListTraitsImpl.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/SymbolTableListTraitsImpl.h?rev=54146&r1=54145&r2=54146&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/SymbolTableListTraitsImpl.h (original) +++ llvm/trunk/lib/VMCore/SymbolTableListTraitsImpl.h Mon Jul 28 16:51:04 2008 @@ -84,7 +84,7 @@ template void SymbolTableListTraits -::transferNodesFromList(iplist > &L2, +::transferNodesFromList(ilist_traits &L2, ilist_iterator first, ilist_iterator last) { // We only have to do work here if transferring instructions between BBs From clattner at apple.com Mon Jul 28 16:57:11 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jul 2008 14:57:11 -0700 Subject: [llvm-commits] [llvm] r54144 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp In-Reply-To: <200807282052.m6SKqgEA021200@zion.cs.uiuc.edu> References: <200807282052.m6SKqgEA021200@zion.cs.uiuc.edu> Message-ID: <6CA61EF5-44F6-45DD-BBD6-5A6CBA2AE68B@apple.com> On Jul 28, 2008, at 1:52 PM, Owen Anderson wrote: > Author: resistor > Date: Mon Jul 28 15:52:42 2008 > New Revision: 54144 > > URL: http://llvm.org/viewvc/llvm-project?rev=54144&view=rev > Log: > Don't remove volatile loads. Thanks to Duncan for noticing this one. Shouldn't this check happen earlier? Why even do the dependence check for stores that clearly can't be eliminated? -Chris > > > Modified: > llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp > > Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=54144&r1=54143&r2=54144&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp > (original) > +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon > Jul 28 15:52:42 2008 > @@ -183,7 +183,7 @@ > Instruction* dep = MD.getDependency(S); > DominatorTree& DT = getAnalysis(); > > - if (S->getParent() == L->getParent() && > + if (!S->isVolatile() && S->getParent() == L->getParent() && > S->getPointerOperand() == L->getPointerOperand() && > ( dep == MemoryDependenceAnalysis::None || > dep == MemoryDependenceAnalysis::NonLocal || > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Jul 28 17:18:25 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 28 Jul 2008 22:18:25 -0000 Subject: [llvm-commits] [llvm] r54147 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll Message-ID: <200807282218.m6SMIQpB024215@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 17:18:25 2008 New Revision: 54147 URL: http://llvm.org/viewvc/llvm-project?rev=54147&view=rev Log: Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation, which is represented in codegen as an 'and' operation. This matches them with movz instructions, instead of leaving them to be matched by and instructions with an immediate field. Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54147&r1=54146&r2=54147&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jul 28 17:18:25 2008 @@ -377,6 +377,8 @@ // extending the low 8 bits of a 32-bit register to fill the top 24 bits // with the 7th bit). The size of the smaller type is indicated by the 1th // operand, a ValueType node. + // Note that there is intentionally no corresponding ZERO_EXTEND_INREG; an + // AND with an appropriate constant is used instead. SIGN_EXTEND_INREG, /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54147&r1=54146&r2=54147&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jul 28 17:18:25 2008 @@ -1240,6 +1240,12 @@ (SUBREG_TO_REG (i64 0), (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), x86_subreg_32bit)>; +// r & (2^16-1) ==> movz +def : Pat<(and GR64:$src, 0xffff), + (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)))>; +// r & (2^8-1) ==> movz +def : Pat<(and GR64:$src, 0xff), + (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)))>; // (shl x, 1) ==> (add x, x) def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54147&r1=54146&r2=54147&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Jul 28 17:18:25 2008 @@ -2763,6 +2763,16 @@ // Some peepholes //===----------------------------------------------------------------------===// +// r & (2^16-1) ==> movz +def : Pat<(and GR32:$src1, 0xffff), + (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, x86_subreg_16bit)))>; +// r & (2^8-1) ==> movz +def : Pat<(and GR32:$src1, 0xff), + (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, x86_subreg_8bit)))>; +// r & (2^8-1) ==> movz +def : Pat<(and GR16:$src1, 0xff), + (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, x86_subreg_8bit)))>; + // (shl x, 1) ==> (add x, x) def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54147&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (added) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Mon Jul 28 17:18:25 2008 @@ -0,0 +1,62 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep and +; RUN: llvm-as < %s | llc -march=x86-64 | not grep and + +; These should use movzbl instead of 'and 255'. +; This related to not having a ZERO_EXTEND_REG opcode. + +define i32 @a(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = and i32 %e, 255 + ret i32 %retval +} +define i32 @b(float %d) nounwind { + %tmp12 = fptoui float %d to i8 + %retval = zext i8 %tmp12 to i32 + ret i32 %retval +} +define i32 @c(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = and i32 %e, 65535 + ret i32 %retval +} +define i64 @d(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 255 + ret i64 %retval +} +define i64 @e(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 65535 + ret i64 %retval +} +define i64 @f(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 4294967295 + ret i64 %retval +} + +define i32 @g(i8 %d) nounwind { + %e = add i8 %d, 1 + %retval = zext i8 %e to i32 + ret i32 %retval +} +define i32 @h(i16 %d) nounwind { + %e = add i16 %d, 1 + %retval = zext i16 %e to i32 + ret i32 %retval +} +define i64 @i(i8 %d) nounwind { + %e = add i8 %d, 1 + %retval = zext i8 %e to i64 + ret i64 %retval +} +define i64 @j(i16 %d) nounwind { + %e = add i16 %d, 1 + %retval = zext i16 %e to i64 + ret i64 %retval +} +define i64 @k(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = zext i32 %e to i64 + ret i64 %retval +} Added: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54147&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Mon Jul 28 17:18:25 2008 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep and + +; These tests differ from the ones in zext-inreg-0.ll in that +; on x86-64 they do require and instructions. + +; These should use movzbl instead of 'and 255'. +; This related to not having ZERO_EXTEND_REG node. + +define i64 @g(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 1099511627775 + ret i64 %retval +} +define i64 @h(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 281474976710655 + ret i64 %retval +} From isanbard at gmail.com Mon Jul 28 17:38:37 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jul 2008 15:38:37 -0700 Subject: [llvm-commits] [llvm] r54147 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll In-Reply-To: <200807282218.m6SMIQpB024215@zion.cs.uiuc.edu> References: <200807282218.m6SMIQpB024215@zion.cs.uiuc.edu> Message-ID: <16e5fdf90807281538l2c986f9m31c7deb91ce9bb4c@mail.gmail.com> Dan, A bootstrap build is failing with this: /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/bin/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/lib/ -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/include -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include -mmacosx-version-min=10.4 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm/include -DL_paritydi2 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/./_paritydi2.o {standard input}:20:bad register name `%sil' /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/bin/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/lib/ -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/include -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include -mmacosx-version-min=10.4 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm/include -DL_powisf2 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/./_powisf2.o make[4]: *** [libgcc/./_popcountsi2.o] Error 1 make[4]: *** Waiting for unfinished jobs.... {standard input}:20:bad register name `%sil' {standard input}:42:bad register name `%sil' make[4]: *** [libgcc/./_popcountdi2.o] Error 1 make[3]: *** [stmp-multilib] Error 2 make[2]: *** [all-stage1-gcc] Error 2 make[1]: *** [stage1-bubble] Error 2 make: *** [all] Error 2 -bw On Mon, Jul 28, 2008 at 3:18 PM, Dan Gohman wrote: > Author: djg > Date: Mon Jul 28 17:18:25 2008 > New Revision: 54147 > > URL: http://llvm.org/viewvc/llvm-project?rev=54147&view=rev > Log: > Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation, > which is represented in codegen as an 'and' operation. This matches them > with movz instructions, instead of leaving them to be matched by and > instructions with an immediate field. > > Added: > llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll > llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll > Modified: > llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > llvm/trunk/lib/Target/X86/X86Instr64bit.td > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54147&r1=54146&r2=54147&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jul 28 17:18:25 2008 > @@ -377,6 +377,8 @@ > // extending the low 8 bits of a 32-bit register to fill the top 24 bits > // with the 7th bit). The size of the smaller type is indicated by the 1th > // operand, a ValueType node. > + // Note that there is intentionally no corresponding ZERO_EXTEND_INREG; an > + // AND with an appropriate constant is used instead. > SIGN_EXTEND_INREG, > > /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned > > Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54147&r1=54146&r2=54147&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) > +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jul 28 17:18:25 2008 > @@ -1240,6 +1240,12 @@ > (SUBREG_TO_REG (i64 0), > (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), > x86_subreg_32bit)>; > +// r & (2^16-1) ==> movz > +def : Pat<(and GR64:$src, 0xffff), > + (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)))>; > +// r & (2^8-1) ==> movz > +def : Pat<(and GR64:$src, 0xff), > + (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)))>; > > // (shl x, 1) ==> (add x, x) > def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>; > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54147&r1=54146&r2=54147&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Jul 28 17:18:25 2008 > @@ -2763,6 +2763,16 @@ > // Some peepholes > //===----------------------------------------------------------------------===// > > +// r & (2^16-1) ==> movz > +def : Pat<(and GR32:$src1, 0xffff), > + (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, x86_subreg_16bit)))>; > +// r & (2^8-1) ==> movz > +def : Pat<(and GR32:$src1, 0xff), > + (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, x86_subreg_8bit)))>; > +// r & (2^8-1) ==> movz > +def : Pat<(and GR16:$src1, 0xff), > + (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, x86_subreg_8bit)))>; > + > // (shl x, 1) ==> (add x, x) > def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; > def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; > > Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54147&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (added) > +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Mon Jul 28 17:18:25 2008 > @@ -0,0 +1,62 @@ > +; RUN: llvm-as < %s | llc -march=x86 | not grep and > +; RUN: llvm-as < %s | llc -march=x86-64 | not grep and > + > +; These should use movzbl instead of 'and 255'. > +; This related to not having a ZERO_EXTEND_REG opcode. > + > +define i32 @a(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = and i32 %e, 255 > + ret i32 %retval > +} > +define i32 @b(float %d) nounwind { > + %tmp12 = fptoui float %d to i8 > + %retval = zext i8 %tmp12 to i32 > + ret i32 %retval > +} > +define i32 @c(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = and i32 %e, 65535 > + ret i32 %retval > +} > +define i64 @d(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 255 > + ret i64 %retval > +} > +define i64 @e(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 65535 > + ret i64 %retval > +} > +define i64 @f(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 4294967295 > + ret i64 %retval > +} > + > +define i32 @g(i8 %d) nounwind { > + %e = add i8 %d, 1 > + %retval = zext i8 %e to i32 > + ret i32 %retval > +} > +define i32 @h(i16 %d) nounwind { > + %e = add i16 %d, 1 > + %retval = zext i16 %e to i32 > + ret i32 %retval > +} > +define i64 @i(i8 %d) nounwind { > + %e = add i8 %d, 1 > + %retval = zext i8 %e to i64 > + ret i64 %retval > +} > +define i64 @j(i16 %d) nounwind { > + %e = add i16 %d, 1 > + %retval = zext i16 %e to i64 > + ret i64 %retval > +} > +define i64 @k(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = zext i32 %e to i64 > + ret i64 %retval > +} > > Added: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54147&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (added) > +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Mon Jul 28 17:18:25 2008 > @@ -0,0 +1,18 @@ > +; RUN: llvm-as < %s | llc -march=x86 | not grep and > + > +; These tests differ from the ones in zext-inreg-0.ll in that > +; on x86-64 they do require and instructions. > + > +; These should use movzbl instead of 'and 255'. > +; This related to not having ZERO_EXTEND_REG node. > + > +define i64 @g(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 1099511627775 > + ret i64 %retval > +} > +define i64 @h(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 281474976710655 > + ret i64 %retval > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From evan.cheng at apple.com Mon Jul 28 19:18:22 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jul 2008 17:18:22 -0700 Subject: [llvm-commits] [llvm] r54147 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll In-Reply-To: <16e5fdf90807281538l2c986f9m31c7deb91ce9bb4c@mail.gmail.com> References: <200807282218.m6SMIQpB024215@zion.cs.uiuc.edu> <16e5fdf90807281538l2c986f9m31c7deb91ce9bb4c@mail.gmail.com> Message-ID: This looks like a coalescing issue. Please reduce it down and file a bug. Unfortunately, this patch cannot go in until that's resolved. Evan On Jul 28, 2008, at 3:38 PM, Bill Wendling wrote: > Dan, > > A bootstrap build is failing with this: > > /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/xgcc > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/ > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386- > apple-darwin9.4.0/bin/ > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386- > apple-darwin9.4.0/lib/ > -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm- > gcc.install/i386-apple-darwin9.4.0/include > -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm- > gcc.install/i386-apple-darwin9.4.0/sys-include > -mmacosx-version-min=10.4 -O2 -O2 -g -O2 -DIN_GCC -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes > -Wold-style-definition -isystem ./include -fPIC -pipe -g > -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. > -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. > -I../../llvm-gcc.src/gcc/../include -I./../intl > -I../../llvm-gcc.src/gcc/../libcpp/include > -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber > -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm.obj/include > -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm/include -DL_paritydi2 > -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/libgcc2.c > -o libgcc/./_paritydi2.o > {standard input}:20:bad register name `%sil' > /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/xgcc > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.obj/./gcc/ > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386- > apple-darwin9.4.0/bin/ > -B/Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm-gcc.install/i386- > apple-darwin9.4.0/lib/ > -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm- > gcc.install/i386-apple-darwin9.4.0/include > -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm-gcc/llvm- > gcc.install/i386-apple-darwin9.4.0/sys-include > -mmacosx-version-min=10.4 -O2 -O2 -g -O2 -DIN_GCC -W -Wall > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes > -Wold-style-definition -isystem ./include -fPIC -pipe -g > -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. > -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. > -I../../llvm-gcc.src/gcc/../include -I./../intl > -I../../llvm-gcc.src/gcc/../libcpp/include > -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber > -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm.obj/include > -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/llvm/include -DL_powisf2 > -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/libgcc2.c > -o libgcc/./_powisf2.o > make[4]: *** [libgcc/./_popcountsi2.o] Error 1 > make[4]: *** Waiting for unfinished jobs.... > {standard input}:20:bad register name `%sil' > {standard input}:42:bad register name `%sil' > make[4]: *** [libgcc/./_popcountdi2.o] Error 1 > make[3]: *** [stmp-multilib] Error 2 > make[2]: *** [all-stage1-gcc] Error 2 > make[1]: *** [stage1-bubble] Error 2 > make: *** [all] Error 2 > > > -bw > > On Mon, Jul 28, 2008 at 3:18 PM, Dan Gohman wrote: >> Author: djg >> Date: Mon Jul 28 17:18:25 2008 >> New Revision: 54147 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=54147&view=rev >> Log: >> Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG >> operation, >> which is represented in codegen as an 'and' operation. This matches >> them >> with movz instructions, instead of leaving them to be matched by and >> instructions with an immediate field. >> >> Added: >> llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll >> llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll >> Modified: >> llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h >> llvm/trunk/lib/Target/X86/X86Instr64bit.td >> llvm/trunk/lib/Target/X86/X86InstrInfo.td >> >> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54147&r1=54146&r2=54147&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) >> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jul 28 >> 17:18:25 2008 >> @@ -377,6 +377,8 @@ >> // extending the low 8 bits of a 32-bit register to fill the top >> 24 bits >> // with the 7th bit). The size of the smaller type is indicated >> by the 1th >> // operand, a ValueType node. >> + // Note that there is intentionally no corresponding >> ZERO_EXTEND_INREG; an >> + // AND with an appropriate constant is used instead. >> SIGN_EXTEND_INREG, >> >> /// FP_TO_[US]INT - Convert a floating point value to a signed >> or unsigned >> >> Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54147&r1=54146&r2=54147&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) >> +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jul 28 17:18:25 >> 2008 >> @@ -1240,6 +1240,12 @@ >> (SUBREG_TO_REG (i64 0), >> (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), >> x86_subreg_32bit)>; >> +// r & (2^16-1) ==> movz >> +def : Pat<(and GR64:$src, 0xffff), >> + (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, >> x86_subreg_16bit)))>; >> +// r & (2^8-1) ==> movz >> +def : Pat<(and GR64:$src, 0xff), >> + (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, >> x86_subreg_8bit)))>; >> >> // (shl x, 1) ==> (add x, x) >> def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, >> GR64:$src1)>; >> >> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54147&r1=54146&r2=54147&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Jul 28 17:18:25 >> 2008 >> @@ -2763,6 +2763,16 @@ >> // Some peepholes >> // >> = >> = >> = >> ----------------------------------------------------------------------= >> ==// >> >> +// r & (2^16-1) ==> movz >> +def : Pat<(and GR32:$src1, 0xffff), >> + (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, >> x86_subreg_16bit)))>; >> +// r & (2^8-1) ==> movz >> +def : Pat<(and GR32:$src1, 0xff), >> + (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, >> x86_subreg_8bit)))>; >> +// r & (2^8-1) ==> movz >> +def : Pat<(and GR16:$src1, 0xff), >> + (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, >> x86_subreg_8bit)))>; >> + >> // (shl x, 1) ==> (add x, x) >> def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 : >> $src1)>; >> def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, >> GR16:$src1)>; >> >> Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54147&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Mon Jul 28 17:18:25 >> 2008 >> @@ -0,0 +1,62 @@ >> +; RUN: llvm-as < %s | llc -march=x86 | not grep and >> +; RUN: llvm-as < %s | llc -march=x86-64 | not grep and >> + >> +; These should use movzbl instead of 'and 255'. >> +; This related to not having a ZERO_EXTEND_REG opcode. >> + >> +define i32 @a(i32 %d) nounwind { >> + %e = add i32 %d, 1 >> + %retval = and i32 %e, 255 >> + ret i32 %retval >> +} >> +define i32 @b(float %d) nounwind { >> + %tmp12 = fptoui float %d to i8 >> + %retval = zext i8 %tmp12 to i32 >> + ret i32 %retval >> +} >> +define i32 @c(i32 %d) nounwind { >> + %e = add i32 %d, 1 >> + %retval = and i32 %e, 65535 >> + ret i32 %retval >> +} >> +define i64 @d(i64 %d) nounwind { >> + %e = add i64 %d, 1 >> + %retval = and i64 %e, 255 >> + ret i64 %retval >> +} >> +define i64 @e(i64 %d) nounwind { >> + %e = add i64 %d, 1 >> + %retval = and i64 %e, 65535 >> + ret i64 %retval >> +} >> +define i64 @f(i64 %d) nounwind { >> + %e = add i64 %d, 1 >> + %retval = and i64 %e, 4294967295 >> + ret i64 %retval >> +} >> + >> +define i32 @g(i8 %d) nounwind { >> + %e = add i8 %d, 1 >> + %retval = zext i8 %e to i32 >> + ret i32 %retval >> +} >> +define i32 @h(i16 %d) nounwind { >> + %e = add i16 %d, 1 >> + %retval = zext i16 %e to i32 >> + ret i32 %retval >> +} >> +define i64 @i(i8 %d) nounwind { >> + %e = add i8 %d, 1 >> + %retval = zext i8 %e to i64 >> + ret i64 %retval >> +} >> +define i64 @j(i16 %d) nounwind { >> + %e = add i16 %d, 1 >> + %retval = zext i16 %e to i64 >> + ret i64 %retval >> +} >> +define i64 @k(i32 %d) nounwind { >> + %e = add i32 %d, 1 >> + %retval = zext i32 %e to i64 >> + ret i64 %retval >> +} >> >> Added: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54147&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Mon Jul 28 17:18:25 >> 2008 >> @@ -0,0 +1,18 @@ >> +; RUN: llvm-as < %s | llc -march=x86 | not grep and >> + >> +; These tests differ from the ones in zext-inreg-0.ll in that >> +; on x86-64 they do require and instructions. >> + >> +; These should use movzbl instead of 'and 255'. >> +; This related to not having ZERO_EXTEND_REG node. >> + >> +define i64 @g(i64 %d) nounwind { >> + %e = add i64 %d, 1 >> + %retval = and i64 %e, 1099511627775 >> + ret i64 %retval >> +} >> +define i64 @h(i64 %d) nounwind { >> + %e = add i64 %d, 1 >> + %retval = and i64 %e, 281474976710655 >> + ret i64 %retval >> +} >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Jul 28 20:02:18 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 29 Jul 2008 01:02:18 -0000 Subject: [llvm-commits] [llvm] r54148 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll Message-ID: <200807290102.m6T12JpI029385@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 28 20:02:18 2008 New Revision: 54148 URL: http://llvm.org/viewvc/llvm-project?rev=54148&view=rev Log: Revert 54147. Removed: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54148&r1=54147&r2=54148&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jul 28 20:02:18 2008 @@ -377,8 +377,6 @@ // extending the low 8 bits of a 32-bit register to fill the top 24 bits // with the 7th bit). The size of the smaller type is indicated by the 1th // operand, a ValueType node. - // Note that there is intentionally no corresponding ZERO_EXTEND_INREG; an - // AND with an appropriate constant is used instead. SIGN_EXTEND_INREG, /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54148&r1=54147&r2=54148&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jul 28 20:02:18 2008 @@ -1240,12 +1240,6 @@ (SUBREG_TO_REG (i64 0), (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), x86_subreg_32bit)>; -// r & (2^16-1) ==> movz -def : Pat<(and GR64:$src, 0xffff), - (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)))>; -// r & (2^8-1) ==> movz -def : Pat<(and GR64:$src, 0xff), - (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)))>; // (shl x, 1) ==> (add x, x) def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54148&r1=54147&r2=54148&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Jul 28 20:02:18 2008 @@ -2763,16 +2763,6 @@ // Some peepholes //===----------------------------------------------------------------------===// -// r & (2^16-1) ==> movz -def : Pat<(and GR32:$src1, 0xffff), - (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, x86_subreg_16bit)))>; -// r & (2^8-1) ==> movz -def : Pat<(and GR32:$src1, 0xff), - (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, x86_subreg_8bit)))>; -// r & (2^8-1) ==> movz -def : Pat<(and GR16:$src1, 0xff), - (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, x86_subreg_8bit)))>; - // (shl x, 1) ==> (add x, x) def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; Removed: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54147&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (original) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (removed) @@ -1,62 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | not grep and -; RUN: llvm-as < %s | llc -march=x86-64 | not grep and - -; These should use movzbl instead of 'and 255'. -; This related to not having a ZERO_EXTEND_REG opcode. - -define i32 @a(i32 %d) nounwind { - %e = add i32 %d, 1 - %retval = and i32 %e, 255 - ret i32 %retval -} -define i32 @b(float %d) nounwind { - %tmp12 = fptoui float %d to i8 - %retval = zext i8 %tmp12 to i32 - ret i32 %retval -} -define i32 @c(i32 %d) nounwind { - %e = add i32 %d, 1 - %retval = and i32 %e, 65535 - ret i32 %retval -} -define i64 @d(i64 %d) nounwind { - %e = add i64 %d, 1 - %retval = and i64 %e, 255 - ret i64 %retval -} -define i64 @e(i64 %d) nounwind { - %e = add i64 %d, 1 - %retval = and i64 %e, 65535 - ret i64 %retval -} -define i64 @f(i64 %d) nounwind { - %e = add i64 %d, 1 - %retval = and i64 %e, 4294967295 - ret i64 %retval -} - -define i32 @g(i8 %d) nounwind { - %e = add i8 %d, 1 - %retval = zext i8 %e to i32 - ret i32 %retval -} -define i32 @h(i16 %d) nounwind { - %e = add i16 %d, 1 - %retval = zext i16 %e to i32 - ret i32 %retval -} -define i64 @i(i8 %d) nounwind { - %e = add i8 %d, 1 - %retval = zext i8 %e to i64 - ret i64 %retval -} -define i64 @j(i16 %d) nounwind { - %e = add i16 %d, 1 - %retval = zext i16 %e to i64 - ret i64 %retval -} -define i64 @k(i32 %d) nounwind { - %e = add i32 %d, 1 - %retval = zext i32 %e to i64 - ret i64 %retval -} Removed: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54147&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (removed) @@ -1,18 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | not grep and - -; These tests differ from the ones in zext-inreg-0.ll in that -; on x86-64 they do require and instructions. - -; These should use movzbl instead of 'and 255'. -; This related to not having ZERO_EXTEND_REG node. - -define i64 @g(i64 %d) nounwind { - %e = add i64 %d, 1 - %retval = and i64 %e, 1099511627775 - ret i64 %retval -} -define i64 @h(i64 %d) nounwind { - %e = add i64 %d, 1 - %retval = and i64 %e, 281474976710655 - ret i64 %retval -} From isanbard at gmail.com Mon Jul 28 21:08:38 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 02:08:38 -0000 Subject: [llvm-commits] [llvm] r54149 - /llvm/tags/Apple/llvmCore-2060/ Message-ID: <200807290208.m6T28ceN031386@zion.cs.uiuc.edu> Author: void Date: Mon Jul 28 21:08:38 2008 New Revision: 54149 URL: http://llvm.org/viewvc/llvm-project?rev=54149&view=rev Log: Creating llvmCore-2060 branch Added: llvm/tags/Apple/llvmCore-2060/ - copied from r54148, llvm/trunk/ From isanbard at gmail.com Mon Jul 28 21:08:44 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 02:08:44 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54150 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2060/ Message-ID: <200807290208.m6T28jK1031400@zion.cs.uiuc.edu> Author: void Date: Mon Jul 28 21:08:44 2008 New Revision: 54150 URL: http://llvm.org/viewvc/llvm-project?rev=54150&view=rev Log: Creating llvmgcc42-2060 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2060/ - copied from r54149, llvm-gcc-4.2/trunk/ From evan.cheng at apple.com Tue Jul 29 02:38:32 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 29 Jul 2008 07:38:32 -0000 Subject: [llvm-commits] [llvm] r54152 - /llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Message-ID: <200807290738.m6T7cWSQ008631@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 29 02:38:32 2008 New Revision: 54152 URL: http://llvm.org/viewvc/llvm-project?rev=54152&view=rev Log: Fix for PR2578. Do not split off a block whose size is less than FreeRangeHeader::getMinBlockSize(). Patch by Damien. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp?rev=54152&r1=54151&r2=54152&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Tue Jul 29 02:38:32 2008 @@ -202,6 +202,9 @@ assert(ThisAllocated && getBlockAfter().PrevAllocated && "Cannot deallocate part of an allocated block!"); + // Don't allow blocks to be trimmed below minimum required size + NewSize = std::max(FreeRangeHeader::getMinBlockSize(), NewSize); + // Round up size for alignment of header. unsigned HeaderAlign = __alignof(FreeRangeHeader); NewSize = (NewSize+ (HeaderAlign-1)) & ~(HeaderAlign-1); From isanbard at gmail.com Tue Jul 29 03:14:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 08:14:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54153 - in /llvm-gcc-4.2/trunk/libiberty: make-temp-file.c pex-unix.c Message-ID: <200807290814.m6T8EA6M010045@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 03:14:09 2008 New Revision: 54153 URL: http://llvm.org/viewvc/llvm-project?rev=54153&view=rev Log: Update to GCC 4.2 TOT from r142930. Modified: llvm-gcc-4.2/trunk/libiberty/make-temp-file.c llvm-gcc-4.2/trunk/libiberty/pex-unix.c Modified: llvm-gcc-4.2/trunk/libiberty/make-temp-file.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libiberty/make-temp-file.c?rev=54153&r1=54152&r2=54153&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libiberty/make-temp-file.c (original) +++ llvm-gcc-4.2/trunk/libiberty/make-temp-file.c Tue Jul 29 03:14:09 2008 @@ -35,6 +35,12 @@ #ifdef HAVE_SYS_FILE_H #include /* May get R_OK, etc. on some systems. */ #endif +/* APPLE LOCAL begin mainline candidate */ +#include +#ifdef NEED_DECLARATION_ERRNO +extern int errno; +#endif +/* APPLE LOCAL end mainline candidate */ #ifndef R_OK #define R_OK 4 @@ -166,12 +172,21 @@ strcpy (temp_filename + base_len + TEMP_FILE_LEN, suffix); fd = mkstemps (temp_filename, suffix_len); - /* If mkstemps failed, then something bad is happening. Maybe we should - issue a message about a possible security attack in progress? */ + + /* APPLE LOCAL begin mainline candidate */ + /* If mkstemps failed something bad is happening, send an error message + and exit. */ if (fd == -1) - abort (); + { + fprintf (stderr, "Failed to open temp file in %s, error: %s\n", base, xstrerror(errno)); + xexit (1); + } /* Similarly if we can not close the file. */ if (close (fd)) - abort (); + { + fprintf (stderr, "Failed to close temp file in %s, error: %s\n", base, xstrerror(errno)); + xexit (1); + } + /* APPLE LOCAL end mainline candidate */ return temp_filename; } Modified: llvm-gcc-4.2/trunk/libiberty/pex-unix.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libiberty/pex-unix.c?rev=54153&r1=54152&r2=54153&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libiberty/pex-unix.c (original) +++ llvm-gcc-4.2/trunk/libiberty/pex-unix.c Tue Jul 29 03:14:09 2008 @@ -84,21 +84,15 @@ time that it took. This is simple if we have wait4, slightly harder if we have waitpid, and is a pain if we only have wait. */ -/* LLVM LOCAL begin mainline */ static pid_t pex_wait (struct pex_obj *, pid_t, int *, struct pex_time *); -/* LLVM LOCAL end mainline */ #ifdef HAVE_WAIT4 -/* LLVM LOCAL begin mainline */ static pid_t pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status, -/* LLVM LOCAL end mainline */ struct pex_time *time) { - /* LLVM LOCAL begin mainline */ pid_t ret; - /* LLVM LOCAL end mainline */ struct rusage r; #ifdef HAVE_WAITPID @@ -125,10 +119,8 @@ #ifndef HAVE_GETRUSAGE -/* LLVM LOCAL begin mainline */ static pid_t pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status, -/* LLVM LOCAL end mainline */ struct pex_time *time) { if (time != NULL) @@ -138,16 +130,12 @@ #else /* defined (HAVE_GETRUSAGE) */ -/* LLVM LOCAL begin mainline */ static pid_t pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status, -/* LLVM LOCAL end mainline */ struct pex_time *time) { struct rusage r1, r2; - /* LLVM LOCAL begin mainline */ pid_t ret; - /* LLVM LOCAL end mainline */ if (time == NULL) return waitpid (pid, status, 0); @@ -186,17 +174,13 @@ struct status_list { struct status_list *next; - /* LLVM LOCAL begin mainline */ pid_t pid; - /* LLVM LOCAL end mainline */ int status; struct pex_time time; }; -/* LLVM LOCAL begin mainline */ static pid_t pex_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time) -/* LLVM LOCAL end mainline */ { struct status_list **pp; @@ -220,9 +204,7 @@ while (1) { - /* LLVM LOCAL begin mainline */ pid_t cpid; - /* LLVM LOCAL end mainline */ struct status_list *psl; struct pex_time pt; #ifdef HAVE_GETRUSAGE @@ -385,9 +367,7 @@ int in, int out, int errdes, int toclose, const char **errmsg, int *err) { - /* LLVM LOCAL begin mainline */ pid_t pid; - /* LLVM LOCAL end mainline */ /* We declare these to be volatile to avoid warnings from gcc about them being clobbered by vfork. */ From isanbard at gmail.com Tue Jul 29 03:22:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 08:22:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54154 - in /llvm-gcc-4.2/trunk/more-hdrs: ppc_intrinsics.h stdint.h Message-ID: <200807290822.m6T8MJZx010397@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 03:22:19 2008 New Revision: 54154 URL: http://llvm.org/viewvc/llvm-project?rev=54154&view=rev Log: Update to GCC 4.2 TOT from r142930: - Remove C++ guards. - Rename variables. Modified: llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h llvm-gcc-4.2/trunk/more-hdrs/stdint.h Modified: llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h?rev=54154&r1=54153&r2=54154&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h (original) +++ llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h Tue Jul 29 03:22:19 2008 @@ -216,9 +216,9 @@ * int __lhbrx(void *, int); */ #define __lhbrx(base, index) \ - ({ unsigned short lhbrxResult; \ - __asm__ volatile ("lhbrx %0, %1, %2" : "=r" (lhbrxResult) : "b%" (index), "r" (base) : "memory"); \ - /*return*/ lhbrxResult; }) + ({ unsigned short __ppc_i_lhbrxResult; \ + __asm__ volatile ("lhbrx %0, %1, %2" : "=r" (__ppc_i_lhbrxResult) : "b%" (index), "r" (base) : "memory"); \ + /*return*/ __ppc_i_lhbrxResult; }) /* * __lwbrx - Load Word Byte-Reverse Indexed @@ -226,9 +226,9 @@ * int __lwbrx(void *, int); */ #define __lwbrx(base, index) \ - ({ unsigned int lwbrxResult; \ - __asm__ volatile ("lwbrx %0, %1, %2" : "=r" (lwbrxResult) : "b%" (index), "r" (base) : "memory"); \ - /*return*/ lwbrxResult; }) + ({ unsigned int __ppc_i_lwbrxResult; \ + __asm__ volatile ("lwbrx %0, %1, %2" : "=r" (__ppc_i_lwbrxResult) : "b%" (index), "r" (base) : "memory"); \ + /*return*/ __ppc_i_lwbrxResult; }) /* * __sthbrx - Store Half Word Byte-Reverse Indexed @@ -278,22 +278,22 @@ * * int __rlwinm(long, int, int, int); */ -#define __rlwinm(rS, cnt, mb, me) \ - ({ unsigned int val; \ - __asm__ ("rlwinm %0,%1,%2,%3,%4" : "=r" (val) \ - : "r" (rS), "n" (cnt), "n" (mb), "n" (me)); \ - /*return*/ val;}) +#define __rlwinm(rS, cnt, mb, me) \ + ({ unsigned int __ppc_i_val; \ + __asm__ ("rlwinm %0,%1,%2,%3,%4" : "=r" (__ppc_i_val) \ + : "r" (rS), "n" (cnt), "n" (mb), "n" (me)); \ + /*return*/ __ppc_i_val;}) /* * __rlwnm - Rotate Left Word then AND with Mask * * int __rlwnm(long, int, int, int); */ -#define __rlwnm(value, leftRotateBits, maskStart, maskEnd) \ - ({ unsigned int result; \ - __asm__ ("rlwnm %0, %1, %2, %3, %4" : "=r" (result) : \ +#define __rlwnm(value, leftRotateBits, maskStart, maskEnd) \ + ({ unsigned int __ppc_i_result; \ + __asm__ ("rlwnm %0, %1, %2, %3, %4" : "=r" (__ppc_i_result) : \ "r" (value), "r" (leftRotateBits), "n" (maskStart), "n" (maskEnd)); \ - /*return */ result; }) + /*return */ __ppc_i_result; }) /******************************************************************* @@ -930,10 +930,10 @@ * * int __mfspr(int); */ -#define __mfspr(spr) \ - __extension__ ({ long mfsprResult; \ - __asm__ volatile ("mfspr %0, %1" : "=r" (mfsprResult) : "n" (spr)); \ - /*return*/ mfsprResult; }) +#define __mfspr(spr) \ + __extension__ ({ long __ppc_i_mfsprResult; \ + __asm__ volatile ("mfspr %0, %1" : "=r" (__ppc_i_mfsprResult) : "n" (spr)); \ + /*return*/ __ppc_i_mfsprResult; }) /* * __mtfsf - Move to SPSCR Fields Modified: llvm-gcc-4.2/trunk/more-hdrs/stdint.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/more-hdrs/stdint.h?rev=54154&r1=54153&r2=54154&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/more-hdrs/stdint.h (original) +++ llvm-gcc-4.2/trunk/more-hdrs/stdint.h Tue Jul 29 03:22:19 2008 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, 2003, 2004 Apple Computer, Inc. + * Copyright (c) 2000, 2001, 2003, 2004, 2008 Apple Computer, Inc. * All rights reserved. */ @@ -109,15 +109,6 @@ #endif /* __UINTMAX_TYPE__ */ #endif /* _UINTMAX_T */ -/* "C++ implementations should define these macros only when - * __STDC_LIMIT_MACROS is defined before is included." - * In other words, if C++, then __STDC_LIMIT_MACROS enables the - * macros below. (Note that there also exists a different enabling - * macro (__STDC_CONSTANT_MACROS) for the last few, below.) - */ -#if (! defined(__cplusplus)) || defined(__STDC_LIMIT_MACROS) - - /* 7.18.2 Limits of specified-width integer types: * These #defines specify the minimum and maximum limits * of each of the types declared above. @@ -245,13 +236,6 @@ #define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX -#endif /* if C++, then __STDC_LIMIT_MACROS enables the above macros */ - -/* "C++ implementations should define these macros only when - * __STDC_CONSTANT_MACROS is defined before is included." - */ -#if (! defined(__cplusplus)) || defined(__STDC_CONSTANT_MACROS) - /* 7.18.4 Macros for integer constants */ #define INT8_C(v) (v) #define INT16_C(v) (v) @@ -266,6 +250,4 @@ #define INTMAX_C(v) (v ## LL) #define UINTMAX_C(v) (v ## ULL) -#endif /* if C++, then __STDC_CONSTANT_MACROS enables the above macros */ - #endif /* _STDINT_H_ */ From isanbard at gmail.com Tue Jul 29 03:24:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 08:24:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54155 - in /llvm-gcc-4.2/trunk/libcpp: ChangeLog.apple charset.c include/cpplib.h Message-ID: <200807290824.m6T8OJwJ010491@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 03:24:19 2008 New Revision: 54155 URL: http://llvm.org/viewvc/llvm-project?rev=54155&view=rev Log: Update to GCC 4.2 TOT from r142930. - Eat UTF-8 BOM. Modified: llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple llvm-gcc-4.2/trunk/libcpp/charset.c llvm-gcc-4.2/trunk/libcpp/include/cpplib.h Modified: llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple?rev=54155&r1=54154&r2=54155&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple Tue Jul 29 03:24:19 2008 @@ -1,3 +1,8 @@ +2008-05-01 Mike Stump + + Radar 5774975 + * charset.c (_cpp_convert_input): Eat UTF-8 BOM. + 2007-05-17 Fariborz Jahanian Radar 2996215 Modified: llvm-gcc-4.2/trunk/libcpp/charset.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/charset.c?rev=54155&r1=54154&r2=54155&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/charset.c (original) +++ llvm-gcc-4.2/trunk/libcpp/charset.c Tue Jul 29 03:24:19 2008 @@ -1650,6 +1650,17 @@ input_cset = init_iconv_desc (pfile, SOURCE_CHARSET, input_charset); if (input_cset.func == convert_no_conversion) { + /* APPLE LOCAL begin UTF-8 BOM 5774975 */ + /* Eat the UTF-8 BOM. */ + if (len >= 3 + && input[0] == 0xef + && input[1] == 0xbb + && input[2] == 0xbf) + { + memmove (&input[0], &input[3], size-3); + len -= 3; + } + /* APPLE LOCAL end UTF-8 BOM 5774975 */ to.text = input; to.asize = size; to.len = len; Modified: llvm-gcc-4.2/trunk/libcpp/include/cpplib.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/include/cpplib.h?rev=54155&r1=54154&r2=54155&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/include/cpplib.h (original) +++ llvm-gcc-4.2/trunk/libcpp/include/cpplib.h Tue Jul 29 03:24:19 2008 @@ -926,13 +926,13 @@ struct hmap_header_map { - uint32_t magic; /* Magic word, also indicates byte order */ - uint16_t version; /* Version number -- currently 1 */ - uint16_t _reserved; /* Reserved for future use -- zero for now */ - uint32_t strings_offset; /* Offset to start of string pool */ - uint32_t count; /* Number of entries in the string table */ - uint32_t capacity; /* Number of buckets (always a power of 2) */ - uint32_t max_value_length; /* Length of longest result path (excl. '\0') */ + uint32_t magic; /* Magic word, also indicates byte order */ + uint16_t version; /* Version number -- currently 1 */ + uint16_t _reserved; /* Reserved for future use -- zero for now */ + uint32_t strings_offset; /* Offset to start of string pool */ + uint32_t count; /* Number of entries in the string table */ + uint32_t capacity; /* Number of buckets (always a power of 2) */ + uint32_t max_value_length; /* Length of longest result path (excl. '\0') */ struct hmap_bucket buckets[1]; /* Inline array of 'capacity' maptable buckets */ /* Strings follow the buckets, at strings_offset. */ }; From isanbard at gmail.com Tue Jul 29 03:24:54 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 08:24:54 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54156 - /llvm-gcc-4.2/trunk/include/ansidecl.h Message-ID: <200807290824.m6T8OsMS010520@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 03:24:54 2008 New Revision: 54156 URL: http://llvm.org/viewvc/llvm-project?rev=54156&view=rev Log: Whitespace cleanup Modified: llvm-gcc-4.2/trunk/include/ansidecl.h Modified: llvm-gcc-4.2/trunk/include/ansidecl.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/include/ansidecl.h?rev=54156&r1=54155&r2=54156&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/include/ansidecl.h (original) +++ llvm-gcc-4.2/trunk/include/ansidecl.h Tue Jul 29 03:24:54 2008 @@ -136,7 +136,7 @@ #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) #endif /* GCC_VERSION */ -#if defined( __STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus)) +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus)) /* All known AIX compilers implement these things (but don't always define __STDC__). The RISC/OS MIPS compiler defines these things in SVR4 mode, but does not define __STDC__. */ From m.kooijman at student.utwente.nl Tue Jul 29 03:30:29 2008 From: m.kooijman at student.utwente.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 10:30:29 +0200 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp In-Reply-To: <488E1C1D.5040400@tut.fi> References: <488E1C1D.5040400@tut.fi> Message-ID: <20080729083029.GB8220@katherina.student.utwente.nl> Hi Mikael, I looked at the patch and it looks useful and a good addition to the unroll pass. I do have a few comments, I've added them inline below. > @@ -136,9 +142,21 @@ > DOUT << " Loop Size = " << LoopSize << "\n"; > uint64_t Size = (uint64_t)LoopSize*Count; > if (TripCount != 1 && Size > UnrollThreshold) { > - DOUT << " TOO LARGE TO UNROLL: " > - << Size << ">" << UnrollThreshold << "\n"; > - return false; > + DOUT << " TOO LARGE TO UNROLL COMPLETELY WITH COUNT: " << Count > + << " Size: " << Size << ">" << UnrollThreshold << "\n"; I think that, when UnrollAllowPartial is false, the new DOUT message could be a bit confusing. Perhaps the old message should be shown in that case, or an extra message ("BUT NOT ATTEMPTING PARTIAL UNROLL BECAUSE -unroll-allow-partial NOT GIVEN" or something like that) added. > + // Reduce unroll count to be modulo of TripCount for partial unrolling > + Count = UnrollThreshold / LoopSize; > + while (Count != 0 && TripCount%Count != 0) { > + Count--; > + } > + > + if (!UnrollAllowPartial || Count < 2) { I think this !UnrollAllowPartial check should be moved upwards, since it's not useful to calculate Count when you're not going to use it anyway. > + DOUT << " COULD NOT UNROLL PARTIALLY\n"; > + return false; > + } else { > + DOUT << " REDUCED UNROLL COUNT TO: " << Count << "\n"; > + } Lastly, could you add a DejaGNU test as well, that tests this functionality? This allows us to detect changes that break this unrolling in the future automatically. See http://www.llvm.org/docs/TestingGuide.html for more info. Gr. Matthijs From matthijs at stdin.nl Tue Jul 29 03:46:12 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 08:46:12 -0000 Subject: [llvm-commits] [llvm] r54157 - in /llvm/trunk: include/llvm/Instructions.h lib/VMCore/Instructions.cpp Message-ID: <200807290846.m6T8kCgS011242@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 29 03:46:11 2008 New Revision: 54157 URL: http://llvm.org/viewvc/llvm-project?rev=54157&view=rev Log: Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s. Modified: llvm/trunk/include/llvm/Instructions.h llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=54157&r1=54156&r2=54157&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Jul 29 03:46:11 2008 @@ -408,9 +408,6 @@ /// Null is returned if the indices are invalid for the specified /// pointer type. /// - static const Type *getIndexedType(const Type *Ptr, - Value* const *Idx, unsigned NumIdx); - template static const Type *getIndexedType(const Type *Ptr, InputIterator IdxBegin, @@ -509,6 +506,13 @@ typename std::iterator_traits:: iterator_category()); } + + static const Type *getIndexedType(const Type *Ptr, + Value* const *Idx, unsigned NumIdx); + + static const Type *getIndexedType(const Type *Ptr, + uint64_t const *Idx, unsigned NumIdx); + static const Type *getIndexedType(const Type *Ptr, Value *Idx); inline op_iterator idx_begin() { return op_begin()+1; } Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=54157&r1=54156&r2=54157&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Jul 29 03:46:11 2008 @@ -1026,12 +1026,16 @@ // getIndexedType - Returns the type of the element that would be loaded with // a load instruction with the specified parameters. // +// The Idxs pointer should point to a continuous piece of memory containing the +// indices, either as Value* or uint64_t. +// // A null type is returned if the indices are invalid for the specified // pointer type. // -const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, - Value* const *Idxs, - unsigned NumIdx) { +template +static const Type* getIndexedTypeInternal(const Type *Ptr, + IndexTy const *Idxs, + unsigned NumIdx) { const PointerType *PTy = dyn_cast(Ptr); if (!PTy) return 0; // Type isn't a pointer type! const Type *Agg = PTy->getElementType(); @@ -1044,7 +1048,7 @@ for (; CurIdx != NumIdx; ++CurIdx) { const CompositeType *CT = dyn_cast(Agg); if (!CT || isa(CT)) return 0; - Value *Index = Idxs[CurIdx]; + IndexTy Index = Idxs[CurIdx]; if (!CT->indexValid(Index)) return 0; Agg = CT->getTypeAtIndex(Index); @@ -1058,6 +1062,18 @@ return CurIdx == NumIdx ? Agg : 0; } +const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, + Value* const *Idxs, + unsigned NumIdx) { + return getIndexedTypeInternal(Ptr, Idxs, NumIdx); +} + +const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, + uint64_t const *Idxs, + unsigned NumIdx) { + return getIndexedTypeInternal(Ptr, Idxs, NumIdx); +} + const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) { const PointerType *PTy = dyn_cast(Ptr); if (!PTy) return 0; // Type isn't a pointer type! From matthijs at stdin.nl Tue Jul 29 03:55:30 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 08:55:30 -0000 Subject: [llvm-commits] [llvm] r54158 - /llvm/trunk/tools/bugpoint/CrashDebugger.cpp Message-ID: <200807290855.m6T8tU12011543@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 29 03:55:30 2008 New Revision: 54158 URL: http://llvm.org/viewvc/llvm-project?rev=54158&view=rev Log: Improve bugpoint output a bit by outputting the actual instructions instead of just it's name, which is often empty. Also remove a newline from the output that wasn't really needed. Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=54158&r1=54157&r2=54158&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Tue Jul 29 03:55:30 2008 @@ -469,7 +469,7 @@ } else { if (BugpointIsInterrupted) goto ExitLoops; - std::cout << "Checking instruction '" << I->getName() << "': "; + std::cout << "Checking instruction: " << *I; Module *M = BD.deleteInstructionFromProgram(I, Simplification); // Find out if the pass still crashes on this pass... @@ -539,7 +539,6 @@ static bool TestForCodeGenCrash(BugDriver &BD, Module *M) { try { - std::cerr << '\n'; BD.compileProgram(M); std::cerr << '\n'; return false; From matthijs at stdin.nl Tue Jul 29 05:00:14 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 10:00:14 -0000 Subject: [llvm-commits] [llvm] r54159 - in /llvm/trunk: lib/Transforms/IPO/ArgumentPromotion.cpp test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll Message-ID: <200807291000.m6TA0FJC017685@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 29 05:00:13 2008 New Revision: 54159 URL: http://llvm.org/viewvc/llvm-project?rev=54159&view=rev Log: Restructure ArgumentPromotion a bit. Instead of just having a single boolean that says "unconditional loads from this argument are safe", we now keep track of the safety per set of indices from which loads happen. This prevents ArgPromotion from promoting loads that aren't really valid. As an added effect, this will now disregard the the type of the indices passed to a GEP, so "load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument, not two. This fixes PR2598, for which a testcase has been added as well. Added: llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=54159&r1=54158&r2=54159&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Tue Jul 29 05:00:13 2008 @@ -17,10 +17,10 @@ // // This pass also handles aggregate arguments that are passed into a function, // scalarizing them if the elements of the aggregate are only loaded. Note that -// by default it refuses to scalarize aggregates which would require passing in more than -// three operands to the function, because passing thousands of operands for a -// large array or structure is unprofitable! This limit is can be configured or -// disabled, however. +// by default it refuses to scalarize aggregates which would require passing in +// more than three operands to the function, because passing thousands of +// operands for a large array or structure is unprofitable! This limit is can be +// configured or disabled, however. // // Note that this transformation could also be done for arguments that are only // stored to (returning the value instead), but does not currently. This case @@ -68,6 +68,9 @@ static char ID; // Pass identification, replacement for typeid ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), maxElements(maxElements) {} + + /// A vector used to hold the indices of a single GEP instruction + typedef std::vector IndicesVector; private: bool PromoteArguments(CallGraphNode *CGN); @@ -222,6 +225,72 @@ return true; } +/// Returns true if Prefix is a prefix of longer. That means, Longer has a size +/// that is greater than or equal to the size of prefix, and each of the +/// elements in Prefix is the same as the corresponding elements in Longer. +/// +/// This means it also returns true when Prefix and Longer are equal! +static bool IsPrefix(const ArgPromotion::IndicesVector &Prefix, + const ArgPromotion::IndicesVector &Longer) { + if (Prefix.size() > Longer.size()) + return false; + for (unsigned i = 0, e = Prefix.size(); i != e; ++i) + if (Prefix[i] != Longer[i]) + return false; + return true; +} + + +/// Checks if Indices, or a prefix of Indices, is in Set. +static bool PrefixIn(const ArgPromotion::IndicesVector &Indices, + std::set &Set) { + std::set::iterator Low; + Low = Set.upper_bound(Indices); + if (Low != Set.begin()) + Low--; + // Low is now the last element smaller than or equal to Indices. This means + // it points to a prefix of Indices (possibly Indices itself), if such + // prefix exists. + // + // This load is safe if any prefix of its operands is safe to load. + return Low != Set.end() && IsPrefix(*Low, Indices); +} + +/// Mark the given indices (ToMark) as safe in the the given set of indices +/// (Safe). Marking safe usually means adding ToMark to Safe. However, if there +/// is already a prefix of Indices in Safe, Indices are implicitely marked safe +/// already. Furthermore, any indices that Indices is itself a prefix of, are +/// removed from Safe (since they are implicitely safe because of Indices now). +static void MarkIndicesSafe(const ArgPromotion::IndicesVector &ToMark, + std::set &Safe) { + std::set::iterator Low; + Low = Safe.upper_bound(ToMark); + // Guard against the case where Safe is empty + if (Low != Safe.begin()) + Low--; + // Low is now the last element smaller than or equal to Indices. This + // means it points to a prefix of Indices (possibly Indices itself), if + // such prefix exists. + if (Low != Safe.end()) { + if (IsPrefix(*Low, ToMark)) + // If there is already a prefix of these indices (or exactly these + // indices) marked a safe, don't bother adding these indices + return; + + // Increment Low, so we can use it as a "insert before" hint + ++Low; + } + // Insert + Low = Safe.insert(Low, ToMark); + ++Low; + // If there we're a prefix of longer index list(s), remove those + std::set::iterator End = Safe.end(); + while (Low != End && IsPrefix(ToMark, *Low)) { + std::set::iterator Remove = Low; + ++Low; + Safe.erase(Remove); + } +} /// isSafeToPromoteArgument - As you might guess from the name of this method, /// it checks to see if it is both safe and useful to promote the argument. @@ -229,43 +298,99 @@ /// elements of the aggregate in order to avoid exploding the number of /// arguments passed in. bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const { + typedef std::set GEPIndicesSet; + + // Quick exit for unused arguments + if (Arg->use_empty()) + return true; + // We can only promote this argument if all of the uses are loads, or are GEP // instructions (with constant indices) that are subsequently loaded. - - // We can also only promote the load if we can guarantee that it will happen. - // Promoting a load causes the load to be unconditionally executed in the - // caller, so we can't turn a conditional load into an unconditional load in - // general. - bool SafeToUnconditionallyLoad = false; - if (isByVal) // ByVal arguments are always safe to load from. - SafeToUnconditionallyLoad = true; + // + // Promoting the argument causes it to be loaded in the caller + // unconditionally. This is only safe if we can prove that either the load + // would have happened in the callee anyway (ie, there is a load in the entry + // block) or the pointer passed in at every call site is guaranteed to be + // valid. + // In the former case, invalid loads can happen, but would have happened + // anyway, in the latter case, invalid loads won't happen. This prevents us + // from introducing an invalid load that wouldn't have happened in the + // original code. + // + // This set will contain all sets of indices that are loaded in the entry + // block, and thus are safe to unconditionally load in the caller. + GEPIndicesSet SafeToUnconditionallyLoad; + + // This set contains all the sets of indices that we are planning to promote. + // This makes it possible to limit the number of arguments added. + GEPIndicesSet ToPromote; + // If the pointer is always valid, any load with first index 0 is valid. + if(isByVal || AllCalleesPassInValidPointerForArgument(Arg)) + SafeToUnconditionallyLoad.insert(IndicesVector(1, 0)); + + // First, iterate the entry block and mark loads of (geps of) arguments as + // safe. BasicBlock *EntryBlock = Arg->getParent()->begin(); + // Declare this here so we can reuse it + IndicesVector Indices; + for (BasicBlock::iterator I = EntryBlock->begin(), E = EntryBlock->end(); + I != E; ++I) + if (LoadInst *LI = dyn_cast(I)) { + Value *V = LI->getPointerOperand(); + if (GetElementPtrInst *GEP = dyn_cast(V)) { + V = GEP->getPointerOperand(); + if (V == Arg) { + // This load actually loads (part of) Arg? Check the indices then. + Indices.reserve(GEP->getNumIndices()); + for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); + II != IE; ++II) + if (ConstantInt *CI = dyn_cast(*II)) + Indices.push_back(CI->getSExtValue()); + else + // We found a non-constant GEP index for this argument? Bail out + // right away, can't promote this argument at all. + return false; + + // Indices checked out, mark them as safe + MarkIndicesSafe(Indices, SafeToUnconditionallyLoad); + Indices.clear(); + } + } else if (V == Arg) { + // Direct loads are equivalent to a GEP with a single 0 index. + MarkIndicesSafe(IndicesVector(1, 0), SafeToUnconditionallyLoad); + } + } + + // Now, iterate all uses of the argument to see if there are any uses that are + // not (GEP+)loads, or any (GEP+)loads that are not safe to promote. SmallVector Loads; - std::vector > GEPIndices; + IndicesVector Operands; for (Value::use_iterator UI = Arg->use_begin(), E = Arg->use_end(); - UI != E; ++UI) + UI != E; ++UI) { + Operands.clear(); if (LoadInst *LI = dyn_cast(*UI)) { if (LI->isVolatile()) return false; // Don't hack volatile loads Loads.push_back(LI); - - // If this load occurs in the entry block, then the pointer is - // unconditionally loaded. - SafeToUnconditionallyLoad |= LI->getParent() == EntryBlock; + // Direct loads are equivalent to a GEP with a zero index and then a load. + Operands.push_back(0); } else if (GetElementPtrInst *GEP = dyn_cast(*UI)) { if (GEP->use_empty()) { // Dead GEP's cause trouble later. Just remove them if we run into // them. getAnalysis().deleteValue(GEP); GEP->eraseFromParent(); + // TODO: This runs the above loop over and over again for dead GEPS + // Couldn't we just do increment the UI iterator earlier and erase the + // use? return isSafeToPromoteArgument(Arg, isByVal); } + // Ensure that all of the indices are constants. - SmallVector Operands; - for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); - i != e; ++i) + for (User::op_iterator i = GEP->idx_begin(), e = GEP->idx_end(); + i != e; ++i) if (ConstantInt *C = dyn_cast(*i)) - Operands.push_back(C); + Operands.push_back(C->getSExtValue()); else return false; // Not a constant operand GEP! @@ -275,47 +400,39 @@ if (LoadInst *LI = dyn_cast(*UI)) { if (LI->isVolatile()) return false; // Don't hack volatile loads Loads.push_back(LI); - - // If this load occurs in the entry block, then the pointer is - // unconditionally loaded. - SafeToUnconditionallyLoad |= LI->getParent() == EntryBlock; } else { + // Other uses than load? return false; } - - // See if there is already a GEP with these indices. If not, check to - // make sure that we aren't promoting too many elements. If so, nothing - // to do. - if (std::find(GEPIndices.begin(), GEPIndices.end(), Operands) == - GEPIndices.end()) { - if (maxElements > 0 && GEPIndices.size() == maxElements) { - DOUT << "argpromotion disable promoting argument '" - << Arg->getName() << "' because it would require adding more " - << "than " << maxElements << " arguments to the function.\n"; - // We limit aggregate promotion to only promoting up to a fixed number - // of elements of the aggregate. - return false; - } - GEPIndices.push_back(Operands); - } } else { return false; // Not a load or a GEP. } + + // Now, see if it is safe to promote this load / loads of this GEP. Loading + // is safe if Operands, or a prefix of Operands, is marked as safe. + if (!PrefixIn(Operands, SafeToUnconditionallyLoad)) + return false; - if (Loads.empty()) return true; // No users, this is a dead argument. + // See if we are already promoting a load with these indices. If not, check + // to make sure that we aren't promoting too many elements. If so, nothing + // to do. + if (ToPromote.find(Operands) == ToPromote.end()) { + if (maxElements > 0 && ToPromote.size() == maxElements) { + DOUT << "argpromotion not promoting argument '" + << Arg->getName() << "' because it would require adding more " + << "than " << maxElements << " arguments to the function.\n"; + // We limit aggregate promotion to only promoting up to a fixed number + // of elements of the aggregate. + return false; + } + ToPromote.insert(Operands); + } + } - // If we decide that we want to promote this argument, the value is going to - // be unconditionally loaded in all callees. This is only safe to do if the - // pointer was going to be unconditionally loaded anyway (i.e. there is a load - // of the pointer in the entry block of the function) or if we can prove that - // all pointers passed in are always to legal locations (for example, no null - // pointers are passed in, no pointers to free'd memory, etc). - if (!SafeToUnconditionallyLoad && - !AllCalleesPassInValidPointerForArgument(Arg)) - return false; // Cannot prove that this is safe!! + if (Loads.empty()) return true; // No users, this is a dead argument. // Okay, now we know that the argument is only used by load instructions and - // it is safe to unconditionally load the pointer. Use alias analysis to + // it is safe to unconditionally perform all of them. Use alias analysis to // check to see if the pointer is guaranteed to not be modified from entry of // the function to each of the load instructions. @@ -333,7 +450,7 @@ BasicBlock *BB = Load->getParent(); const PointerType *LoadTy = - cast(Load->getOperand(0)->getType()); + cast(Load->getPointerOperand()->getType()); unsigned LoadSize = (unsigned)TD.getTypeStoreSize(LoadTy->getElementType()); if (AA.canInstructionRangeModify(BB->front(), *Load, Arg, LoadSize)) @@ -356,29 +473,6 @@ return true; } -namespace { - /// GEPIdxComparator - Provide a strong ordering for GEP indices. All Value* - /// elements are instances of ConstantInt. - /// - struct GEPIdxComparator { - bool operator()(const std::vector &LHS, - const std::vector &RHS) const { - unsigned idx = 0; - for (; idx < LHS.size() && idx < RHS.size(); ++idx) { - if (LHS[idx] != RHS[idx]) { - return cast(LHS[idx])->getZExtValue() < - cast(RHS[idx])->getZExtValue(); - } - } - - // Return less than if we ran out of stuff in LHS and we didn't run out of - // stuff in RHS. - return idx == LHS.size() && idx != RHS.size(); - } - }; -} - - /// DoPromotion - This method actually performs the promotion of the specified /// arguments, and returns the new function. At this point, we know that it's /// safe to do so. @@ -391,7 +485,7 @@ const FunctionType *FTy = F->getFunctionType(); std::vector Params; - typedef std::set, GEPIdxComparator> ScalarizeTable; + typedef std::set ScalarizeTable; // ScalarizedElements - If we are promoting a pointer that has elements // accessed out of it, keep track of which elements are accessed so that we @@ -405,7 +499,7 @@ // OriginalLoads - Keep track of a representative load instruction from the // original function so that we can tell the alias analysis implementation // what the new GEP/Load instructions we are inserting look like. - std::map, LoadInst*> OriginalLoads; + std::map OriginalLoads; // ParamAttrs - Keep track of the parameter attributes for the arguments // that we are *not* promoting. For the ones that we do promote, the parameter @@ -416,47 +510,66 @@ // Add any return attributes. if (ParameterAttributes attrs = PAL.getParamAttrs(0)) ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs)); - + + // First, determine the new argument list unsigned ArgIndex = 1; for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I, ++ArgIndex) { if (ByValArgsToTransform.count(I)) { - // Just add all the struct element types. + // Simple byval argument? Just add all the struct element types. const Type *AgTy = cast(I->getType())->getElementType(); const StructType *STy = cast(AgTy); for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) Params.push_back(STy->getElementType(i)); ++NumByValArgsPromoted; } else if (!ArgsToPromote.count(I)) { + // Unchanged argument Params.push_back(I->getType()); if (ParameterAttributes attrs = PAL.getParamAttrs(ArgIndex)) ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), attrs)); } else if (I->use_empty()) { + // Dead argument (which are always marked as promotable) ++NumArgumentsDead; } else { - // Okay, this is being promoted. Check to see if there are any GEP uses - // of the argument. + // Okay, this is being promoted. This means that the only uses are loads + // or GEPs which are only used by loads + + // In this table, we will track which indices are loaded from the argument + // (where direct loads are tracked as no indices). ScalarizeTable &ArgIndices = ScalarizedElements[I]; for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { Instruction *User = cast(*UI); assert(isa(User) || isa(User)); - std::vector Indices(User->op_begin()+1, User->op_end()); + IndicesVector Indices; + Indices.reserve(User->getNumOperands() - 1); + // Since loads will only have a single operand, and GEPs only a single + // non-index operand, this will record direct loads without any indices, + // and gep+loads with the GEP indices. + for (User::op_iterator II = User->op_begin() + 1, IE = User->op_end(); + II != IE; ++II) + Indices.push_back(cast(*II)->getSExtValue()); + // GEPs with a single 0 index can be merged with direct loads + if (Indices.size() == 1 && Indices.front() == 0) + Indices.clear(); ArgIndices.insert(Indices); LoadInst *OrigLoad; if (LoadInst *L = dyn_cast(User)) OrigLoad = L; else + // Take any load, we will use it only to update Alias Analysis OrigLoad = cast(User->use_back()); OriginalLoads[Indices] = OrigLoad; } // Add a parameter to the function for each element passed in. for (ScalarizeTable::iterator SI = ArgIndices.begin(), - E = ArgIndices.end(); SI != E; ++SI) + E = ArgIndices.end(); SI != E; ++SI) { Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), - SI->begin(), - SI->end())); + &*SI->begin(), + SI->size())); + assert(Params.back()); + } if (ArgIndices.size() == 1 && ArgIndices.begin()->empty()) ++NumArgumentsPromoted; @@ -535,13 +648,29 @@ } else if (!I->use_empty()) { // Non-dead argument: insert GEPs and loads as appropriate. ScalarizeTable &ArgIndices = ScalarizedElements[I]; + // Store the Value* version of the indices in here, but declare it now + // for reuse + std::vector Ops; for (ScalarizeTable::iterator SI = ArgIndices.begin(), E = ArgIndices.end(); SI != E; ++SI) { Value *V = *AI; LoadInst *OrigLoad = OriginalLoads[*SI]; if (!SI->empty()) { - V = GetElementPtrInst::Create(V, SI->begin(), SI->end(), + Ops.reserve(SI->size()); + const Type *ElTy = V->getType(); + for (IndicesVector::const_iterator II = SI->begin(), + IE = SI->end(); II != IE; ++II) { + // Use i32 to index structs, and i64 for others (pointers/arrays). + // This satisfies GEP constraints. + const Type *IdxTy = (isa(ElTy) ? Type::Int32Ty : Type::Int64Ty); + Ops.push_back(ConstantInt::get(IdxTy, *II)); + // Keep track of the type we're currently indexing + ElTy = cast(ElTy)->getTypeAtIndex(*II); + } + // And create a GEP to extract those indices + V = GetElementPtrInst::Create(V, Ops.begin(), Ops.end(), V->getName()+".idx", Call); + Ops.clear(); AA.copyValue(OrigLoad->getOperand(0), V); } Args.push_back(new LoadInst(V, V->getName()+".val", Call)); @@ -624,9 +753,9 @@ for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { Idxs[1] = ConstantInt::get(Type::Int32Ty, i); + std::string Name = TheAlloca->getName()+"."+utostr(i); Value *Idx = GetElementPtrInst::Create(TheAlloca, Idxs, Idxs+2, - TheAlloca->getName()+"."+utostr(i), - InsertPt); + Name, InsertPt); I2->setName(I->getName()+"."+utostr(i)); new StoreInst(I2++, Idx, InsertPt); } @@ -644,8 +773,8 @@ } // Otherwise, if we promoted this argument, then all users are load - // instructions, and all loads should be using the new argument that we - // added. + // instructions (or GEPs with only load users), and all loads should be + // using the new argument that we added. ScalarizeTable &ArgIndices = ScalarizedElements[I]; while (!I->use_empty()) { @@ -660,7 +789,15 @@ << "' in function '" << F->getName() << "'\n"; } else { GetElementPtrInst *GEP = cast(I->use_back()); - std::vector Operands(GEP->op_begin()+1, GEP->op_end()); + IndicesVector Operands; + Operands.reserve(GEP->getNumIndices()); + for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); + II != IE; ++II) + Operands.push_back(cast(*II)->getSExtValue()); + + // GEPs with a single 0 index can be merged with direct loads + if (Operands.size() == 1 && Operands.front() == 0) + Operands.clear(); Function::arg_iterator TheArg = I2; for (ScalarizeTable::iterator It = ArgIndices.begin(); @@ -669,15 +806,14 @@ } std::string NewName = I->getName(); - for (unsigned i = 0, e = Operands.size(); i != e; ++i) - if (ConstantInt *CI = dyn_cast(Operands[i])) - NewName += "." + CI->getValue().toStringUnsigned(10); - else - NewName += ".x"; - TheArg->setName(NewName+".val"); + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { + NewName += "." + utostr(Operands[i]); + } + NewName += ".val"; + TheArg->setName(NewName); DOUT << "*** Promoted agg argument '" << TheArg->getName() - << "' of function '" << F->getName() << "'\n"; + << "' of function '" << NF->getName() << "'\n"; // All of the uses must be load instructions. Replace them all with // the argument specified by ArgNo. Added: llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll?rev=54159&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll (added) +++ llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll Tue Jul 29 05:00:13 2008 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | opt -argpromotion | llvm-dis > %t +; RUN: cat %t | grep {define.*@callee(.*i32\\*} +; PR2498 + +; This test tries to convince argpromotion about promoting the load from %A + 2, +; because there is a load of %A in the entry block +define internal i32 @callee(i1 %C, i32* %A) { +entry: + ; Unconditonally load the element at %A + %A.0 = load i32* %A + br i1 %C, label %T, label %F +T: + ret i32 %A.0 +F: + ; Load the element at offset two from %A. This should not be promoted! + %A.2 = getelementptr i32* %A, i32 2 + %R = load i32* %A.2 + ret i32 %R +} + +define i32 @foo() { + %X = call i32 @callee(i1 false, i32* null) ; [#uses=1] + ret i32 %X +} + From mikael.lepisto at tut.fi Tue Jul 29 05:02:33 2008 From: mikael.lepisto at tut.fi (=?ISO-8859-1?Q?Mikael_Lepist=F6?=) Date: Tue, 29 Jul 2008 13:02:33 +0300 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp In-Reply-To: <20080729083029.GB8220@katherina.student.utwente.nl> References: <488E1C1D.5040400@tut.fi> <20080729083029.GB8220@katherina.student.utwente.nl> Message-ID: <488EEAB9.1040807@tut.fi> Hi, Thanks for the comments. I'll do the changes and test as soon as I get some spare time. -mikael Matthijs Kooijman wrote: > Hi Mikael, > > I looked at the patch and it looks useful and a good addition to the unroll > pass. I do have a few comments, I've added them inline below. > > > >> @@ -136,9 +142,21 @@ >> DOUT << " Loop Size = " << LoopSize << "\n"; >> uint64_t Size = (uint64_t)LoopSize*Count; >> if (TripCount != 1 && Size > UnrollThreshold) { >> - DOUT << " TOO LARGE TO UNROLL: " >> - << Size << ">" << UnrollThreshold << "\n"; >> - return false; >> + DOUT << " TOO LARGE TO UNROLL COMPLETELY WITH COUNT: " << Count >> + << " Size: " << Size << ">" << UnrollThreshold << "\n"; >> > I think that, when UnrollAllowPartial is false, the new DOUT message could be > a bit confusing. Perhaps the old message should be shown in that case, or an > extra message ("BUT NOT ATTEMPTING PARTIAL UNROLL BECAUSE > -unroll-allow-partial NOT GIVEN" or something like that) added. > > >> + // Reduce unroll count to be modulo of TripCount for partial unrolling >> + Count = UnrollThreshold / LoopSize; >> + while (Count != 0 && TripCount%Count != 0) { >> + Count--; >> + } >> + >> + if (!UnrollAllowPartial || Count < 2) { >> > I think this !UnrollAllowPartial check should be moved upwards, since it's not > useful to calculate Count when you're not going to use it anyway. > > >> + DOUT << " COULD NOT UNROLL PARTIALLY\n"; >> + return false; >> + } else { >> + DOUT << " REDUCED UNROLL COUNT TO: " << Count << "\n"; >> + } >> > > Lastly, could you add a DejaGNU test as well, that tests this functionality? > This allows us to detect changes that break this unrolling in the future > automatically. See http://www.llvm.org/docs/TestingGuide.html for more info. > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From mikael.lepisto at tut.fi Tue Jul 29 07:56:39 2008 From: mikael.lepisto at tut.fi (=?ISO-8859-1?Q?Mikael_Lepist=F6?=) Date: Tue, 29 Jul 2008 15:56:39 +0300 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp In-Reply-To: <20080729083029.GB8220@katherina.student.utwente.nl> References: <488E1C1D.5040400@tut.fi> <20080729083029.GB8220@katherina.student.utwente.nl> Message-ID: <488F1387.8070403@tut.fi> Hi, Here is a version with modifications according to the review comments. -mikael Matthijs Kooijman wrote: > Hi Mikael, > > I looked at the patch and it looks useful and a good addition to the unroll > pass. I do have a few comments, I've added them inline below. > > > >> @@ -136,9 +142,21 @@ >> DOUT << " Loop Size = " << LoopSize << "\n"; >> uint64_t Size = (uint64_t)LoopSize*Count; >> if (TripCount != 1 && Size > UnrollThreshold) { >> - DOUT << " TOO LARGE TO UNROLL: " >> - << Size << ">" << UnrollThreshold << "\n"; >> - return false; >> + DOUT << " TOO LARGE TO UNROLL COMPLETELY WITH COUNT: " << Count >> + << " Size: " << Size << ">" << UnrollThreshold << "\n"; >> > I think that, when UnrollAllowPartial is false, the new DOUT message could be > a bit confusing. Perhaps the old message should be shown in that case, or an > extra message ("BUT NOT ATTEMPTING PARTIAL UNROLL BECAUSE > -unroll-allow-partial NOT GIVEN" or something like that) added. > > >> + // Reduce unroll count to be modulo of TripCount for partial unrolling >> + Count = UnrollThreshold / LoopSize; >> + while (Count != 0 && TripCount%Count != 0) { >> + Count--; >> + } >> + >> + if (!UnrollAllowPartial || Count < 2) { >> > I think this !UnrollAllowPartial check should be moved upwards, since it's not > useful to calculate Count when you're not going to use it anyway. > > >> + DOUT << " COULD NOT UNROLL PARTIALLY\n"; >> + return false; >> + } else { >> + DOUT << " REDUCED UNROLL COUNT TO: " << Count << "\n"; >> + } >> > > Lastly, could you add a DejaGNU test as well, that tests this functionality? > This allows us to detect changes that break this unrolling in the future > automatically. See http://www.llvm.org/docs/TestingGuide.html for more info. > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- A non-text attachment was scrubbed... Name: fixed-partial-unrolling-with-test.patch Type: text/x-diff Size: 3122 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080729/0488b883/attachment.bin From matthijs at stdin.nl Tue Jul 29 08:21:24 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 13:21:24 -0000 Subject: [llvm-commits] [llvm] r54160 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnroll.cpp test/Transforms/LoopUnroll/partial.ll Message-ID: <200807291321.m6TDLO61024080@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 29 08:21:23 2008 New Revision: 54160 URL: http://llvm.org/viewvc/llvm-project?rev=54160&view=rev Log: Add -unroll-allow-partial command line option that enabled the loop unroller to partially unroll a loop when fully unrolling would not fit under the threshold. Patch by Mikael Lepist?. Added: llvm/trunk/test/Transforms/LoopUnroll/partial.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=54160&r1=54159&r2=54160&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Tue Jul 29 08:21:23 2008 @@ -33,6 +33,11 @@ UnrollCount("unroll-count", cl::init(0), cl::Hidden, cl::desc("Use this unroll count for all loops, for testing purposes")); +static cl::opt +UnrollAllowPartial("unroll-allow-partial", cl::init(false), cl::Hidden, + cl::desc("Allows loops to be partially unrolled until " + "-unroll-threshold loop size is reached.")); + namespace { class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { public: @@ -122,7 +127,8 @@ if (Count == 0) { // Conservative heuristic: if we know the trip count, see if we can // completely unroll (subject to the threshold, checked below); otherwise - // don't unroll. + // try to find greatest modulo of the trip count which is still under + // threshold value. if (TripCount != 0) { Count = TripCount; } else { @@ -136,9 +142,25 @@ DOUT << " Loop Size = " << LoopSize << "\n"; uint64_t Size = (uint64_t)LoopSize*Count; if (TripCount != 1 && Size > UnrollThreshold) { - DOUT << " TOO LARGE TO UNROLL: " - << Size << ">" << UnrollThreshold << "\n"; - return false; + DOUT << " Too large to fully unroll with count: " << Count + << " because size: " << Size << ">" << UnrollThreshold << "\n"; + if (UnrollAllowPartial) { + // Reduce unroll count to be modulo of TripCount for partial unrolling + Count = UnrollThreshold / LoopSize; + while (Count != 0 && TripCount%Count != 0) { + Count--; + } + if (Count < 2) { + DOUT << " could not unroll partially\n"; + return false; + } else { + DOUT << " partially unrolling with count: " << Count << "\n"; + } + } else { + DOUT << " will not try to unroll partially because " + << "-unroll-allow-partial not given\n"; + return false; + } } } Added: llvm/trunk/test/Transforms/LoopUnroll/partial.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/partial.ll?rev=54160&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopUnroll/partial.ll (added) +++ llvm/trunk/test/Transforms/LoopUnroll/partial.ll Tue Jul 29 08:21:23 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | opt -debug -loop-unroll |& grep {will not try to unroll partially because} +; RUN: llvm-as < %s | opt -debug -loop-unroll -unroll-allow-partial |& grep {partially unrolling with count} +; RUN: llvm-as < %s | opt -debug -loop-unroll -unroll-allow-partial -unroll-threshold=3 |& grep {could not unroll partially} + +define i32 @main() { +entry: + br label %no_exit +no_exit: ; preds = %no_exit, %entry + %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; [#uses=1] + %indvar.next = add i32 %indvar, 1 ; [#uses=2] + %exitcond = icmp ne i32 %indvar.next, 100 ; [#uses=1] + br i1 %exitcond, label %no_exit, label %loopexit +loopexit: ; preds = %no_exit + ret i32 0 +} From matthijs at stdin.nl Tue Jul 29 08:23:43 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 29 Jul 2008 15:23:43 +0200 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp In-Reply-To: <488F1387.8070403@tut.fi> References: <488E1C1D.5040400@tut.fi> <20080729083029.GB8220@katherina.student.utwente.nl> <488F1387.8070403@tut.fi> Message-ID: <20080729132343.GC8220@katherina.student.utwente.nl> Hi Mikael, > Here is a version with modifications according to the review comments. I've committed the patch. Thanks! I've made one more change: Changing the debug output to not be in capitals, which didn't really make sense anyway. I though the entire file would do that, but it were only these few messages. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080729/5253945c/attachment.bin From mikael.lepisto at tut.fi Tue Jul 29 09:07:42 2008 From: mikael.lepisto at tut.fi (=?ISO-8859-1?Q?Mikael_Lepist=F6?=) Date: Tue, 29 Jul 2008 17:07:42 +0300 Subject: [llvm-commits] [PATCH] Switch for allowing partial unrolling to LoopUnroll.cpp In-Reply-To: <20080729132343.GC8220@katherina.student.utwente.nl> References: <488E1C1D.5040400@tut.fi> <20080729083029.GB8220@katherina.student.utwente.nl> <488F1387.8070403@tut.fi> <20080729132343.GC8220@katherina.student.utwente.nl> Message-ID: <488F242E.6000900@tut.fi> Thanks, I found it strange as well. llvm-2.3 version of LoopUnroll.cpp actually used them a bit more regulary and I didn't give second thought to it after copying patch to trunk. -mikael Matthijs Kooijman wrote: > Hi Mikael, > > >> Here is a version with modifications according to the review comments. >> > I've committed the patch. Thanks! > > I've made one more change: Changing the debug output to not be in capitals, > which didn't really make sense anyway. I though the entire file would do that, > but it were only these few messages. > > Gr. > > Matthijs > > ------------------------------------------------------------------------ > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From natebegeman at mac.com Tue Jul 29 10:49:44 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jul 2008 15:49:44 -0000 Subject: [llvm-commits] [llvm] r54161 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Assembler/vector-shift.ll Message-ID: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> Author: sampo Date: Tue Jul 29 10:49:41 2008 New Revision: 54161 URL: http://llvm.org/viewvc/llvm-project?rev=54161&view=rev Log: Add vector shifts to the IR, patch by Eli Friedman. CodeGen & Clang work coming next. Added: llvm/trunk/test/Assembler/vector-shift.ll Modified: llvm/trunk/docs/LangRef.html llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/VMCore/Instructions.cpp llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 29 10:49:41 2008 @@ -2458,9 +2458,8 @@
Arguments:

Both arguments to the 'shl' instruction must be the same integer type. 'var2' is treated as an -unsigned value. This instruction does not support -vector operands.

+ href="#t_integer">integer or vector of integer +type. 'var2' is treated as an unsigned value.

Semantics:
@@ -2489,9 +2488,8 @@
Arguments:

Both arguments to the 'lshr' instruction must be the same -integer type. 'var2' is treated as an -unsigned value. This instruction does not support -vector operands.

+integer or vector of integer +type. 'var2' is treated as an unsigned value.

Semantics:
@@ -2525,9 +2523,8 @@
Arguments:

Both arguments to the 'ashr' instruction must be the same -integer type. 'var2' is treated as an -unsigned value. This instruction does not support -vector operands.

+integer or vector of integer +type. 'var2' is treated as an unsigned value.

Semantics:

This instruction always performs an arithmetic shift right operation, Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jul 29 10:49:41 2008 @@ -388,7 +388,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1362,7 +1362,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 967 "/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -3622,152 +3622,152 @@ switch (yyn) { case 29: -#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1140 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1140 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1141 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1141 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1141 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1141 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1153 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1154 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1163 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1165 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1165 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1166 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1170 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3775,7 +3775,7 @@ break; case 69: -#line 1174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3783,7 +3783,7 @@ break; case 73: -#line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3791,7 +3791,7 @@ break; case 74: -#line 1187 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3799,157 +3799,157 @@ break; case 75: -#line 1193 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1193 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 76: -#line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 77: -#line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 78: -#line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1196 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 79: -#line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1197 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 80: -#line 1198 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1198 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 81: -#line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 82: -#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 83: -#line 1204 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1204 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 84: -#line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 85: -#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 87: -#line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 88: -#line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 89: -#line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 90: -#line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 91: -#line 1221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1221 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 92: -#line 1222 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1222 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 93: -#line 1223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 94: -#line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 95: -#line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 96: -#line 1229 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 97: -#line 1230 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 98: -#line 1231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 99: -#line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 100: -#line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1235 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1236 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 102: -#line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 103: -#line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 104: -#line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 105: -#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3959,129 +3959,129 @@ break; case 106: -#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 107: -#line 1248 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 108: -#line 1249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 109: -#line 1250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 110: -#line 1251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 111: -#line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 112: -#line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 113: -#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 114: -#line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::Nest; ;} break; case 115: -#line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 116: -#line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1260 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 117: -#line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1261 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 118: -#line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 119: -#line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 120: -#line 1268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 121: -#line 1269 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 122: -#line 1270 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; case 123: -#line 1271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; case 124: -#line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 125: -#line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1275 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 126: -#line 1280 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1280 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 127: -#line 1281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1281 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 128: -#line 1288 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 129: -#line 1289 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1289 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4091,12 +4091,12 @@ break; case 130: -#line 1295 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1295 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 131: -#line 1296 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1296 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4106,7 +4106,7 @@ break; case 132: -#line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1305 "/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4117,27 +4117,27 @@ break; case 133: -#line 1313 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1313 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 134: -#line 1314 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1314 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 135: -#line 1319 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1319 "/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 136: -#line 1320 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1320 "/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 137: -#line 1321 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1321 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4146,7 +4146,7 @@ break; case 138: -#line 1326 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4156,7 +4156,7 @@ break; case 146: -#line 1342 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1342 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4164,7 +4164,7 @@ break; case 147: -#line 1346 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1346 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4172,7 +4172,7 @@ break; case 148: -#line 1350 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1350 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4183,7 +4183,7 @@ break; case 149: -#line 1357 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1357 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4192,7 +4192,7 @@ break; case 150: -#line 1362 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1362 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4204,7 +4204,7 @@ break; case 151: -#line 1370 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1370 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4237,7 +4237,7 @@ break; case 152: -#line 1399 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1399 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4265,7 +4265,7 @@ break; case 153: -#line 1424 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1424 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4274,7 +4274,7 @@ break; case 154: -#line 1429 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1429 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4288,7 +4288,7 @@ break; case 155: -#line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1439 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4302,7 +4302,7 @@ break; case 156: -#line 1449 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1449 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4310,7 +4310,7 @@ break; case 157: -#line 1453 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1453 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4324,7 +4324,7 @@ break; case 158: -#line 1463 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1463 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4332,7 +4332,7 @@ break; case 159: -#line 1470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1470 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4342,7 +4342,7 @@ break; case 160: -#line 1479 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1479 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4353,14 +4353,14 @@ break; case 161: -#line 1486 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1486 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 162: -#line 1491 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1491 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4369,7 +4369,7 @@ break; case 163: -#line 1496 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1496 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4377,7 +4377,7 @@ break; case 165: -#line 1504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1504 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4388,7 +4388,7 @@ break; case 166: -#line 1511 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1511 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4399,7 +4399,7 @@ break; case 167: -#line 1518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1518 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4407,7 +4407,7 @@ break; case 168: -#line 1526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1526 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4417,7 +4417,7 @@ break; case 169: -#line 1532 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1532 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4426,7 +4426,7 @@ break; case 170: -#line 1544 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1544 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4458,7 +4458,7 @@ break; case 171: -#line 1572 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1572 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4478,7 +4478,7 @@ break; case 172: -#line 1588 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1588 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4509,7 +4509,7 @@ break; case 173: -#line 1615 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1615 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4541,7 +4541,7 @@ break; case 174: -#line 1643 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1643 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4571,7 +4571,7 @@ break; case 175: -#line 1669 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1669 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4595,7 +4595,7 @@ break; case 176: -#line 1689 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1689 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4625,7 +4625,7 @@ break; case 177: -#line 1715 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1715 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4649,7 +4649,7 @@ break; case 178: -#line 1735 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1735 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4665,7 +4665,7 @@ break; case 179: -#line 1747 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1747 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4676,7 +4676,7 @@ break; case 180: -#line 1754 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1754 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4746,7 +4746,7 @@ break; case 181: -#line 1820 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1820 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4760,7 +4760,7 @@ break; case 182: -#line 1830 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1830 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4774,7 +4774,7 @@ break; case 183: -#line 1840 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1840 "/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4784,7 +4784,7 @@ break; case 184: -#line 1846 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1846 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4798,7 +4798,7 @@ break; case 185: -#line 1856 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1856 "/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4808,7 +4808,7 @@ break; case 186: -#line 1862 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1862 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4822,7 +4822,7 @@ break; case 187: -#line 1872 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1872 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant true must have type i1"); @@ -4832,7 +4832,7 @@ break; case 188: -#line 1878 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1878 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant false must have type i1"); @@ -4842,7 +4842,7 @@ break; case 189: -#line 1884 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1884 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4857,7 +4857,7 @@ break; case 190: -#line 1897 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1897 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4873,7 +4873,7 @@ break; case 191: -#line 1909 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1909 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4898,7 +4898,7 @@ break; case 192: -#line 1930 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1930 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4910,7 +4910,7 @@ break; case 193: -#line 1938 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1938 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4920,12 +4920,12 @@ break; case 194: -#line 1944 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1944 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || + if (!isa((yyvsp[(3) - (6)].ConstVal)->getType()) || !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } @@ -4935,7 +4935,7 @@ break; case 195: -#line 1955 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1955 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4944,7 +4944,7 @@ break; case 196: -#line 1960 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1960 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4953,7 +4953,7 @@ break; case 197: -#line 1965 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1965 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -4962,7 +4962,7 @@ break; case 198: -#line 1970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1970 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -4971,7 +4971,7 @@ break; case 199: -#line 1975 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1975 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -4981,7 +4981,7 @@ break; case 200: -#line 1981 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1981 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -4991,7 +4991,7 @@ break; case 201: -#line 1987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5001,7 +5001,7 @@ break; case 202: -#line 1993 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1993 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5013,7 +5013,7 @@ break; case 203: -#line 2001 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2001 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5025,7 +5025,7 @@ break; case 204: -#line 2012 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2012 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5033,7 +5033,7 @@ break; case 205: -#line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2016 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5042,27 +5042,27 @@ break; case 206: -#line 2024 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 207: -#line 2024 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 208: -#line 2027 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2027 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 209: -#line 2027 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2027 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 210: -#line 2030 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2030 "/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5078,7 +5078,7 @@ break; case 211: -#line 2042 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5094,7 +5094,7 @@ break; case 212: -#line 2063 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2063 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5103,7 +5103,7 @@ break; case 213: -#line 2068 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2068 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5112,12 +5112,12 @@ break; case 216: -#line 2081 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2081 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 217: -#line 2081 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2081 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5125,26 +5125,26 @@ break; case 218: -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2085 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 219: -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2085 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 220: -#line 2088 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2088 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 221: -#line 2091 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2091 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5172,7 +5172,7 @@ break; case 222: -#line 2115 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2115 "/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5187,7 +5187,7 @@ break; case 223: -#line 2127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2127 "/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5199,14 +5199,14 @@ break; case 224: -#line 2134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2134 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 225: -#line 2138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2138 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5216,14 +5216,14 @@ break; case 226: -#line 2143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2143 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 227: -#line 2147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2147 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5234,7 +5234,7 @@ break; case 228: -#line 2153 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2153 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5242,7 +5242,7 @@ break; case 229: -#line 2157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2157 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5286,21 +5286,21 @@ break; case 230: -#line 2197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2197 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 231: -#line 2200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2200 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 232: -#line 2206 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2206 "/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5313,7 +5313,7 @@ break; case 233: -#line 2216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2216 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5321,7 +5321,7 @@ break; case 234: -#line 2220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2220 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5329,7 +5329,7 @@ break; case 236: -#line 2227 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2227 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5338,7 +5338,7 @@ break; case 237: -#line 2232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2232 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5347,14 +5347,14 @@ break; case 238: -#line 2237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2237 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 239: -#line 2246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2246 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5368,7 +5368,7 @@ break; case 240: -#line 2256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2256 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5382,7 +5382,7 @@ break; case 241: -#line 2267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2267 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5390,7 +5390,7 @@ break; case 242: -#line 2271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2271 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5403,7 +5403,7 @@ break; case 243: -#line 2280 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2280 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5416,7 +5416,7 @@ break; case 244: -#line 2289 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2289 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5424,7 +5424,7 @@ break; case 245: -#line 2295 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2295 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! @@ -5555,7 +5555,7 @@ break; case 248: -#line 2425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2425 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5567,7 +5567,7 @@ break; case 251: -#line 2436 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2436 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5575,7 +5575,7 @@ break; case 252: -#line 2441 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2441 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5586,7 +5586,7 @@ break; case 253: -#line 2453 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2453 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5594,7 +5594,7 @@ break; case 254: -#line 2457 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2457 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5602,7 +5602,7 @@ break; case 255: -#line 2462 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2462 "/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5610,7 +5610,7 @@ break; case 256: -#line 2466 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2466 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5618,7 +5618,7 @@ break; case 257: -#line 2470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2470 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5627,7 +5627,7 @@ break; case 258: -#line 2475 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2475 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5636,7 +5636,7 @@ break; case 259: -#line 2480 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2480 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5644,7 +5644,7 @@ break; case 260: -#line 2484 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2484 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5652,7 +5652,7 @@ break; case 261: -#line 2488 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2488 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5660,7 +5660,7 @@ break; case 262: -#line 2492 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2492 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5668,7 +5668,7 @@ break; case 263: -#line 2496 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2496 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5676,7 +5676,7 @@ break; case 264: -#line 2500 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2500 "/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5684,7 +5684,7 @@ break; case 265: -#line 2504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2504 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5710,7 +5710,7 @@ break; case 266: -#line 2526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2526 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5736,7 +5736,7 @@ break; case 267: -#line 2548 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2548 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5746,7 +5746,7 @@ break; case 268: -#line 2554 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2554 "/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5763,7 +5763,7 @@ break; case 269: -#line 2567 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2567 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5779,7 +5779,7 @@ break; case 270: -#line 2579 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2579 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5788,7 +5788,7 @@ break; case 271: -#line 2584 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2584 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5804,7 +5804,7 @@ break; case 272: -#line 2596 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2596 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5814,7 +5814,7 @@ break; case 273: -#line 2602 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2602 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5822,7 +5822,7 @@ break; case 274: -#line 2606 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2606 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5832,7 +5832,7 @@ break; case 275: -#line 2616 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2616 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5840,7 +5840,7 @@ break; case 276: -#line 2620 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2620 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5848,7 +5848,7 @@ break; case 277: -#line 2624 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2624 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5857,7 +5857,7 @@ break; case 278: -#line 2629 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2629 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5866,7 +5866,7 @@ break; case 281: -#line 2642 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2642 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5877,7 +5877,7 @@ break; case 282: -#line 2651 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2651 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5886,7 +5886,7 @@ break; case 283: -#line 2656 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2656 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -5894,7 +5894,7 @@ break; case 284: -#line 2661 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2661 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5902,7 +5902,7 @@ break; case 285: -#line 2665 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2665 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5910,7 +5910,7 @@ break; case 286: -#line 2674 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2674 "/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -5922,7 +5922,7 @@ break; case 287: -#line 2683 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2683 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -5935,7 +5935,7 @@ break; case 288: -#line 2692 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2692 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -5943,7 +5943,7 @@ break; case 289: -#line 2696 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2696 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -5953,7 +5953,7 @@ break; case 290: -#line 2704 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2704 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -5977,7 +5977,7 @@ break; case 291: -#line 2724 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2724 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -5985,7 +5985,7 @@ break; case 292: -#line 2728 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2728 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -5994,7 +5994,7 @@ break; case 293: -#line 2733 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2733 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6009,7 +6009,7 @@ break; case 294: -#line 2744 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2744 "/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6032,7 +6032,7 @@ break; case 295: -#line 2763 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2763 "/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6045,7 +6045,7 @@ break; case 296: -#line 2773 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2773 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6134,7 +6134,7 @@ break; case 297: -#line 2858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2858 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6142,7 +6142,7 @@ break; case 298: -#line 2862 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2862 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6150,7 +6150,7 @@ break; case 299: -#line 2869 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2869 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6165,7 +6165,7 @@ break; case 300: -#line 2880 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2880 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6181,7 +6181,7 @@ break; case 301: -#line 2893 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2893 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6193,7 +6193,7 @@ break; case 302: -#line 2903 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2903 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6208,7 +6208,7 @@ break; case 303: -#line 2914 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2914 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6220,7 +6220,7 @@ break; case 304: -#line 2924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2924 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6235,7 +6235,7 @@ break; case 305: -#line 2935 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2935 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6247,7 +6247,7 @@ break; case 306: -#line 2943 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2943 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6261,7 +6261,7 @@ break; case 307: -#line 2953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2953 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6272,17 +6272,17 @@ break; case 308: -#line 2960 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2960 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 309: -#line 2963 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2963 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 310: -#line 2964 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2964 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6291,7 +6291,7 @@ break; case 311: -#line 2972 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2972 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6301,7 +6301,7 @@ break; case 312: -#line 2978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2978 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6312,7 +6312,7 @@ break; case 313: -#line 2987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2987 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6320,7 +6320,7 @@ break; case 314: -#line 2991 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2991 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6328,7 +6328,7 @@ break; case 315: -#line 2996 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2996 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6348,12 +6348,12 @@ break; case 316: -#line 3012 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3012 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || + if (!isa((yyvsp[(2) - (5)].TypeVal)->get()) || !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } @@ -6369,7 +6369,7 @@ break; case 317: -#line 3029 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3029 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6387,7 +6387,7 @@ break; case 318: -#line 3043 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3043 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6405,7 +6405,7 @@ break; case 319: -#line 3057 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3057 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6423,7 +6423,7 @@ break; case 320: -#line 3071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3071 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6441,7 +6441,7 @@ break; case 321: -#line 3085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3085 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6457,7 +6457,7 @@ break; case 322: -#line 3097 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3097 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -6469,7 +6469,7 @@ break; case 323: -#line 3105 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3105 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6480,7 +6480,7 @@ break; case 324: -#line 3112 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3112 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6490,7 +6490,7 @@ break; case 325: -#line 3118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3118 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6500,7 +6500,7 @@ break; case 326: -#line 3124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3124 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6510,7 +6510,7 @@ break; case 327: -#line 3130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3130 "/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6529,7 +6529,7 @@ break; case 328: -#line 3146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3146 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6622,7 +6622,7 @@ break; case 329: -#line 3235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3235 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR @@ -6630,7 +6630,7 @@ break; case 330: -#line 3240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3240 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6638,7 +6638,7 @@ break; case 331: -#line 3244 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3244 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6646,7 +6646,7 @@ break; case 332: -#line 3251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3251 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6657,7 +6657,7 @@ break; case 333: -#line 3258 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3258 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6671,7 +6671,7 @@ break; case 334: -#line 3268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3268 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6682,7 +6682,7 @@ break; case 335: -#line 3275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3275 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6696,7 +6696,7 @@ break; case 336: -#line 3285 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3285 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6707,7 +6707,7 @@ break; case 337: -#line 3293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3293 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6725,7 +6725,7 @@ break; case 338: -#line 3307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3307 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6746,7 +6746,7 @@ break; case 339: -#line 3324 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3324 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6764,7 +6764,7 @@ break; case 340: -#line 3338 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3338 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6783,7 +6783,7 @@ break; case 341: -#line 3353 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3353 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6802,7 +6802,7 @@ break; case 342: -#line 3368 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3368 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -7038,7 +7038,7 @@ } -#line 3387 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3387 "/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Jul 29 10:49:41 2008 @@ -354,7 +354,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 967 "/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Jul 29 10:49:41 2008 @@ -1945,7 +1945,7 @@ if ($3->getType() != $5->getType()) GEN_ERROR("Logical operator types must match"); if (!$3->getType()->isInteger()) { - if (Instruction::isShift($1) || !isa($3->getType()) || + if (!isa($3->getType()) || !cast($3->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } @@ -3013,7 +3013,7 @@ if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!(*$2)->isInteger()) { - if (Instruction::isShift($1) || !isa($2->get()) || + if (!isa($2->get()) || !cast($2->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Jul 29 10:49:41 2008 @@ -1945,7 +1945,7 @@ if ($3->getType() != $5->getType()) GEN_ERROR("Logical operator types must match"); if (!$3->getType()->isInteger()) { - if (Instruction::isShift($1) || !isa($3->getType()) || + if (!isa($3->getType()) || !cast($3->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } @@ -3013,7 +3013,7 @@ if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!(*$2)->isInteger()) { - if (Instruction::isShift($1) || !isa($2->get()) || + if (!isa($2->get()) || !cast($2->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 29 10:49:41 2008 @@ -2958,7 +2958,17 @@ Tmp2 = PromoteOp(Node->getOperand(1)); // Promote the RHS. break; } - + + if ((Node->getOpcode() == ISD::SHL || + Node->getOpcode() == ISD::SRL || + Node->getOpcode() == ISD::SRA) && + !Node->getValueType(0).isVector()) { + if (TLI.getShiftAmountTy().bitsLT(Tmp2.getValueType())) + Tmp2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Tmp2); + else if (TLI.getShiftAmountTy().bitsGT(Tmp2.getValueType())) + Tmp2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Tmp2); + } + Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2); switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) { @@ -2966,8 +2976,11 @@ case TargetLowering::Legal: break; case TargetLowering::Custom: Tmp1 = TLI.LowerOperation(Result, DAG); - if (Tmp1.Val) Result = Tmp1; - break; + if (Tmp1.Val) { + Result = Tmp1; + break; + } + // Fall through if the custom lower can't deal with the operation case TargetLowering::Expand: { MVT VT = Op.getValueType(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Jul 29 10:49:41 2008 @@ -2407,11 +2407,12 @@ void SelectionDAGLowering::visitShift(User &I, unsigned Opcode) { SDValue Op1 = getValue(I.getOperand(0)); SDValue Op2 = getValue(I.getOperand(1)); - - if (TLI.getShiftAmountTy().bitsLT(Op2.getValueType())) - Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2); - else if (TLI.getShiftAmountTy().bitsGT(Op2.getValueType())) - Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); + if (!isa(I.getType())) { + if (TLI.getShiftAmountTy().bitsLT(Op2.getValueType())) + Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2); + else if (TLI.getShiftAmountTy().bitsGT(Op2.getValueType())) + Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); + } setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2)); } Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jul 29 10:49:41 2008 @@ -6368,7 +6368,8 @@ return ReplaceInstUsesWith(I, CSI); // See if we can turn a signed shr into an unsigned shr. - if (MaskedValueIsZero(Op0, + if (!isa(I.getType()) && + MaskedValueIsZero(Op0, APInt::getSignBit(I.getType()->getPrimitiveSizeInBits()))) return BinaryOperator::CreateLShr(Op0, I.getOperand(1)); Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Jul 29 10:49:41 2008 @@ -874,6 +874,7 @@ //===----------------------------------------------------------------------===// void StoreInst::AssertOK() { + assert(getOperand(0) && getOperand(1) && "Both operands must be non-null!"); assert(isa(getOperand(1)->getType()) && "Ptr must have pointer type!"); assert(getOperand(0)->getType() == @@ -1535,8 +1536,10 @@ case AShr: assert(getType() == LHS->getType() && "Shift operation should return same type as operands!"); - assert(getType()->isInteger() && - "Shift operation requires integer operands"); + assert((getType()->isInteger() || + (isa(getType()) && + cast(getType())->getElementType()->isInteger())) && + "Tried to create a shift operation on a non-integral type!"); break; case And: case Or: case Xor: Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=54161&r1=54160&r2=54161&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 29 10:49:41 2008 @@ -973,8 +973,10 @@ case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - Assert1(B.getType()->isInteger(), - "Shift must return an integer result!", &B); + Assert1(B.getType()->isInteger() || + (isa(B.getType()) && + cast(B.getType())->getElementType()->isInteger()), + "Shifts only work with integral types!", &B); Assert1(B.getType() == B.getOperand(0)->getType(), "Shift return type must be same as operands!", &B); /* FALL THROUGH */ @@ -1041,9 +1043,13 @@ // Check to see if Mask is valid. if (const ConstantVector *MV = dyn_cast(SV.getOperand(2))) { for (unsigned i = 0, e = MV->getNumOperands(); i != e; ++i) { - Assert1(isa(MV->getOperand(i)) || - isa(MV->getOperand(i)), - "Invalid shufflevector shuffle mask!", &SV); + if (ConstantInt* CI = dyn_cast(MV->getOperand(i))) { + Assert1(!CI->uge(MV->getNumOperands()*2), + "Invalid shufflevector shuffle mask!", &SV); + } else { + Assert1(isa(MV->getOperand(i)), + "Invalid shufflevector shuffle mask!", &SV); + } } } else { Assert1(isa(SV.getOperand(2)) || Added: llvm/trunk/test/Assembler/vector-shift.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vector-shift.ll?rev=54161&view=auto ============================================================================== --- llvm/trunk/test/Assembler/vector-shift.ll (added) +++ llvm/trunk/test/Assembler/vector-shift.ll Tue Jul 29 10:49:41 2008 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep shl +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep ashr +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep lshr + +define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind { +entry: + %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1] + ret <4 x i32> %cmp +} + +define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind { +entry: + %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1] + ret <4 x i32> %cmp +} + +define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind { +entry: + %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1] + ret <4 x i32> %cmp +} From baldrick at free.fr Tue Jul 29 11:10:52 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jul 2008 18:10:52 +0200 Subject: [llvm-commits] [llvm] r54161 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Assembler/vector-shift.ll In-Reply-To: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> References: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> Message-ID: <200807291810.52316.baldrick@free.fr> Hi, > Add vector shifts to the IR, patch by Eli Friedman. how are these defined? Does it mean shifting each element independently? Thanks, Duncan. From natebegeman at mac.com Tue Jul 29 11:27:28 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jul 2008 09:27:28 -0700 Subject: [llvm-commits] [llvm] r54161 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Assembler/vector-shift.ll In-Reply-To: <200807291810.52316.baldrick@free.fr> References: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> <200807291810.52316.baldrick@free.fr> Message-ID: <054CECD1-0433-4302-A1AE-A9B1866E87B1@mac.com> On Jul 29, 2008, at 9:10 AM, Duncan Sands wrote: > Hi, > >> Add vector shifts to the IR, patch by Eli Friedman. > > how are these defined? Does it mean shifting > each element independently? Yes. I'll update the LangRef to be more clear re: vector behavior. Nate From gohman at apple.com Tue Jul 29 13:22:02 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 29 Jul 2008 11:22:02 -0700 Subject: [llvm-commits] [llvm] r54161 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Assembler/vector-shift.ll In-Reply-To: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> References: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> Message-ID: <4D6B23FA-02F2-4BE4-8E4E-661ED48F5605@apple.com> Hello, It appears this patch breaks CodeGen/CellSPU/and_ops.ll. Can you investigate? Thanks, Dan On Jul 29, 2008, at 8:49 AM, Nate Begeman wrote: > Author: sampo > Date: Tue Jul 29 10:49:41 2008 > New Revision: 54161 > > URL: http://llvm.org/viewvc/llvm-project?rev=54161&view=rev > Log: > Add vector shifts to the IR, patch by Eli Friedman. > CodeGen & Clang work coming next. > > Added: > llvm/trunk/test/Assembler/vector-shift.ll > Modified: > llvm/trunk/docs/LangRef.html > llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs > llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs > llvm/trunk/lib/AsmParser/llvmAsmParser.y > llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > llvm/trunk/lib/VMCore/Instructions.cpp > llvm/trunk/lib/VMCore/Verifier.cpp > > Modified: llvm/trunk/docs/LangRef.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/docs/LangRef.html (original) > +++ llvm/trunk/docs/LangRef.html Tue Jul 29 10:49:41 2008 > @@ -2458,9 +2458,8 @@ >

Arguments:
> >

Both arguments to the 'shl' instruction must be the same > - href="#t_integer">integer type. 'var2' is treated as > an > -unsigned value. This instruction does not support > -vector operands.

> + href="#t_integer">integer or vector of > integer > +type. 'var2' is treated as an unsigned value.

> >
Semantics:
> > @@ -2489,9 +2488,8 @@ > >
Arguments:
>

Both arguments to the 'lshr' instruction must be the same > -integer type. 'var2' is treated > as an > -unsigned value. This instruction does not support > -vector operands.

> +integer or vector > of integer > +type. 'var2' is treated as an unsigned value.

> >
Semantics:
> > @@ -2525,9 +2523,8 @@ > >
Arguments:
>

Both arguments to the 'ashr' instruction must be the same > -integer type. 'var2' is treated > as an > -unsigned value. This instruction does not support > -vector operands.

> +integer or vector > of integer > +type. 'var2' is treated as an unsigned value.

> >
Semantics:
>

This instruction always performs an arithmetic shift right > operation, > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jul 29 > 10:49:41 2008 > @@ -388,7 +388,7 @@ > > > /* Copy the first part of user declarations. */ > -#line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y" > > #include "ParserInternals.h" > #include "llvm/CallingConv.h" > @@ -1362,7 +1362,7 @@ > > #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED > typedef union YYSTYPE > -#line 967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 967 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > llvm::Module *ModuleVal; > llvm::Function *FunctionVal; > @@ -3622,152 +3622,152 @@ > switch (yyn) > { > case 29: > -#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} > break; > > case 30: > -#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1138 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} > break; > > case 31: > -#line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1139 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} > break; > > case 32: > -#line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1139 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} > break; > > case 33: > -#line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1140 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} > break; > > case 34: > -#line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1140 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} > break; > > case 35: > -#line 1141 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1141 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} > break; > > case 36: > -#line 1141 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1141 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} > break; > > case 37: > -#line 1142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} > break; > > case 38: > -#line 1142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} > break; > > case 39: > -#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} > break; > > case 40: > -#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1146 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} > break; > > case 41: > -#line 1147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} > break; > > case 42: > -#line 1147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1147 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} > break; > > case 43: > -#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} > break; > > case 44: > -#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1148 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} > break; > > case 45: > -#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} > break; > > case 46: > -#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} > break; > > case 47: > -#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1150 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} > break; > > case 48: > -#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1150 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} > break; > > case 49: > -#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1151 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} > break; > > case 50: > -#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1151 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} > break; > > case 51: > -#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1152 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} > break; > > case 52: > -#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1152 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} > break; > > case 53: > -#line 1153 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1153 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} > break; > > case 54: > -#line 1154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1154 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} > break; > > case 65: > -#line 1163 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1163 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 66: > -#line 1165 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1165 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} > break; > > case 67: > -#line 1166 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1166 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal)=0; ;} > break; > > case 68: > -#line 1170 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1170 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); > CHECK_FOR_ERROR > @@ -3775,7 +3775,7 @@ > break; > > case 69: > -#line 1174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1174 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = 0; > CHECK_FOR_ERROR > @@ -3783,7 +3783,7 @@ > break; > > case 73: > -#line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1182 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = 0; > CHECK_FOR_ERROR > @@ -3791,7 +3791,7 @@ > break; > > case 74: > -#line 1187 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); > CHECK_FOR_ERROR > @@ -3799,157 +3799,157 @@ > break; > > case 75: > -#line 1193 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1193 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 76: > -#line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 77: > -#line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} > break; > > case 78: > -#line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1196 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} > break; > > case 79: > -#line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1197 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} > break; > > case 80: > -#line 1198 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1198 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} > break; > > case 81: > -#line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} > break; > > case 82: > -#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} > break; > > case 83: > -#line 1204 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1204 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 84: > -#line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} > break; > > case 85: > -#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} > break; > > case 86: > -#line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1210 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} > break; > > case 87: > -#line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1211 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} > break; > > case 88: > -#line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 89: > -#line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} > break; > > case 90: > -#line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} > break; > > case 91: > -#line 1221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1221 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 92: > -#line 1222 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1222 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 93: > -#line 1223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1223 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} > break; > > case 94: > -#line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1224 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 95: > -#line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1225 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} > break; > > case 96: > -#line 1229 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 97: > -#line 1230 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 98: > -#line 1231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 99: > -#line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1234 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::C; ;} > break; > > case 100: > -#line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1235 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::C; ;} > break; > > case 101: > -#line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1236 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::Fast; ;} > break; > > case 102: > -#line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1237 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::Cold; ;} > break; > > case 103: > -#line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1238 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} > break; > > case 104: > -#line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} > break; > > case 105: > -#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1240 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != > (yyvsp[(2) - (2)].UInt64Val)) > GEN_ERROR("Calling conv too large"); > @@ -3959,129 +3959,129 @@ > break; > > case 106: > -#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 107: > -#line 1248 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1248 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 108: > -#line 1249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1249 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 109: > -#line 1250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1250 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 110: > -#line 1251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1251 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::InReg; ;} > break; > > case 111: > -#line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1252 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} > break; > > case 112: > -#line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1253 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} > break; > > case 113: > -#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1254 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} > break; > > case 114: > -#line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1255 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::Nest; ;} > break; > > case 115: > -#line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1256 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = > > ParamAttr::constructAlignmentFromInt((yyvsp[(2) - > (2)].UInt64Val)); ;} > break; > > case 116: > -#line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1260 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::None; ;} > break; > > case 117: > -#line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1261 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | > (yyvsp[(2) - (2)].ParamAttrs); > ;} > break; > > case 118: > -#line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1266 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} > break; > > case 119: > -#line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1267 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} > break; > > case 120: > -#line 1268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1268 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 121: > -#line 1269 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1269 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 122: > -#line 1270 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1270 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} > break; > > case 123: > -#line 1271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1271 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} > break; > > case 124: > -#line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1274 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::None; ;} > break; > > case 125: > -#line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1275 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | > (yyvsp[(2) - (2)].ParamAttrs); > ;} > break; > > case 126: > -#line 1280 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1280 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 127: > -#line 1281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1281 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); > ;} > break; > > case 128: > -#line 1288 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1288 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = 0; ;} > break; > > case 129: > -#line 1289 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1289 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); > if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) > @@ -4091,12 +4091,12 @@ > break; > > case 130: > -#line 1295 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1295 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = 0; ;} > break; > > case 131: > -#line 1296 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1296 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); > if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) > @@ -4106,7 +4106,7 @@ > break; > > case 132: > -#line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1305 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != > e; ++i) > if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - > (2)].StrVal))[i] == '\\') > @@ -4117,27 +4117,27 @@ > break; > > case 133: > -#line 1313 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1313 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 134: > -#line 1314 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1314 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} > break; > > case 135: > -#line 1319 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1319 "/llvm/lib/AsmParser/llvmAsmParser.y" > {;} > break; > > case 136: > -#line 1320 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1320 "/llvm/lib/AsmParser/llvmAsmParser.y" > {;} > break; > > case 137: > -#line 1321 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1321 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -4146,7 +4146,7 @@ > break; > > case 138: > -#line 1326 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1326 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(2) - (2)].UInt64Val) != 0 && ! > isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) > GEN_ERROR("Alignment must be a power of two"); > @@ -4156,7 +4156,7 @@ > break; > > case 146: > -#line 1342 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1342 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); > CHECK_FOR_ERROR > @@ -4164,7 +4164,7 @@ > break; > > case 147: > -#line 1346 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1346 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); > CHECK_FOR_ERROR > @@ -4172,7 +4172,7 @@ > break; > > case 148: > -#line 1350 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1350 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Pointer type? > if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) > GEN_ERROR("Cannot form a pointer to a basic block"); > @@ -4183,7 +4183,7 @@ > break; > > case 149: > -#line 1357 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1357 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Named types are also simple types... > const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); > CHECK_FOR_ERROR > @@ -4192,7 +4192,7 @@ > break; > > case 150: > -#line 1362 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1362 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Type UpReference > if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) > GEN_ERROR("Value out of range"); > OpaqueType *OT = OpaqueType::get(); // Use temporary > placeholder > @@ -4204,7 +4204,7 @@ > break; > > case 151: > -#line 1370 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1370 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4237,7 +4237,7 @@ > break; > > case 152: > -#line 1399 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1399 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4265,7 +4265,7 @@ > break; > > case 153: > -#line 1424 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1424 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Sized array type? > (yyval.TypeVal) = new > PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - > (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); > delete (yyvsp[(4) - (5)].TypeVal); > @@ -4274,7 +4274,7 @@ > break; > > case 154: > -#line 1429 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1429 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Vector type? > const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); > if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - > (5)].UInt64Val)) > @@ -4288,7 +4288,7 @@ > break; > > case 155: > -#line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1439 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Structure type? > std::vector Elements; > for (std::list::iterator I = (yyvsp[(2) - > (3)].TypeList)->begin(), > @@ -4302,7 +4302,7 @@ > break; > > case 156: > -#line 1449 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1449 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty structure type? > (yyval.TypeVal) = new > PATypeHolder(StructType::get(std::vector())); > CHECK_FOR_ERROR > @@ -4310,7 +4310,7 @@ > break; > > case 157: > -#line 1453 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1453 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::vector Elements; > for (std::list::iterator I = (yyvsp[(3) - > (5)].TypeList)->begin(), > @@ -4324,7 +4324,7 @@ > break; > > case 158: > -#line 1463 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1463 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty structure type? > (yyval.TypeVal) = new > PATypeHolder(StructType::get(std::vector(), true)); > CHECK_FOR_ERROR > @@ -4332,7 +4332,7 @@ > break; > > case 159: > -#line 1470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1470 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4342,7 +4342,7 @@ > break; > > case 160: > -#line 1479 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1479 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (1)].TypeVal))->getDescription()); > @@ -4353,14 +4353,14 @@ > break; > > case 161: > -#line 1486 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1486 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); > ;} > break; > > case 162: > -#line 1491 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1491 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); > (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - > (1)].TypeWithAttrs)); > @@ -4369,7 +4369,7 @@ > break; > > case 163: > -#line 1496 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1496 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))- > >push_back((yyvsp[(3) - (3)].TypeWithAttrs)); > CHECK_FOR_ERROR > @@ -4377,7 +4377,7 @@ > break; > > case 165: > -#line 1504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1504 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); > TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; > @@ -4388,7 +4388,7 @@ > break; > > case 166: > -#line 1511 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1511 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList; > TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; > @@ -4399,7 +4399,7 @@ > break; > > case 167: > -#line 1518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1518 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); > CHECK_FOR_ERROR > @@ -4407,7 +4407,7 @@ > break; > > case 168: > -#line 1526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1526 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeList) = new std::list(); > (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); > @@ -4417,7 +4417,7 @@ > break; > > case 169: > -#line 1532 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1532 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))- > >push_back(*(yyvsp[(3) - (3)].TypeVal)); > delete (yyvsp[(3) - (3)].TypeVal); > @@ -4426,7 +4426,7 @@ > break; > > case 170: > -#line 1544 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1544 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized arr > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (4)].TypeVal))->getDescription()); > @@ -4458,7 +4458,7 @@ > break; > > case 171: > -#line 1572 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1572 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4478,7 +4478,7 @@ > break; > > case 172: > -#line 1588 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1588 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4509,7 +4509,7 @@ > break; > > case 173: > -#line 1615 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1615 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized arr > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (4)].TypeVal))->getDescription()); > @@ -4541,7 +4541,7 @@ > break; > > case 174: > -#line 1643 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1643 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = dyn_cast((yyvsp[(1) - > (4)].TypeVal)->get()); > if (STy == 0) > @@ -4571,7 +4571,7 @@ > break; > > case 175: > -#line 1669 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1669 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4595,7 +4595,7 @@ > break; > > case 176: > -#line 1689 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1689 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = dyn_cast((yyvsp[(1) - > (6)].TypeVal)->get()); > if (STy == 0) > @@ -4625,7 +4625,7 @@ > break; > > case 177: > -#line 1715 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1715 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (5)].TypeVal))->getDescription()); > @@ -4649,7 +4649,7 @@ > break; > > case 178: > -#line 1735 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1735 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4665,7 +4665,7 @@ > break; > > case 179: > -#line 1747 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1747 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4676,7 +4676,7 @@ > break; > > case 180: > -#line 1754 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1754 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4746,7 +4746,7 @@ > break; > > case 181: > -#line 1820 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1820 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4760,7 +4760,7 @@ > break; > > case 182: > -#line 1830 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1830 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4774,7 +4774,7 @@ > break; > > case 183: > -#line 1840 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1840 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // integral constants > if (!ConstantInt::isValueValidForType((yyvsp[(1) - > (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) > GEN_ERROR("Constant value doesn't fit in type"); > @@ -4784,7 +4784,7 @@ > break; > > case 184: > -#line 1846 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1846 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > uint32_t BitWidth = cast((yyvsp[(1) - > (2)].PrimType))->getBitWidth(); > if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { > @@ -4798,7 +4798,7 @@ > break; > > case 185: > -#line 1856 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1856 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // integral constants > if (!ConstantInt::isValueValidForType((yyvsp[(1) - > (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) > GEN_ERROR("Constant value doesn't fit in type"); > @@ -4808,7 +4808,7 @@ > break; > > case 186: > -#line 1862 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1862 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > uint32_t BitWidth = cast((yyvsp[(1) - > (2)].PrimType))->getBitWidth(); > if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { > @@ -4822,7 +4822,7 @@ > break; > > case 187: > -#line 1872 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1872 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Boolean constants > if (cast((yyvsp[(1) - (2)].PrimType))- > >getBitWidth() != 1) > GEN_ERROR("Constant true must have type i1"); > @@ -4832,7 +4832,7 @@ > break; > > case 188: > -#line 1878 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1878 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Boolean constants > if (cast((yyvsp[(1) - (2)].PrimType))- > >getBitWidth() != 1) > GEN_ERROR("Constant false must have type i1"); > @@ -4842,7 +4842,7 @@ > break; > > case 189: > -#line 1884 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1884 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Floating point constants > if (!ConstantFP::isValueValidForType((yyvsp[(1) - > (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) > GEN_ERROR("Floating point constant invalid for type"); > @@ -4857,7 +4857,7 @@ > break; > > case 190: > -#line 1897 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1897 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - > (6)].TypeVal))->getDescription()); > @@ -4873,7 +4873,7 @@ > break; > > case 191: > -#line 1909 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1909 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) > GEN_ERROR("GetElementPtr requires a pointer operand"); > @@ -4898,7 +4898,7 @@ > break; > > case 192: > -#line 1930 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1930 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) > GEN_ERROR("Select condition must be of boolean type"); > @@ -4910,7 +4910,7 @@ > break; > > case 193: > -#line 1938 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1938 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - > (6)].ConstVal)->getType()) > GEN_ERROR("Binary operator types must match"); > @@ -4920,12 +4920,12 @@ > break; > > case 194: > -#line 1944 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1944 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - > (6)].ConstVal)->getType()) > GEN_ERROR("Logical operator types must match"); > if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { > - if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || ! > isa((yyvsp[(3) - (6)].ConstVal)->getType()) || > + if (!isa((yyvsp[(3) - (6)].ConstVal)->getType()) || > !cast((yyvsp[(3) - (6)].ConstVal)->getType())- > >getElementType()->isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > @@ -4935,7 +4935,7 @@ > break; > > case 195: > -#line 1955 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1955 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("icmp operand types must match"); > @@ -4944,7 +4944,7 @@ > break; > > case 196: > -#line 1960 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1960 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("fcmp operand types must match"); > @@ -4953,7 +4953,7 @@ > break; > > case 197: > -#line 1965 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1965 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("vicmp operand types must match"); > @@ -4962,7 +4962,7 @@ > break; > > case 198: > -#line 1970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1970 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("vfcmp operand types must match"); > @@ -4971,7 +4971,7 @@ > break; > > case 199: > -#line 1975 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1975 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ExtractElementInst::isValidOperands((yyvsp[(3) - > (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) > GEN_ERROR("Invalid extractelement operands"); > @@ -4981,7 +4981,7 @@ > break; > > case 200: > -#line 1981 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1981 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!InsertElementInst::isValidOperands((yyvsp[(3) - > (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - > (8)].ConstVal))) > GEN_ERROR("Invalid insertelement operands"); > @@ -4991,7 +4991,7 @@ > break; > > case 201: > -#line 1987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1987 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - > (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - > (8)].ConstVal))) > GEN_ERROR("Invalid shufflevector operands"); > @@ -5001,7 +5001,7 @@ > break; > > case 202: > -#line 1993 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1993 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && ! > isa((yyvsp[(3) - (5)].ConstVal)->getType())) > GEN_ERROR("ExtractValue requires an aggregate operand"); > @@ -5013,7 +5013,7 @@ > break; > > case 203: > -#line 2001 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2001 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && ! > isa((yyvsp[(3) - (7)].ConstVal)->getType())) > GEN_ERROR("InsertValue requires an aggregate operand"); > @@ -5025,7 +5025,7 @@ > break; > > case 204: > -#line 2012 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2012 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))- > >push_back((yyvsp[(3) - (3)].ConstVal)); > CHECK_FOR_ERROR > @@ -5033,7 +5033,7 @@ > break; > > case 205: > -#line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2016 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ConstVector) = new std::vector(); > (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); > @@ -5042,27 +5042,27 @@ > break; > > case 206: > -#line 2024 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = false; ;} > break; > > case 207: > -#line 2024 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = true; ;} > break; > > case 208: > -#line 2027 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2027 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = true; ;} > break; > > case 209: > -#line 2027 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2027 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = false; ;} > break; > > case 210: > -#line 2030 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2030 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); > Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); > @@ -5078,7 +5078,7 @@ > break; > > case 211: > -#line 2042 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Constant *Val = (yyvsp[(3) - (6)].ConstVal); > const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); > @@ -5094,7 +5094,7 @@ > break; > > case 212: > -#line 2063 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2063 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; > CurModule.ModuleDone(); > @@ -5103,7 +5103,7 @@ > break; > > case 213: > -#line 2068 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2068 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; > CurModule.ModuleDone(); > @@ -5112,12 +5112,12 @@ > break; > > case 216: > -#line 2081 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2081 "/llvm/lib/AsmParser/llvmAsmParser.y" > { CurFun.isDeclare = false; ;} > break; > > case 217: > -#line 2081 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2081 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurFun.FunctionDone(); > CHECK_FOR_ERROR > @@ -5125,26 +5125,26 @@ > break; > > case 218: > -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2085 "/llvm/lib/AsmParser/llvmAsmParser.y" > { CurFun.isDeclare = true; ;} > break; > > case 219: > -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2085 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > case 220: > -#line 2088 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2088 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > case 221: > -#line 2091 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2091 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (3)].TypeVal))->getDescription()); > @@ -5172,7 +5172,7 @@ > break; > > case 222: > -#line 2115 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2115 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - > (3)].PrimType)); > > @@ -5187,7 +5187,7 @@ > break; > > case 223: > -#line 2127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2127 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > /* "Externally Visible" Linkage */ > if ((yyvsp[(5) - (6)].ConstVal) == 0) > @@ -5199,14 +5199,14 @@ > break; > > case 224: > -#line 2134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2134 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > ;} > break; > > case 225: > -#line 2138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2138 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(6) - (7)].ConstVal) == 0) > GEN_ERROR("Global value initializer is not a constant"); > @@ -5216,14 +5216,14 @@ > break; > > case 226: > -#line 2143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2143 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > ;} > break; > > case 227: > -#line 2147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2147 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - > (7)].TypeVal))->getDescription()); > @@ -5234,7 +5234,7 @@ > break; > > case 228: > -#line 2153 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2153 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > CHECK_FOR_ERROR > @@ -5242,7 +5242,7 @@ > break; > > case 229: > -#line 2157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2157 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::string Name; > if ((yyvsp[(1) - (5)].StrVal)) { > @@ -5286,21 +5286,21 @@ > break; > > case 230: > -#line 2197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2197 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > case 231: > -#line 2200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2200 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > case 232: > -#line 2206 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2206 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const std::string &AsmSoFar = CurModule.CurrentModule- > >getModuleInlineAsm(); > if (AsmSoFar.empty()) > @@ -5313,7 +5313,7 @@ > break; > > case 233: > -#line 2216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2216 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > @@ -5321,7 +5321,7 @@ > break; > > case 234: > -#line 2220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2220 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > @@ -5329,7 +5329,7 @@ > break; > > case 236: > -#line 2227 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2227 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > @@ -5338,7 +5338,7 @@ > break; > > case 237: > -#line 2232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2232 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5347,14 +5347,14 @@ > break; > > case 238: > -#line 2237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2237 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > case 239: > -#line 2246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2246 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (5)].TypeVal))->getDescription()); > @@ -5368,7 +5368,7 @@ > break; > > case 240: > -#line 2256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2256 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -5382,7 +5382,7 @@ > break; > > case 241: > -#line 2267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2267 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); > CHECK_FOR_ERROR > @@ -5390,7 +5390,7 @@ > break; > > case 242: > -#line 2271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2271 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); > struct ArgListEntry E; > @@ -5403,7 +5403,7 @@ > break; > > case 243: > -#line 2280 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2280 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = new ArgListType; > struct ArgListEntry E; > @@ -5416,7 +5416,7 @@ > break; > > case 244: > -#line 2289 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2289 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = 0; > CHECK_FOR_ERROR > @@ -5424,7 +5424,7 @@ > break; > > case 245: > -#line 2295 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2295 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); > delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! > @@ -5555,7 +5555,7 @@ > break; > > case 248: > -#line 2425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2425 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = CurFun.CurrentFunction; > > @@ -5567,7 +5567,7 @@ > break; > > case 251: > -#line 2436 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2436 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > @@ -5575,7 +5575,7 @@ > break; > > case 252: > -#line 2441 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2441 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); > CurFun.CurrentFunction->setVisibility((yyvsp[(2) - > (3)].Visibility)); > @@ -5586,7 +5586,7 @@ > break; > > case 253: > -#line 2453 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2453 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > @@ -5594,7 +5594,7 @@ > break; > > case 254: > -#line 2457 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2457 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > @@ -5602,7 +5602,7 @@ > break; > > case 255: > -#line 2462 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2462 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // A reference to a direct constant > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); > CHECK_FOR_ERROR > @@ -5610,7 +5610,7 @@ > break; > > case 256: > -#line 2466 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2466 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); > CHECK_FOR_ERROR > @@ -5618,7 +5618,7 @@ > break; > > case 257: > -#line 2470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2470 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), > true); > delete (yyvsp[(1) - (1)].APIntVal); > @@ -5627,7 +5627,7 @@ > break; > > case 258: > -#line 2475 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2475 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), > false); > delete (yyvsp[(1) - (1)].APIntVal); > @@ -5636,7 +5636,7 @@ > break; > > case 259: > -#line 2480 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2480 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Perhaps it's an FP constant? > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); > CHECK_FOR_ERROR > @@ -5644,7 +5644,7 @@ > break; > > case 260: > -#line 2484 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2484 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); > CHECK_FOR_ERROR > @@ -5652,7 +5652,7 @@ > break; > > case 261: > -#line 2488 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2488 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); > CHECK_FOR_ERROR > @@ -5660,7 +5660,7 @@ > break; > > case 262: > -#line 2492 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2492 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createNull(); > CHECK_FOR_ERROR > @@ -5668,7 +5668,7 @@ > break; > > case 263: > -#line 2496 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2496 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createUndef(); > CHECK_FOR_ERROR > @@ -5676,7 +5676,7 @@ > break; > > case 264: > -#line 2500 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2500 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // A vector zero constant. > (yyval.ValIDVal) = ValID::createZeroInit(); > CHECK_FOR_ERROR > @@ -5684,7 +5684,7 @@ > break; > > case 265: > -#line 2504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2504 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized packed vector > const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); > unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); > @@ -5710,7 +5710,7 @@ > break; > > case 266: > -#line 2526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2526 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized arr > const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); > uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); > @@ -5736,7 +5736,7 @@ > break; > > case 267: > -#line 2548 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2548 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Use undef instead of an array because it's inconvenient to > determine > // the element type at this point, there being no elements to > examine. > @@ -5746,7 +5746,7 @@ > break; > > case 268: > -#line 2554 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2554 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); > const Type *ETy = Type::Int8Ty; > @@ -5763,7 +5763,7 @@ > break; > > case 269: > -#line 2567 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2567 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::vector Elements((yyvsp[(2) - (3)].ConstVector)- > >size()); > for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); > i != e; ++i) > @@ -5779,7 +5779,7 @@ > break; > > case 270: > -#line 2579 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2579 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = StructType::get(std::vector Type*>()); > (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, > std::vector())); > @@ -5788,7 +5788,7 @@ > break; > > case 271: > -#line 2584 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2584 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::vector Elements((yyvsp[(3) - (5)].ConstVector)- > >size()); > for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); > i != e; ++i) > @@ -5804,7 +5804,7 @@ > break; > > case 272: > -#line 2596 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2596 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = StructType::get(std::vector Type*>(), > /*isPacked=*/true); > @@ -5814,7 +5814,7 @@ > break; > > case 273: > -#line 2602 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2602 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); > CHECK_FOR_ERROR > @@ -5822,7 +5822,7 @@ > break; > > case 274: > -#line 2606 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2606 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - > (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); > delete (yyvsp[(3) - (5)].StrVal); > @@ -5832,7 +5832,7 @@ > break; > > case 275: > -#line 2616 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2616 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it an integer reference...? > (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - > (1)].UIntVal)); > CHECK_FOR_ERROR > @@ -5840,7 +5840,7 @@ > break; > > case 276: > -#line 2620 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2620 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - > (1)].UIntVal)); > CHECK_FOR_ERROR > @@ -5848,7 +5848,7 @@ > break; > > case 277: > -#line 2624 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2624 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it a named reference...? > (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5857,7 +5857,7 @@ > break; > > case 278: > -#line 2629 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2629 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it a named reference...? > (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5866,7 +5866,7 @@ > break; > > case 281: > -#line 2642 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2642 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -5877,7 +5877,7 @@ > break; > > case 282: > -#line 2651 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2651 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValueList) = new std::vector(); > (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); > @@ -5886,7 +5886,7 @@ > break; > > case 283: > -#line 2656 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2656 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))- > >push_back((yyvsp[(3) - (3)].ValueVal)); > CHECK_FOR_ERROR > @@ -5894,7 +5894,7 @@ > break; > > case 284: > -#line 2661 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2661 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > @@ -5902,7 +5902,7 @@ > break; > > case 285: > -#line 2665 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2665 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Do not allow functions with 0 basic blocks > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > @@ -5910,7 +5910,7 @@ > break; > > case 286: > -#line 2674 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2674 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - > (3)].StrVal)); > CHECK_FOR_ERROR > @@ -5922,7 +5922,7 @@ > break; > > case 287: > -#line 2683 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2683 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (CastInst *CI1 = dyn_cast((yyvsp[(2) - > (2)].InstVal))) > if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) > @@ -5935,7 +5935,7 @@ > break; > > case 288: > -#line 2692 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2692 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty space between instruction lists > (yyval.BasicBlockVal) = > defineBBVal(ValID::createLocalID(CurFun.NextValNum)); > CHECK_FOR_ERROR > @@ -5943,7 +5943,7 @@ > break; > > case 289: > -#line 2696 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2696 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Labelled (named) basic block > (yyval.BasicBlockVal) = > defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5953,7 +5953,7 @@ > break; > > case 290: > -#line 2704 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2704 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Return with a result... > ValueList &VL = *(yyvsp[(2) - (2)].ValueList); > assert(!VL.empty() && "Invalid ret operands!"); > @@ -5977,7 +5977,7 @@ > break; > > case 291: > -#line 2724 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2724 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Return with no result... > (yyval.TermInstVal) = ReturnInst::Create(); > CHECK_FOR_ERROR > @@ -5985,7 +5985,7 @@ > break; > > case 292: > -#line 2728 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2728 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Unconditional Branch... > BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); > CHECK_FOR_ERROR > @@ -5994,7 +5994,7 @@ > break; > > case 293: > -#line 2733 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2733 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (cast((yyvsp[(2) - (9)].PrimType))- > >getBitWidth() != 1) > GEN_ERROR("Branch condition must have type i1"); > @@ -6009,7 +6009,7 @@ > break; > > case 294: > -#line 2744 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2744 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - > (9)].ValIDVal)); > CHECK_FOR_ERROR > @@ -6032,7 +6032,7 @@ > break; > > case 295: > -#line 2763 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2763 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - > (8)].ValIDVal)); > CHECK_FOR_ERROR > @@ -6045,7 +6045,7 @@ > break; > > case 296: > -#line 2773 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2773 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > > // Handle the short syntax > @@ -6134,7 +6134,7 @@ > break; > > case 297: > -#line 2858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2858 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TermInstVal) = new UnwindInst(); > CHECK_FOR_ERROR > @@ -6142,7 +6142,7 @@ > break; > > case 298: > -#line 2862 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2862 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TermInstVal) = new UnreachableInst(); > CHECK_FOR_ERROR > @@ -6150,7 +6150,7 @@ > break; > > case 299: > -#line 2869 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2869 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); > Constant *V = cast(getExistingVal((yyvsp[(2) - > (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); > @@ -6165,7 +6165,7 @@ > break; > > case 300: > -#line 2880 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2880 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.JumpTable) = new std::vector BasicBlock*> >(); > Constant *V = cast(getExistingVal((yyvsp[(1) - > (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); > @@ -6181,7 +6181,7 @@ > break; > > case 301: > -#line 2893 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2893 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Is this definition named?? if so, assign the name... > setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - > (2)].StrVal)); > @@ -6193,7 +6193,7 @@ > break; > > case 302: > -#line 2903 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2903 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Used for PHI nodes > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (6)].TypeVal))->getDescription()); > @@ -6208,7 +6208,7 @@ > break; > > case 303: > -#line 2914 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2914 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); > Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first- > >getType(), (yyvsp[(4) - (7)].ValIDVal)); > @@ -6220,7 +6220,7 @@ > break; > > case 304: > -#line 2924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2924 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > if (!UpRefs.empty()) > @@ -6235,7 +6235,7 @@ > break; > > case 305: > -#line 2935 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2935 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > // Labels are only valid in ASMs > @@ -6247,7 +6247,7 @@ > break; > > case 306: > -#line 2943 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2943 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > if (!UpRefs.empty()) > @@ -6261,7 +6261,7 @@ > break; > > case 307: > -#line 2953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2953 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); > @@ -6272,17 +6272,17 @@ > break; > > case 308: > -#line 2960 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2960 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamList) = new ParamList(); ;} > break; > > case 309: > -#line 2963 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2963 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ValueList) = new std::vector(); ;} > break; > > case 310: > -#line 2964 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2964 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); > (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); > @@ -6291,7 +6291,7 @@ > break; > > case 311: > -#line 2972 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2972 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ConstantList) = new std::vector(); > if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - > (2)].UInt64Val)) > @@ -6301,7 +6301,7 @@ > break; > > case 312: > -#line 2978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2978 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); > if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - > (3)].UInt64Val)) > @@ -6312,7 +6312,7 @@ > break; > > case 313: > -#line 2987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2987 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > @@ -6320,7 +6320,7 @@ > break; > > case 314: > -#line 2991 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2991 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > @@ -6328,7 +6328,7 @@ > break; > > case 315: > -#line 2996 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 2996 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (5)].TypeVal))->getDescription()); > @@ -6348,12 +6348,12 @@ > break; > > case 316: > -#line 3012 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3012 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (5)].TypeVal))->getDescription()); > if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { > - if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || ! > isa((yyvsp[(2) - (5)].TypeVal)->get()) || > + if (!isa((yyvsp[(2) - (5)].TypeVal)->get()) || > !cast((yyvsp[(2) - (5)].TypeVal)->get())- > >getElementType()->isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > @@ -6369,7 +6369,7 @@ > break; > > case 317: > -#line 3029 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3029 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6387,7 +6387,7 @@ > break; > > case 318: > -#line 3043 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3043 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6405,7 +6405,7 @@ > break; > > case 319: > -#line 3057 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3057 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6423,7 +6423,7 @@ > break; > > case 320: > -#line 3071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3071 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6441,7 +6441,7 @@ > break; > > case 321: > -#line 3085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3085 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - > (4)].TypeVal))->getDescription()); > @@ -6457,7 +6457,7 @@ > break; > > case 322: > -#line 3097 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3097 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) > GEN_ERROR("select condition must be boolean"); > @@ -6469,7 +6469,7 @@ > break; > > case 323: > -#line 3105 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3105 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - > (4)].TypeVal))->getDescription()); > @@ -6480,7 +6480,7 @@ > break; > > case 324: > -#line 3112 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3112 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ExtractElementInst::isValidOperands((yyvsp[(2) - > (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) > GEN_ERROR("Invalid extractelement operands"); > @@ -6490,7 +6490,7 @@ > break; > > case 325: > -#line 3118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3118 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!InsertElementInst::isValidOperands((yyvsp[(2) - > (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - > (6)].ValueVal))) > GEN_ERROR("Invalid insertelement operands"); > @@ -6500,7 +6500,7 @@ > break; > > case 326: > -#line 3124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3124 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - > (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - > (6)].ValueVal))) > GEN_ERROR("Invalid shufflevector operands"); > @@ -6510,7 +6510,7 @@ > break; > > case 327: > -#line 3130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3130 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first- > >getType(); > if (!Ty->isFirstClassType()) > @@ -6529,7 +6529,7 @@ > break; > > case 328: > -#line 3146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3146 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > > // Handle the short syntax > @@ -6622,7 +6622,7 @@ > break; > > case 329: > -#line 3235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3235 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); > CHECK_FOR_ERROR > @@ -6630,7 +6630,7 @@ > break; > > case 330: > -#line 3240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3240 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > @@ -6638,7 +6638,7 @@ > break; > > case 331: > -#line 3244 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3244 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > @@ -6646,7 +6646,7 @@ > break; > > case 332: > -#line 3251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3251 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (3)].TypeVal))->getDescription()); > @@ -6657,7 +6657,7 @@ > break; > > case 333: > -#line 3258 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3258 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (6)].TypeVal))->getDescription()); > @@ -6671,7 +6671,7 @@ > break; > > case 334: > -#line 3268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3268 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (3)].TypeVal))->getDescription()); > @@ -6682,7 +6682,7 @@ > break; > > case 335: > -#line 3275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3275 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (6)].TypeVal))->getDescription()); > @@ -6696,7 +6696,7 @@ > break; > > case 336: > -#line 3285 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3285 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) > GEN_ERROR("Trying to free nonpointer type " + > @@ -6707,7 +6707,7 @@ > break; > > case 337: > -#line 3293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3293 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (5)].TypeVal))->getDescription()); > @@ -6725,7 +6725,7 @@ > break; > > case 338: > -#line 3307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3307 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - > (7)].TypeVal))->getDescription()); > @@ -6746,7 +6746,7 @@ > break; > > case 339: > -#line 3324 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3324 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (5)].TypeVal))->getDescription()); > @@ -6764,7 +6764,7 @@ > break; > > case 340: > -#line 3338 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3338 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (4)].TypeVal))->getDescription()); > @@ -6783,7 +6783,7 @@ > break; > > case 341: > -#line 3353 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3353 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (4)].TypeVal))->getDescription()); > @@ -6802,7 +6802,7 @@ > break; > > case 342: > -#line 3368 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3368 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (7)].TypeVal))->getDescription()); > @@ -7038,7 +7038,7 @@ > } > > > -#line 3387 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3387 "/llvm/lib/AsmParser/llvmAsmParser.y" > > > // common code from the two 'RunVMAsmParser' functions > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Jul 29 10:49:41 > 2008 > @@ -354,7 +354,7 @@ > > #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED > typedef union YYSTYPE > -#line 967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 967 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > llvm::Module *ModuleVal; > llvm::Function *FunctionVal; > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Jul 29 10:49:41 2008 > @@ -1945,7 +1945,7 @@ > if ($3->getType() != $5->getType()) > GEN_ERROR("Logical operator types must match"); > if (!$3->getType()->isInteger()) { > - if (Instruction::isShift($1) || !isa($3- > >getType()) || > + if (!isa($3->getType()) || > !cast($3->getType())->getElementType()- > >isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > @@ -3013,7 +3013,7 @@ > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*$2)- > >getDescription()); > if (!(*$2)->isInteger()) { > - if (Instruction::isShift($1) || !isa($2->get()) || > + if (!isa($2->get()) || > !cast($2->get())->getElementType()->isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Jul 29 10:49:41 > 2008 > @@ -1945,7 +1945,7 @@ > if ($3->getType() != $5->getType()) > GEN_ERROR("Logical operator types must match"); > if (!$3->getType()->isInteger()) { > - if (Instruction::isShift($1) || !isa($3- > >getType()) || > + if (!isa($3->getType()) || > !cast($3->getType())->getElementType()- > >isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > @@ -3013,7 +3013,7 @@ > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*$2)- > >getDescription()); > if (!(*$2)->isInteger()) { > - if (Instruction::isShift($1) || !isa($2->get()) || > + if (!isa($2->get()) || > !cast($2->get())->getElementType()->isInteger()) > GEN_ERROR("Logical operator requires integral operands"); > } > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 29 > 10:49:41 2008 > @@ -2958,7 +2958,17 @@ > Tmp2 = PromoteOp(Node->getOperand(1)); // Promote the RHS. > break; > } > - > + > + if ((Node->getOpcode() == ISD::SHL || > + Node->getOpcode() == ISD::SRL || > + Node->getOpcode() == ISD::SRA) && > + !Node->getValueType(0).isVector()) { > + if (TLI.getShiftAmountTy().bitsLT(Tmp2.getValueType())) > + Tmp2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), > Tmp2); > + else if (TLI.getShiftAmountTy().bitsGT(Tmp2.getValueType())) > + Tmp2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), > Tmp2); > + } > + > Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2); > > switch (TLI.getOperationAction(Node->getOpcode(), Node- > >getValueType(0))) { > @@ -2966,8 +2976,11 @@ > case TargetLowering::Legal: break; > case TargetLowering::Custom: > Tmp1 = TLI.LowerOperation(Result, DAG); > - if (Tmp1.Val) Result = Tmp1; > - break; > + if (Tmp1.Val) { > + Result = Tmp1; > + break; > + } > + // Fall through if the custom lower can't deal with the > operation > case TargetLowering::Expand: { > MVT VT = Op.getValueType(); > > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Jul > 29 10:49:41 2008 > @@ -2407,11 +2407,12 @@ > void SelectionDAGLowering::visitShift(User &I, unsigned Opcode) { > SDValue Op1 = getValue(I.getOperand(0)); > SDValue Op2 = getValue(I.getOperand(1)); > - > - if (TLI.getShiftAmountTy().bitsLT(Op2.getValueType())) > - Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2); > - else if (TLI.getShiftAmountTy().bitsGT(Op2.getValueType())) > - Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); > + if (!isa(I.getType())) { > + if (TLI.getShiftAmountTy().bitsLT(Op2.getValueType())) > + Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2); > + else if (TLI.getShiftAmountTy().bitsGT(Op2.getValueType())) > + Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), > Op2); > + } > > setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2)); > } > > Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > (original) > +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue > Jul 29 10:49:41 2008 > @@ -6368,7 +6368,8 @@ > return ReplaceInstUsesWith(I, CSI); > > // See if we can turn a signed shr into an unsigned shr. > - if (MaskedValueIsZero(Op0, > + if (!isa(I.getType()) && > + MaskedValueIsZero(Op0, > APInt::getSignBit(I.getType()- > >getPrimitiveSizeInBits()))) > return BinaryOperator::CreateLShr(Op0, I.getOperand(1)); > > > Modified: llvm/trunk/lib/VMCore/Instructions.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Instructions.cpp (original) > +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Jul 29 10:49:41 2008 > @@ -874,6 +874,7 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > > void StoreInst::AssertOK() { > + assert(getOperand(0) && getOperand(1) && "Both operands must be > non-null!"); > assert(isa(getOperand(1)->getType()) && > "Ptr must have pointer type!"); > assert(getOperand(0)->getType() == > @@ -1535,8 +1536,10 @@ > case AShr: > assert(getType() == LHS->getType() && > "Shift operation should return same type as operands!"); > - assert(getType()->isInteger() && > - "Shift operation requires integer operands"); > + assert((getType()->isInteger() || > + (isa(getType()) && > + cast(getType())->getElementType()- > >isInteger())) && > + "Tried to create a shift operation on a non-integral > type!"); > break; > case And: case Or: > case Xor: > > Modified: llvm/trunk/lib/VMCore/Verifier.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=54161&r1=54160&r2=54161&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Verifier.cpp (original) > +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 29 10:49:41 2008 > @@ -973,8 +973,10 @@ > case Instruction::Shl: > case Instruction::LShr: > case Instruction::AShr: > - Assert1(B.getType()->isInteger(), > - "Shift must return an integer result!", &B); > + Assert1(B.getType()->isInteger() || > + (isa(B.getType()) && > + cast(B.getType())->getElementType()- > >isInteger()), > + "Shifts only work with integral types!", &B); > Assert1(B.getType() == B.getOperand(0)->getType(), > "Shift return type must be same as operands!", &B); > /* FALL THROUGH */ > @@ -1041,9 +1043,13 @@ > // Check to see if Mask is valid. > if (const ConstantVector *MV = > dyn_cast(SV.getOperand(2))) { > for (unsigned i = 0, e = MV->getNumOperands(); i != e; ++i) { > - Assert1(isa(MV->getOperand(i)) || > - isa(MV->getOperand(i)), > - "Invalid shufflevector shuffle mask!", &SV); > + if (ConstantInt* CI = dyn_cast(MV- > >getOperand(i))) { > + Assert1(!CI->uge(MV->getNumOperands()*2), > + "Invalid shufflevector shuffle mask!", &SV); > + } else { > + Assert1(isa(MV->getOperand(i)), > + "Invalid shufflevector shuffle mask!", &SV); > + } > } > } else { > Assert1(isa(SV.getOperand(2)) || > > Added: llvm/trunk/test/Assembler/vector-shift.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vector-shift.ll?rev=54161&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Assembler/vector-shift.ll (added) > +++ llvm/trunk/test/Assembler/vector-shift.ll Tue Jul 29 10:49:41 2008 > @@ -0,0 +1,21 @@ > +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep shl > +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep ashr > +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep lshr > + > +define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind { > +entry: > + %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1] > + ret <4 x i32> %cmp > +} > + > +define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind { > +entry: > + %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1] > + ret <4 x i32> %cmp > +} > + > +define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind { > +entry: > + %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1] > + ret <4 x i32> %cmp > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From natebegeman at mac.com Tue Jul 29 13:28:31 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jul 2008 18:28:31 -0000 Subject: [llvm-commits] [llvm] r54164 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200807291828.m6TISWNC002652@zion.cs.uiuc.edu> Author: sampo Date: Tue Jul 29 13:28:31 2008 New Revision: 54164 URL: http://llvm.org/viewvc/llvm-project?rev=54164&view=rev Log: Disable a fix in the previous patch, since it breaks CellSPU. The CellSPU codegen is broken, but needs to be fixed before we can put this back in. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=54164&r1=54163&r2=54164&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 29 13:28:31 2008 @@ -2976,10 +2976,12 @@ case TargetLowering::Legal: break; case TargetLowering::Custom: Tmp1 = TLI.LowerOperation(Result, DAG); - if (Tmp1.Val) { + if (Tmp1.Val) + // FIXME: these braces are correct, but breaks CellSPU codegen. + //{ Result = Tmp1; break; - } + //} // Fall through if the custom lower can't deal with the operation case TargetLowering::Expand: { MVT VT = Op.getValueType(); From baldrick at free.fr Tue Jul 29 13:31:42 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jul 2008 18:31:42 -0000 Subject: [llvm-commits] [llvm] r54165 - /llvm/trunk/autoconf/install-sh Message-ID: <200807291831.m6TIVgwr002853@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 29 13:31:42 2008 New Revision: 54165 URL: http://llvm.org/viewvc/llvm-project?rev=54165&view=rev Log: Set the executable bit - means it can actually be run when installing on sparc sun. Set the mime type to text/x-sh while there. Modified: llvm/trunk/autoconf/install-sh (props changed) Propchange: llvm/trunk/autoconf/install-sh ------------------------------------------------------------------------------ svn:executable = * Propchange: llvm/trunk/autoconf/install-sh ------------------------------------------------------------------------------ svn:mime-type = text/x-sh From natebegeman at mac.com Tue Jul 29 13:32:39 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jul 2008 11:32:39 -0700 Subject: [llvm-commits] [llvm] r54161 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Assembler/vector-shift.ll In-Reply-To: <4D6B23FA-02F2-4BE4-8E4E-661ED48F5605@apple.com> References: <200807291549.m6TFnlRZ028767@zion.cs.uiuc.edu> <4D6B23FA-02F2-4BE4-8E4E-661ED48F5605@apple.com> Message-ID: the CellSPU backend is broken somehow in regards to custom lowering, but I haven't had a chance to investigate. I disabled the relevant change in Legalize with a FIXME> Nate On Jul 29, 2008, at 11:22 AM, Dan Gohman wrote: > Hello, > > It appears this patch breaks CodeGen/CellSPU/and_ops.ll. Can you > investigate? > > Thanks, > > Dan From isanbard at gmail.com Tue Jul 29 13:41:49 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 18:41:49 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54166 - in /llvm-gcc-4.2/trunk/fixincludes/tests/base: mach-o/swap.h stdint.h Message-ID: <200807291841.m6TIfnpX003227@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 13:41:48 2008 New Revision: 54166 URL: http://llvm.org/viewvc/llvm-project?rev=54166&view=rev Log: Update to GCC 4.2 TOT from r142930. - Add missing files. Added: llvm-gcc-4.2/trunk/fixincludes/tests/base/mach-o/swap.h llvm-gcc-4.2/trunk/fixincludes/tests/base/stdint.h Added: llvm-gcc-4.2/trunk/fixincludes/tests/base/mach-o/swap.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/fixincludes/tests/base/mach-o/swap.h?rev=54166&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/fixincludes/tests/base/mach-o/swap.h (added) +++ llvm-gcc-4.2/trunk/fixincludes/tests/base/mach-o/swap.h Tue Jul 29 13:41:48 2008 @@ -0,0 +1,26 @@ +/* DO NOT EDIT THIS FILE. APPLE LOCAL file + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/mach-o/swap.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + +#ifndef FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_MACHO_SWAPH_EXTERNC +#define FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_MACHO_SWAPH_EXTERNC 1 + +#if __cplusplus +extern "C" { +#endif + + +#if defined( DARWIN_MACHO_SWAPH_EXTERNC_CHECK ) +extern void swap_fat_header(); + +#endif /* DARWIN_MACHO_SWAPH_EXTERNC_CHECK */ +#if __cplusplus +} +#endif + +#endif /* FIXINC_WRAP_MACH_O_SWAP_H_DARWIN_MACHO_SWAPH_EXTERNC */ Added: llvm-gcc-4.2/trunk/fixincludes/tests/base/stdint.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/fixincludes/tests/base/stdint.h?rev=54166&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/fixincludes/tests/base/stdint.h (added) +++ llvm-gcc-4.2/trunk/fixincludes/tests/base/stdint.h Tue Jul 29 13:41:48 2008 @@ -0,0 +1,16 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/stdint.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( IRIX_STDINT_C99_CHECK ) +#if 0 +#error This header file is to be used only for c99 mode compilations +#else +#endif /* IRIX_STDINT_C99_CHECK */ From matthijs at stdin.nl Wed Jul 30 07:53:19 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 30 Jul 2008 12:53:19 -0000 Subject: [llvm-commits] [llvm] r54210 - /llvm/trunk/include/llvm/BasicBlock.h Message-ID: <200807301253.m6UCrKrl021997@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 30 07:53:14 2008 New Revision: 54210 URL: http://llvm.org/viewvc/llvm-project?rev=54210&view=rev Log: Document BasicBlock::Create. Modified: llvm/trunk/include/llvm/BasicBlock.h Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=54210&r1=54209&r2=54210&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Wed Jul 30 07:53:14 2008 @@ -74,7 +74,9 @@ typedef InstListType::iterator iterator; typedef InstListType::const_iterator const_iterator; - // allocate space for exactly zero operands + /// Create - Creates a new BasicBlock. If the Parent parameter is specified, + /// the basic block is automatically inserted at either the end of the + /// function (if InsertBefore is 0), or before the specified basic block. static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0, BasicBlock *InsertBefore = 0) { return new BasicBlock(Name, Parent, InsertBefore); From isanbard at gmail.com Wed Jul 30 01:51:52 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 06:51:52 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54203 - in /llvm-gcc-4.2/trunk/gcc: c-common.c cp/decl.c flags.h toplev.c var-tracking.c varasm.c Message-ID: <200807300651.m6U6pr6o028186@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 01:51:51 2008 New Revision: 54203 URL: http://llvm.org/viewvc/llvm-project?rev=54203&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/cp/decl.c llvm-gcc-4.2/trunk/gcc/flags.h llvm-gcc-4.2/trunk/gcc/toplev.c llvm-gcc-4.2/trunk/gcc/var-tracking.c llvm-gcc-4.2/trunk/gcc/varasm.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Wed Jul 30 01:51:51 2008 @@ -745,12 +745,12 @@ { "sentinel", 0, 2, false, true, true, handle_sentinel_attribute }, /* LLVM LOCAL begin */ - #ifdef ENABLE_LLVM +#ifdef ENABLE_LLVM { "annotate", 0, -1, true, false, false, handle_annotate_attribute }, { "gcroot", 0, 0, false, true, false, handle_gcroot_attribute }, - #endif +#endif /* LLVM LOCAL end */ /* APPLE LOCAL radar 5932809 - copyable byref blocks */ { "blocks", 1, 1, true, false, false, handle_blocks_attribute }, @@ -3254,19 +3254,20 @@ return value; } +/* APPLE LOCAL begin mainline aligned functions 5933878 */ /* Implement the __alignof keyword: Return the minimum required - alignment of EXPR, measured in bytes. For VAR_DECL's and - FIELD_DECL's return DECL_ALIGN (which can be set from an - "aligned" __attribute__ specification). */ + alignment of EXPR, measured in bytes. For VAR_DECLs, + FUNCTION_DECLs and FIELD_DECLs return DECL_ALIGN (which can be set + from an "aligned" __attribute__ specification). */ tree c_alignof_expr (tree expr) { tree t; - if (TREE_CODE (expr) == VAR_DECL) + if (VAR_OR_FUNCTION_DECL_P (expr)) t = size_int (DECL_ALIGN_UNIT (expr)); - +/* APPLE LOCAL end mainline aligned functions 5933878 */ else if (TREE_CODE (expr) == COMPONENT_REF && DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1))) { @@ -5095,7 +5096,8 @@ TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT; TYPE_USER_ALIGN (*type) = 1; } - else if (TREE_CODE (decl) != VAR_DECL + /* APPLE LOCAL mainline aligned functions 5933878 */ + else if (! VAR_OR_FUNCTION_DECL_P (decl) /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ && TREE_CODE (decl) != FIELD_DECL && TREE_CODE (decl) != LABEL_DECL) @@ -5104,6 +5106,20 @@ error ("alignment may not be specified for %q+D", decl); *no_add_attrs = true; } + /* APPLE LOCAL begin mainline aligned functions 5933878 */ + else if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_ALIGN (decl) > (1 << i) * BITS_PER_UNIT) + { + if (DECL_USER_ALIGN (decl)) + error ("alignment for %q+D was previously specified as %d " + "and may not be decreased", decl, + DECL_ALIGN (decl) / BITS_PER_UNIT); + else + error ("alignment for %q+D must be at least %d", decl, + DECL_ALIGN (decl) / BITS_PER_UNIT); + *no_add_attrs = true; + } + /* APPLE LOCAL end mainline aligned functions 5933878 */ else { DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT; @@ -9002,10 +9018,4 @@ } -/* APPLE LOCAL begin define this sensibly in all languages */ -bool c_flag_no_builtin(void) { - return flag_no_builtin; -} -/* APPLE LOCAL end define this sensibly in all languages */ - #include "gt-c-common.h" Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Wed Jul 30 01:51:51 2008 @@ -3284,11 +3284,9 @@ default_visibility = VISIBILITY_HIDDEN; /* APPLE LOCAL end mainline 2007-06-28 ms tinfo compat 4230099 */ - /* Force minimum function alignment if using the least significant - bit of function pointers to store the virtual bit. */ - if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn - && force_align_functions_log < 1) - force_align_functions_log = 1; + /* APPLE LOCAL begin mainline aligned functions 5933878 */ + /* Removed lines. */ + /* APPLE LOCAL end mainline aligned functions 5933878 */ /* Initially, C. */ current_lang_name = lang_name_c; @@ -6267,6 +6265,16 @@ if (TYPE_VOLATILE (type)) TREE_THIS_VOLATILE (decl) = 1; + /* APPLE LOCAL begin mainline aligned functions 5933878 */ + /* If pointers to member functions use the least significant bit to + indicate whether a function is virtual, ensure a pointer + to this function will have that bit clear. */ + if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn + && TREE_CODE (type) == METHOD_TYPE + && DECL_ALIGN (decl) < 2 * BITS_PER_UNIT) + DECL_ALIGN (decl) = 2 * BITS_PER_UNIT; + /* APPLE LOCAL end mainline aligned functions 5933878 */ + if (friendp && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR) { Modified: llvm-gcc-4.2/trunk/gcc/flags.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flags.h?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/flags.h (original) +++ llvm-gcc-4.2/trunk/gcc/flags.h Wed Jul 30 01:51:51 2008 @@ -239,8 +239,6 @@ extern int align_functions_log; /* APPLE LOCAL begin mainline aligned functions 5933878 */ -/* LLVM FIXME: Remove next line!! */ -extern int force_align_functions_log; /* Removed extern force_align_functions_log. */ /* APPLE LOCAL end mainline aligned functions 5933878 */ Modified: llvm-gcc-4.2/trunk/gcc/toplev.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/toplev.c (original) +++ llvm-gcc-4.2/trunk/gcc/toplev.c Wed Jul 30 01:51:51 2008 @@ -399,9 +399,9 @@ int align_labels_max_skip; int align_functions_log; -/* Like align_functions_log above, but used by front-ends to force the - minimum function alignment. Zero means no alignment is forced. */ -int force_align_functions_log; +/* APPLE LOCAL begin mainline aligned functions 5933878 */ +/* Removed force_align_functions_log. */ +/* APPLE LOCAL end mainline aligned functions 5933878 */ typedef struct { Modified: llvm-gcc-4.2/trunk/gcc/var-tracking.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/var-tracking.c?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/var-tracking.c (original) +++ llvm-gcc-4.2/trunk/gcc/var-tracking.c Wed Jul 30 01:51:51 2008 @@ -1867,6 +1867,13 @@ && SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc) src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); } + /* APPLE LOCAL begin ARM 5595749 */ + else if (GET_CODE (PATTERN (insn)) == COND_EXEC + && GET_CODE (COND_EXEC_CODE (PATTERN (insn))) == SET) + src = SET_SRC (COND_EXEC_CODE (PATTERN (insn))); + else + gcc_unreachable (); + /* APPLE LOCAL end ARM 5595749 */ if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); @@ -1905,6 +1912,13 @@ && SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc) src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); } + /* APPLE LOCAL begin ARM 5595749 */ + else if (GET_CODE (PATTERN (insn)) == COND_EXEC + && GET_CODE (COND_EXEC_CODE (PATTERN (insn))) == SET) + src = SET_SRC (COND_EXEC_CODE (PATTERN (insn))); + else + gcc_unreachable (); + /* APPLE LOCAL end ARM 5595749 */ if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); Modified: llvm-gcc-4.2/trunk/gcc/varasm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=54203&r1=54202&r2=54203&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/varasm.c (original) +++ llvm-gcc-4.2/trunk/gcc/varasm.c Wed Jul 30 01:51:51 2008 @@ -54,7 +54,9 @@ #include "cfglayout.h" #include "basic-block.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif /* LLVM LOCAL end */ #ifdef XCOFF_DEBUGGING_INFO @@ -1478,19 +1480,19 @@ && !hot_label_written) ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label); + /* APPLE LOCAL begin mainline aligned functions 5933878 */ /* Tell assembler to move to target machine's alignment for functions. */ - align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); - if (align < force_align_functions_log) - align = force_align_functions_log; + align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT); if (align > 0) { ASM_OUTPUT_ALIGN (asm_out_file, align); } /* Handle a user-specified function alignment. - Note that we still need to align to FUNCTION_BOUNDARY, as above, + Note that we still need to align to DECL_ALIGN, as above, because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */ - if (align_functions_log > align + if (! DECL_USER_ALIGN (decl) + && align_functions_log > align && cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN @@ -1500,6 +1502,7 @@ ASM_OUTPUT_ALIGN (asm_out_file, align_functions_log); #endif } + /* APPLE LOCAL end mainline aligned functions 5933878 */ #ifdef ASM_OUTPUT_FUNCTION_PREFIX ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname); @@ -5290,7 +5293,7 @@ emit_alias_to_llvm(decl, target, target_decl); #endif #else - do_assemble_alias (decl, target); + do_assemble_alias (decl, target); #endif else { @@ -5315,7 +5318,6 @@ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); type = visibility_types[vis]; - #ifdef HAVE_GAS_HIDDEN /* LLVM LOCAL */ #ifndef ENABLE_LLVM From isanbard at gmail.com Wed Jul 30 02:11:17 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 07:11:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54204 - in /llvm-gcc-4.2/trunk/gcc: bb-reorder.c c-common.c c-format.c c-parser.c cp/call.c cp/decl2.c cp/except.c cp/lex.c cp/pt.c objc/objc-act.c tree-inline.c tree-optimize.c Message-ID: <200807300711.m6U7BIgE028890@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 02:11:17 2008 New Revision: 54204 URL: http://llvm.org/viewvc/llvm-project?rev=54204&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/bb-reorder.c llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/c-format.c llvm-gcc-4.2/trunk/gcc/c-parser.c llvm-gcc-4.2/trunk/gcc/cp/call.c llvm-gcc-4.2/trunk/gcc/cp/decl2.c llvm-gcc-4.2/trunk/gcc/cp/except.c llvm-gcc-4.2/trunk/gcc/cp/lex.c llvm-gcc-4.2/trunk/gcc/cp/pt.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/tree-inline.c llvm-gcc-4.2/trunk/gcc/tree-optimize.c Modified: llvm-gcc-4.2/trunk/gcc/bb-reorder.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/bb-reorder.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/bb-reorder.c (original) +++ llvm-gcc-4.2/trunk/gcc/bb-reorder.c Wed Jul 30 02:11:17 2008 @@ -87,6 +87,7 @@ /* LLVM LOCAL begin comment out most of this file */ #ifndef ENABLE_LLVM + #ifndef HAVE_conditional_execution #define HAVE_conditional_execution 0 #endif @@ -1967,7 +1968,7 @@ } } } -#endif +#endif /* !ENABLE_LLVM */ /* LLVM LOCAL end */ /* Duplicate the blocks containing computed gotos. This basically unfactors @@ -1982,6 +1983,7 @@ return (optimize > 0 && flag_expensive_optimizations && !optimize_size); } + static unsigned int duplicate_computed_gotos (void) { Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Wed Jul 30 02:11:17 2008 @@ -5818,7 +5818,10 @@ return NULL_TREE; } - if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE) + /* APPLE LOCAL begin blocks 5925781 */ + if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE && + TREE_CODE (TREE_VALUE (argument)) != BLOCK_POINTER_TYPE) + /* APPLE LOCAL end blocks 5925781 */ { error ("nonnull argument references non-pointer operand (argument %lu, operand %lu)", (unsigned long) attr_arg_num, (unsigned long) arg_num); @@ -5986,7 +5989,10 @@ happen if the "nonnull" attribute was given without an operand list (which means to check every pointer argument). */ - if (TREE_CODE (TREE_TYPE (param)) != POINTER_TYPE) + /* APPLE LOCAL begin blocks 5925781 */ + if (TREE_CODE (TREE_TYPE (param)) != POINTER_TYPE && + TREE_CODE (TREE_TYPE (param)) != BLOCK_POINTER_TYPE) + /* APPLE LOCAL end blocks 5925781 */ return; if (integer_zerop (param)) Modified: llvm-gcc-4.2/trunk/gcc/c-format.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-format.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-format.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-format.c Wed Jul 30 02:11:17 2008 @@ -713,6 +713,11 @@ /* GNU conversion specifiers. */ { "kls", 0, STD_EXT, NOLENGTHS, "-_0Ow", "", NULL }, { "P", 0, STD_EXT, NOLENGTHS, "", "", NULL }, + /* APPLE LOCAL begin strftime 5838528 */ +#ifdef CONFIG_DARWIN_H + { "+", 0, STD_EXT, NOLENGTHS, "E", "", NULL }, +#endif + /* APPLE LOCAL end strftime 5838528 */ { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-parser.c Wed Jul 30 02:11:17 2008 @@ -1571,7 +1571,11 @@ /* Function definition (nested or otherwise). */ if (nested) { - if (pedantic) + /* APPLE LOCAL begin radar 5985368 */ + if (declarator->declarator && declarator->declarator->kind == cdk_block_pointer) + error ("bad definition of a block"); + else if (pedantic) + /* APPLE LOCAL end radar 5985368 */ pedwarn ("ISO C forbids nested functions"); /* APPLE LOCAL begin nested functions 4258406 4357979 (in 4.2 m) */ else if (flag_nested_functions == 0) @@ -4387,7 +4391,8 @@ /* APPLE LOCAL begin radar 4708210 (for_objc_collection in 4.2) */ cond = NULL_TREE; c_parser_declaration_or_fndef (parser, true, true, true, true, &cond); - if (c_parser_next_token_is_keyword (parser, RID_IN)) + /* APPLE LOCAL radar 5925639 */ + if (c_parser_next_token_is_keyword (parser, RID_IN) && cond) { cond = finish_parse_foreach_header (parser, cond); foreach_p = true; @@ -4415,7 +4420,8 @@ cond = NULL_TREE; c_parser_declaration_or_fndef (parser, true, true, true, true, &cond); restore_extension_diagnostics (ext); - if (c_parser_next_token_is_keyword (parser, RID_IN)) + /* APPLE LOCAL radar 5925639 */ + if (c_parser_next_token_is_keyword (parser, RID_IN) && cond) { cond = finish_parse_foreach_header (parser, cond); foreach_p = true; @@ -5471,6 +5477,8 @@ assignment-expression , assignment-expression ) __builtin_types_compatible_p ( type-name , type-name ) + APPLE LOCAL blocks (C++ cf) + ^ block-literal-expr offsetof-member-designator: identifier @@ -6001,29 +6009,6 @@ expr.original_code = ERROR_MARK; break; } - /* (in 4.2 be) */ - if (c_parser_next_token_is (parser, CPP_ATSIGN)) - { - tree id; - location_t loc = c_parser_peek_token (parser)->location; - c_parser_consume_token (parser); - if (c_parser_peek_token (parser)->id_kind != C_ID_ID) - { - c_parser_error (parser, "expected identifier"); - expr.value = error_mark_node; - expr.original_code = ERROR_MARK; - break; - } - - id = c_parser_peek_token (parser)->value; - c_parser_consume_token (parser); - id = prepend_char_identifier (id, '@'); - expr.value = build_external_ref (id, - (c_parser_peek_token (parser)->type - == CPP_OPEN_PAREN), loc); - expr.original_code = ERROR_MARK; - break; - } } /* APPLE LOCAL end CW asm blocks */ c_parser_error (parser, "expected expression"); @@ -9224,17 +9209,6 @@ operand = iasm_build_register_offset (operand, op2.value); } - /* (in 4.2 bd) */ - while (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) - { - struct c_expr op2; - c_parser_consume_token (parser); - op2 = c_parser_expr_no_commas (parser, NULL); - c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, - "expected %<)%>"); - operand = iasm_build_register_offset (operand, op2.value); - } - return operand; } Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/call.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/call.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/call.c Wed Jul 30 02:11:17 2008 @@ -907,6 +907,15 @@ && DERIVED_FROM_P (t1, t2))); } +/* APPLE LOCAL begin radar 6029624 */ +/* Used in objective-c++, same as reference_related_p */ +bool +objcp_reference_related_p (tree t1, tree t2) +{ + return reference_related_p (t1, t2); +} +/* APPLE LOCAL end radar 6029624 */ + /* Returns nonzero if T1 is reference-compatible with T2. */ static bool Modified: llvm-gcc-4.2/trunk/gcc/cp/decl2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl2.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl2.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl2.c Wed Jul 30 02:11:17 2008 @@ -1604,6 +1604,17 @@ DECL_VISIBILITY (decl) = visibility; return true; } + /* APPLE LOCAL begin constrain visibility for templates 5813435 */ + else if (visibility > DECL_VISIBILITY (decl) + && DECL_VISIBILITY_SPECIFIED (decl) + && !lookup_attribute ("visibility", DECL_ATTRIBUTES (decl)) + && !lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl))) + { + /* We also constrain implicit visibilities (for templates). */ + DECL_VISIBILITY (decl) = visibility; + return true; + } + /* APPLE LOCAL end constrain visibility for templates 5813435 */ return false; } Modified: llvm-gcc-4.2/trunk/gcc/cp/except.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/except.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/except.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/except.c Wed Jul 30 02:11:17 2008 @@ -56,7 +56,8 @@ static int can_convert_eh (tree, tree); static tree cp_protect_cleanup_actions (void); -/* LLVM local begin */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Do nothing (return NULL_TREE). */ static tree return_null_tree (void); @@ -65,7 +66,8 @@ { return NULL_TREE; } -/* LLVM local end */ +#endif +/* LLVM LOCAL end */ /* Sets up all the global eh stuff that needs to be initialized at the start of compilation. */ @@ -89,22 +91,36 @@ call_unexpected_node = push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp); - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM llvm_eh_personality_libfunc = llvm_init_one_libfunc (USING_SJLJ_EXCEPTIONS ? "__gxx_personality_sj0" : "__gxx_personality_v0"); - /* LLVM local end */ +#else + eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS + ? "__gxx_personality_sj0" + : "__gxx_personality_v0"); +#endif + /* LLVM LOCAL end */ if (targetm.arm_eabi_unwinder) - /* LLVM local */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM llvm_unwind_resume_libfunc = llvm_init_one_libfunc ("__cxa_end_cleanup"); +#else + unwind_resume_libfunc = init_one_libfunc ("__cxa_end_cleanup"); +#endif + /* LLVM LOCAL end */ else default_init_unwind_resume_libfunc (); lang_eh_runtime_type = build_eh_type_type; lang_protect_cleanup_actions = &cp_protect_cleanup_actions; - /* LLVM local */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM lang_eh_catch_all = return_null_tree; +#endif + /* LLVM LOCAL end */ } /* Returns an expression to be executed if an unhandled exception is @@ -371,12 +387,18 @@ case lang_java: state = chose_java; - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM llvm_eh_personality_libfunc = llvm_init_one_libfunc (USING_SJLJ_EXCEPTIONS ? "__gcj_personality_sj0" : "__gcj_personality_v0"); - /* LLVM local end */ +#else + eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS + ? "__gcj_personality_sj0" + : "__gcj_personality_v0"); +#endif + /* LLVM LOCAL end */ break; default: Modified: llvm-gcc-4.2/trunk/gcc/cp/lex.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/lex.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/lex.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/lex.c Wed Jul 30 02:11:17 2008 @@ -877,18 +877,3 @@ return t; } - -/* Returns true if we are currently in the main source file, or in a - template instantiation started from the main source file. */ - -bool -in_main_input_context (void) -{ - tree tl = outermost_tinst_level(); - - if (tl) - return strcmp (main_input_filename, - LOCATION_FILE (TINST_LOCATION (tl))) == 0; - else - return strcmp (main_input_filename, input_filename) == 0; -} Modified: llvm-gcc-4.2/trunk/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/pt.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/pt.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/pt.c Wed Jul 30 02:11:17 2008 @@ -5288,15 +5288,6 @@ pop_tinst_level (); } -/* Returns the TINST_LEVEL which gives the original instantiation - context. */ - -tree -outermost_tinst_level (void) -{ - return tree_last (current_tinst_level); -} - /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the vector of template arguments, as for tsubst. @@ -5778,7 +5769,15 @@ if (CLASSTYPE_VISIBILITY_SPECIFIED (pattern)) { CLASSTYPE_VISIBILITY_SPECIFIED (type) = 1; - CLASSTYPE_VISIBILITY (type) = CLASSTYPE_VISIBILITY (pattern); + /* APPLE LOCAL begin 5812195 */ + /* CLASSTYPE_VISIBILITY (type) should already be set by the time + we get here, in particular, we should just constrain the + visibility, as we don't reconstrain on template arguments + post this whereas we've already done that by the time we get + here. */ + if (CLASSTYPE_VISIBILITY (type) < CLASSTYPE_VISIBILITY (pattern)) + CLASSTYPE_VISIBILITY (type) = CLASSTYPE_VISIBILITY (pattern); + /* APPLE LOCAL end 5812195 */ } pbinfo = TYPE_BINFO (pattern); @@ -7011,7 +7010,7 @@ cp_apply_type_quals_to_decl (cp_type_quals (type), r); DECL_CONTEXT (r) = ctx; /* Clear out the mangled name and RTL for the instantiation. */ - SET_DECL_ASSEMBLER_NAME (r, NULL_TREE); + SET_DECL_ASSEMBLER_NAME (r, NULL_TREE); if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL)) /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 02:11:17 2008 @@ -16319,6 +16319,12 @@ tree record = CLASS_STATIC_TEMPLATE (class); tree type = TREE_TYPE (property); tree field_decl, field; + /* APPLE LOCAL begin radar 6029624 */ +#ifdef OBJCPLUS + if (TREE_CODE (type) == REFERENCE_TYPE) + type = TYPE_MAIN_VARIANT (TREE_TYPE (type)); +#endif + /* APPLE LOCAL end radar 6029624 */ field_decl = create_field_decl (type, ivar_name ? ivar_name : objc_build_property_ivar_name (property)); @@ -19587,8 +19593,22 @@ tree ivar_type = DECL_BIT_FIELD_TYPE (ivar_decl) ? DECL_BIT_FIELD_TYPE (ivar_decl) : TREE_TYPE (ivar_decl); - if (comptypes (ivar_type, TREE_TYPE (property_decl)) != 1 - && !objc_compare_types (TREE_TYPE (property_decl), ivar_type, -5, NULL_TREE)) + /* APPLE LOCAL begin radar 6029624 */ + tree property_type = TREE_TYPE (property_decl); + bool comparison_result; +#ifdef OBJCPLUS + if (TREE_CODE (property_type) == REFERENCE_TYPE) + { + property_type = TREE_TYPE (property_type); + comparison_result = + !objcp_reference_related_p (property_type, ivar_type); + } + else +#endif + comparison_result = comptypes (ivar_type, property_type) != 1; + if (comparison_result + && !objc_compare_types (property_type, ivar_type, -5, NULL_TREE)) + /* APPLE LOCAL end radar 6029624 */ /* APPLE LOCAL end radar 5389292 */ { error ("type of property %qs does not match type of ivar %qs", Modified: llvm-gcc-4.2/trunk/gcc/tree-inline.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-inline.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-inline.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-inline.c Wed Jul 30 02:11:17 2008 @@ -1022,11 +1022,14 @@ /* If the parameter is never assigned to, we may not need to create a new variable here at all. Instead, we may be able to just use the argument value. */ -/* LLVM LOCAL begin fix handling of parameters with variably modified types */ - /* We need the copy if it has a variably modified type. */ if (TREE_READONLY (p) && !TREE_ADDRESSABLE (p) +/* LLVM LOCAL begin fix handling of parameters with variably modified types */ +#ifdef ENABLE_LLVM + /* We need the copy if it has a variably modified type. */ && !variably_modified_type_p (TREE_TYPE (p), id->src_fn) +#endif +/* LLVM LOCAL end */ && value && !TREE_SIDE_EFFECTS (value)) { /* We may produce non-gimple trees by adding NOPs or introduce @@ -1052,12 +1055,15 @@ function. */ var = copy_decl_to_var (p, id); +/* LLVM LOCAL begin fix handling of parameters with variably modified types */ +#ifdef ENABLE_LLVM /* But, we must remap variably modified types, which depend on local variables in this function and are NOT visible to the calling function. */ if (variably_modified_type_p (TREE_TYPE (p), id->src_fn)) TREE_TYPE (var) = remap_type(TREE_TYPE (p), id); -/* LLVM LOCAL end fix handling of parameters with variably modified types */ +#endif +/* LLVM LOCAL end */ /* See if the frontend wants to pass this by invisible reference. If so, our new VAR_DECL will have REFERENCE_TYPE, and we need to @@ -1274,9 +1280,8 @@ /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM - /* The return node may not dominate all of its uses. Because of - * this, conservatively don't consider it for SSA form anymore. - */ + /* The return node may not dominate all of its uses. Because of this, + conservatively don't consider it for SSA form anymore. */ if (TREE_CODE (var) == VAR_DECL) DECL_GIMPLE_FORMAL_TEMP_P (var) = 0; #endif @@ -1580,7 +1585,7 @@ /* Squirrel away the result so that we don't have to check again. */ DECL_UNINLINABLE (fn) = !inlinable; - + return inlinable; } @@ -2840,7 +2845,7 @@ if (!update_clones) DECL_NAME (new_decl) = create_tmp_var_name (NULL); /* LLVM LOCAL begin */ - #ifndef ENABLE_LLVM +#ifndef ENABLE_LLVM /* Create a new SYMBOL_REF rtx for the new name. */ if (DECL_RTL (old_decl) != NULL) { @@ -2849,7 +2854,7 @@ gen_rtx_SYMBOL_REF (GET_MODE (XEXP (DECL_RTL (old_decl), 0)), IDENTIFIER_POINTER (DECL_NAME (new_decl))); } - #endif +#endif /* LLVM LOCAL end */ /* Prepare the data structures for the tree copy. */ Modified: llvm-gcc-4.2/trunk/gcc/tree-optimize.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-optimize.c?rev=54204&r1=54203&r2=54204&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-optimize.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-optimize.c Wed Jul 30 02:11:17 2008 @@ -50,7 +50,9 @@ /* APPLE LOCAL optimization pragmas 3124235/3420242 */ #include "opts.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif /* LLVM LOCAL end */ #include "cfgloop.h" #include "except.h" From isanbard at gmail.com Wed Jul 30 02:24:07 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 07:24:07 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54205 - in /llvm-gcc-4.2/trunk/gcc: c-parser.c c-ppoutput.c combine.c cp/typeck.c objc/objc-act.c regclass.c tree-ssa.c Message-ID: <200807300724.m6U7O8e3029305@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 02:24:06 2008 New Revision: 54205 URL: http://llvm.org/viewvc/llvm-project?rev=54205&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c llvm-gcc-4.2/trunk/gcc/c-ppoutput.c llvm-gcc-4.2/trunk/gcc/combine.c llvm-gcc-4.2/trunk/gcc/cp/typeck.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/regclass.c llvm-gcc-4.2/trunk/gcc/tree-ssa.c Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-parser.c Wed Jul 30 02:24:06 2008 @@ -4236,6 +4236,8 @@ tree block, expr, body, save_break; gcc_assert (c_parser_next_token_is_keyword (parser, RID_SWITCH)); c_parser_consume_token (parser); + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) { @@ -4253,6 +4255,8 @@ add_stmt (build1 (LABEL_EXPR, void_type_node, c_break_label)); c_break_label = save_break; add_stmt (c_end_compound_stmt (block, flag_isoc99)); + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + outof_bc_stmt_block (); } /* Parse a while statement (C90 6.6.5, C99 6.8.5). @@ -4277,6 +4281,8 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; cond = c_parser_paren_condition (parser); @@ -4290,6 +4296,8 @@ true); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + outof_bc_stmt_block (); c_break_label = save_break; c_cont_label = save_cont; } @@ -4316,6 +4324,8 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; save_break = c_break_label; @@ -4335,6 +4345,8 @@ c_finish_loop (loc, cond, NULL, body, new_break, new_cont, attrs, false); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + outof_bc_stmt_block (); } /* Parse a for statement (C90 6.6.5, C99 6.8.5). @@ -4374,6 +4386,8 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + in_bc_stmt_block (); /* APPLE LOCAL radar 4472881 (in 4.2 ah) */ block = c_begin_compound_stmt (flag_isoc99 || c_dialect_objc ()); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) @@ -4499,6 +4513,8 @@ /* APPLE LOCAL end radar 4708210 (for_objc_collection in 4.2) */ /* APPLE LOCAL radar 4472881 (in 4.2 ai) */ add_stmt (c_end_compound_stmt (block, flag_isoc99 || c_dialect_objc ())); + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + outof_bc_stmt_block (); c_break_label = save_break; c_cont_label = save_cont; } @@ -7258,6 +7274,26 @@ objc_finish_try_stmt (); } +/* APPLE LOCAL begin radar 5982990 */ +/* This routine is called from c_parser_objc_synchronized_statement + and is identical to c_parser_compound_statement with + the addition of volatizing local variables seen in the scope + of @synchroniz block. +*/ +static tree +c_parser_objc_synch_compound_statement (c_parser *parser) +{ + tree stmt; + if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) + return error_mark_node; + stmt = c_begin_compound_stmt (true); + c_parser_compound_statement_nostart (parser); + if (flag_objc_sjlj_exceptions) + objc_mark_locals_volatile (NULL); + return c_end_compound_stmt (stmt, true); +} +/* APPLE LOCAL end radar 5982990 */ + /* Parse an objc-synchronized-statement. objc-synchronized-statement: @@ -7279,7 +7315,8 @@ } else expr = error_mark_node; - stmt = c_parser_compound_statement (parser); + /* APPLE LOCAL radar 5982990 */ + stmt = c_parser_objc_synch_compound_statement (parser); objc_build_synchronized (loc, expr, stmt); } Modified: llvm-gcc-4.2/trunk/gcc/c-ppoutput.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-ppoutput.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-ppoutput.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-ppoutput.c Wed Jul 30 02:24:06 2008 @@ -21,8 +21,11 @@ #include "system.h" #include "coretypes.h" #include "tm.h" -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "toplev.h" +#endif +/* LLVM LOCAL end */ #include "cpplib.h" #include "../libcpp/internal.h" #include "tree.h" @@ -456,9 +459,13 @@ c_common_read_pch (pfile, name, fd, orig_name); /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM fprintf (print.outf, "#pragma GCC pch_preprocess "); output_quoted_string (print.outf, name); fprintf (print.outf, "\n"); +#else + fprintf (print.outf, "#pragma GCC pch_preprocess \"%s\"\n", name); +#endif /* LLVM LOCAL end */ print.src_line++; } Modified: llvm-gcc-4.2/trunk/gcc/combine.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/combine.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/combine.c (original) +++ llvm-gcc-4.2/trunk/gcc/combine.c Wed Jul 30 02:24:06 2008 @@ -106,6 +106,28 @@ /* LLVM LOCAL begin comment out most of this file */ #ifndef ENABLE_LLVM /* LLVM LOCAL end */ + +/* APPLE LOCAL begin ARM DImode multiply enhancement */ +/* If this is set, try substituting instructions forward even if we cannot + immediately delete the earlier instructions because their values are + reused later. This is beneficial in a few cases where it's cheaper to + redo an earlier operation as part of the later instruction than it is + to use the register result of computing it. E.g. (i64)i32 * (i64)i32 + on ARM is a single insn, but i64*i64 is several, so if we have + something like + t1 = (i64)i32 + t2 = (i64)i32 + t3 = (i64)i32 + = t1*t2 + t2*t3 + t1*t3 + we want to move the casts forward into the multiplies. For the last + multiply the original casts will be deleted, but copying them forward + would gain even if this did not happen. */ + +#ifndef COMBINE_TRY_RETAIN +#define COMBINE_TRY_RETAIN 0 +#endif +/* APPLE LOCAL end ARM DImode multiply enhancement */ + /* Number of attempts to combine instructions in this function. */ static int combine_attempts; @@ -393,7 +415,8 @@ static int can_combine_p (rtx, rtx, rtx, rtx, rtx *, rtx *); static int combinable_i3pat (rtx, rtx *, rtx, rtx, int, rtx *); static int contains_muldiv (rtx); -static rtx try_combine (rtx, rtx, rtx, int *); +/* APPLE LOCAL expand retain_inputs */ +static rtx try_combine (rtx, rtx, rtx, int *, bool); static void undo_all (void); static void undo_commit (void); static rtx *find_split_point (rtx *, rtx); @@ -588,12 +611,16 @@ #define SUBST_MODE(INTO, NEWVAL) do_SUBST_MODE(&(INTO), (NEWVAL)) +/* APPLE LOCAL begin ARM DImode multiply enhancement */ /* Subroutine of try_combine. Determine whether the combine replacement patterns NEWPAT and NEWI2PAT are cheaper according to insn_rtx_cost that the original instruction sequence I1, I2 and I3. Note that I1 and/or NEWI2PAT may be NULL_RTX. This function returns false, if the costs of all instructions can be estimated, and the replacements are - more expensive than the original sequence. */ + more expensive than the original sequence. + We also permit I2 to be null; this means NEWPAT is a replacement for + I3, but the original instructions feeding into it will remain. In + this case I1 and NEWI2PAT are expected to be null. */ static bool combine_validate_cost (rtx i1, rtx i2, rtx i3, rtx newpat, rtx newi2pat) @@ -603,22 +630,31 @@ int old_cost, new_cost; /* Lookup the original insn_rtx_costs. */ - i2_cost = INSN_UID (i2) <= last_insn_cost - ? uid_insn_cost[INSN_UID (i2)] : 0; i3_cost = INSN_UID (i3) <= last_insn_cost ? uid_insn_cost[INSN_UID (i3)] : 0; - - if (i1) + if (i2) { - i1_cost = INSN_UID (i1) <= last_insn_cost - ? uid_insn_cost[INSN_UID (i1)] : 0; - old_cost = (i1_cost > 0 && i2_cost > 0 && i3_cost > 0) - ? i1_cost + i2_cost + i3_cost : 0; + i2_cost = INSN_UID (i2) <= last_insn_cost + ? uid_insn_cost[INSN_UID (i2)] : 0; + if (i1) + { + i1_cost = INSN_UID (i1) <= last_insn_cost + ? uid_insn_cost[INSN_UID (i1)] : 0; + old_cost = (i1_cost > 0 && i2_cost > 0 && i3_cost > 0) + ? i1_cost + i2_cost + i3_cost : 0; + } + else + { + i1_cost = 0; + old_cost = (i2_cost > 0 && i3_cost > 0) ? i2_cost + i3_cost : 0; + } } else { - old_cost = (i2_cost > 0 && i3_cost > 0) ? i2_cost + i3_cost : 0; - i1_cost = 0; + gcc_assert (!i1); + gcc_assert (!newi2pat); + i1_cost = i2_cost = 0; + old_cost = (i3_cost > 0) ? i3_cost : 0; } /* Calculate the replacement insn_rtx_costs. */ @@ -651,10 +687,25 @@ old_cost = 0; } + if (i2 == 0 + && (old_cost == 0 + || new_cost == 0 + || new_cost > old_cost)) + { + if (dump_file) + { + fprintf (dump_file, + "rejecting forward combination into insn %d\n", + INSN_UID (i3)); + fprintf (dump_file, "original cost %d\n", old_cost); + fprintf (dump_file, "replacement cost %d\n", new_cost); + } + return false; + } /* Disallow this recombination if both new_cost and old_cost are greater than zero, and new_cost is greater than old cost. */ - if (old_cost > 0 - && new_cost > old_cost) + else if (old_cost > 0 + && new_cost > old_cost) { if (dump_file) { @@ -688,13 +739,15 @@ } /* Update the uid_insn_cost array with the replacement costs. */ - uid_insn_cost[INSN_UID (i2)] = new_i2_cost; + if (i2) + uid_insn_cost[INSN_UID (i2)] = new_i2_cost; uid_insn_cost[INSN_UID (i3)] = new_i3_cost; if (i1) uid_insn_cost[INSN_UID (i1)] = 0; return true; } +/* APPLE LOCAL end ARM DImode multiply enhancement */ /* Main entry point for combiner. F is the first insn of the function. NREGS is the first unused pseudo-reg number. @@ -828,7 +881,8 @@ for (links = LOG_LINKS (insn); links; links = XEXP (links, 1)) if ((next = try_combine (insn, XEXP (links, 0), - NULL_RTX, &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + NULL_RTX, &new_direct_jump_p, true)) != 0) goto retry; /* Try each sequence of three linked insns ending with this one. */ @@ -847,7 +901,8 @@ nextlinks = XEXP (nextlinks, 1)) if ((next = try_combine (insn, link, XEXP (nextlinks, 0), - &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + &new_direct_jump_p, true)) != 0) goto retry; } @@ -865,14 +920,16 @@ && sets_cc0_p (PATTERN (prev))) { if ((next = try_combine (insn, prev, - NULL_RTX, &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + NULL_RTX, &new_direct_jump_p, true)) != 0) goto retry; for (nextlinks = LOG_LINKS (prev); nextlinks; nextlinks = XEXP (nextlinks, 1)) if ((next = try_combine (insn, prev, XEXP (nextlinks, 0), - &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + &new_direct_jump_p, true)) != 0) goto retry; } @@ -885,14 +942,16 @@ && reg_mentioned_p (cc0_rtx, SET_SRC (PATTERN (insn)))) { if ((next = try_combine (insn, prev, - NULL_RTX, &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + NULL_RTX, &new_direct_jump_p, true)) != 0) goto retry; for (nextlinks = LOG_LINKS (prev); nextlinks; nextlinks = XEXP (nextlinks, 1)) if ((next = try_combine (insn, prev, XEXP (nextlinks, 0), - &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + &new_direct_jump_p, true)) != 0) goto retry; } @@ -907,7 +966,8 @@ && NONJUMP_INSN_P (prev) && sets_cc0_p (PATTERN (prev)) && (next = try_combine (insn, XEXP (links, 0), - prev, &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + prev, &new_direct_jump_p, true)) != 0) goto retry; #endif @@ -918,7 +978,8 @@ nextlinks = XEXP (nextlinks, 1)) if ((next = try_combine (insn, XEXP (links, 0), XEXP (nextlinks, 0), - &new_direct_jump_p)) != 0) + /* APPLE LOCAL expand retain_inputs */ + &new_direct_jump_p, true)) != 0) goto retry; /* Try this insn with each REG_EQUAL note it links back to. */ @@ -944,8 +1005,20 @@ i2mod = temp; i2mod_old_rhs = copy_rtx (orig); i2mod_new_rhs = copy_rtx (note); + /* APPLE LOCAL begin ARM expand retain_inputs */ + /* If we were to allow the retain_inputs optimization here, + we would need to restore SET_SRC below when the + retain_inputs case was hit. That is possible, but + leads to the following harder problem: when we have + a REG_DEAD note on i3 and that register no longer appears + due to optimization of i3 after replacements, we don't + know whether to remove the instruction that set that + reg (which is what it does) or leave it alone because + it will be used again once we restore SET_SRC below. + See REG_DEAD case in distribute_notes. */ next = try_combine (insn, i2mod, NULL_RTX, - &new_direct_jump_p); + &new_direct_jump_p, false); + /* APPLE LOCAL end ARM expand retain_inputs */ i2mod = NULL_RTX; if (next) goto retry; @@ -1804,14 +1877,21 @@ If we did the combination, return the insn at which combine should resume scanning. + APPLE LOCAL begin ARM expand retain_inputs Set NEW_DIRECT_JUMP_P to a nonzero value if try_combine creates a - new direct jump instruction. */ + new direct jump instruction. + + If RETAIN_INPUTS_OK, and the replacement doesn't match because one of the + inputs is reused later, try accepting the replacement anyway and leaving + the original insns there. */ static rtx -try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) +try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p, bool retain_inputs_ok) +/* APPLE LOCAL end ARM expand retain_inputs */ { /* New patterns for I3 and I2, respectively. */ - rtx newpat, newi2pat = 0; + /* APPLE LOCAL ARM DImode multiply enhancement */ + rtx newpat, newi2pat = 0, newpat_before_added_sets = 0; rtvec newpat_vec_with_clobbers = 0; int substed_i2 = 0, substed_i1 = 0; /* Indicates need to preserve SET in I1 or I2 in I3 if it is not dead. */ @@ -1841,6 +1921,11 @@ /* Notes that I1, I2 or I3 is a MULT operation. */ int have_mult = 0; int swap_i2i3 = 0; +/* APPLE LOCAL begin ARM DImode multiply enhancement */ + /* Marks the case where it's cheaper to duplicate an operation in i3 + even though we can't delete i2 and i1 because of later uses. */ + bool retain_inputs = 0; +/* APPLE LOCAL end ARM DImode multiply enhancement */ int maxreg; rtx temp; @@ -2419,6 +2504,8 @@ { combine_extras++; + /* APPLE LOCAL ARM DImode multiply enhancement */ + newpat_before_added_sets = copy_rtx (newpat); if (GET_CODE (newpat) == PARALLEL) { rtvec old = XVEC (newpat, 0); @@ -2964,7 +3051,81 @@ && (! check_asm_operands (newpat) || added_sets_1 || added_sets_2))) { undo_all (); - return 0; + /* APPLE LOCAL begin ARM DImode multiply enhancement */ + /* If we had to add copies of the original inputs because their values + are used later, try matching the replacement without those copies + and leaving the originals alone. + Do not copy a load, even if the costs appear to be equal (which + can certainly happen with -Os). We check for volatile explicitly + so this should not be a correctness problem, but it just can't be + an improvement whatever the costs say. (e.g., the interference with + scheduling is not modeled in this pass.) */ + /* Currently, we accept cases where i1!=0 and i1 feeds i3, and where + i1==0. Can certainly be expanded to handle cases where !i1_feeds_i3, + i3 is a CALL or JUMP, or only one of added_sets_1 and added_sets_2 is true. + + At the moment, code below that fixes up notes assumes the conditions here + are true. */ + if (COMBINE_TRY_RETAIN + && retain_inputs_ok + && i2 + && !CALL_P (i2) && !JUMP_P (i2) + && !volatile_refs_p (PATTERN (i2)) + && added_sets_2 + && !MEM_P (i2src) + && !((GET_CODE (i2src) == SIGN_EXTEND + || GET_CODE (i2src) == ZERO_EXTEND + || GET_CODE (i2src) == SUBREG) + && MEM_P (XEXP (i2src, 0))) + && (!targetm.cannot_copy_insn_p || !targetm.cannot_copy_insn_p (i2)) + && !i2dest_in_i2src + && (!i1 + || (!CALL_P (i1) && !JUMP_P (i1) + && !volatile_refs_p (PATTERN (i1)) + && added_sets_1 + && !MEM_P (i1src) + && !((GET_CODE (i1src) == SIGN_EXTEND + || GET_CODE (i1src) == ZERO_EXTEND + || GET_CODE (i1src) == SUBREG) + && MEM_P (XEXP (i1src, 0))) + && !i1dest_in_i1src + && i1_feeds_i3)) + && !CALL_P (i3) && !JUMP_P (i3) + && !swap_i2i3 + && !i3_subst_into_i2) + { + SUBST (PATTERN (i3), newpat_before_added_sets); + insn_code_number = recog_for_combine (&newpat_before_added_sets, i3, &new_i3_notes); + if (insn_code_number < 0 + || undobuf.other_insn + || !combine_validate_cost (0, 0, i3, newpat_before_added_sets, 0)) + { + undo_all (); + return 0; + } + added_sets_1 = added_sets_2 = 0; + newi2pat = NULL_RTX; + newpat = newpat_before_added_sets; + retain_inputs = 1; + if (dump_file) + { + if (i1) + { + fprintf (dump_file, + "Forward combination of %d and %d into insn %d\n", + INSN_UID (i1), INSN_UID (i2), INSN_UID (i3)); + } + else + { + fprintf (dump_file, + "Forward combination of %d into insn %d\n", + INSN_UID (i2), INSN_UID (i3)); + } + } + } + else + return 0; + /* APPLE LOCAL end ARM DImode multiply enhancement */ } /* If we had to change another insn, make sure it is valid also. */ @@ -3025,9 +3186,11 @@ } #endif + /* APPLE LOCAL begin ARM DImode multiply enhancement */ /* Only allow this combination if insn_rtx_costs reports that the replacement instructions are cheaper than the originals. */ - if (!combine_validate_cost (i1, i2, i3, newpat, newi2pat)) + if (!retain_inputs + && !combine_validate_cost (i1, i2, i3, newpat, newi2pat)) { undo_all (); return 0; @@ -3186,7 +3349,8 @@ LOG_LINKS (i3) = 0; REG_NOTES (i3) = 0; - LOG_LINKS (i2) = 0; + if (!retain_inputs) + LOG_LINKS (i2) = 0; REG_NOTES (i2) = 0; if (newi2pat) @@ -3194,14 +3358,16 @@ INSN_CODE (i2) = i2_code_number; PATTERN (i2) = newi2pat; } - else + else if (!retain_inputs) SET_INSN_DELETED (i2); if (i1) { - LOG_LINKS (i1) = 0; + if (!retain_inputs) + LOG_LINKS (i1) = 0; REG_NOTES (i1) = 0; - SET_INSN_DELETED (i1); + if (!retain_inputs) + SET_INSN_DELETED (i1); } /* Get death notes for everything that is now used in either I3 or @@ -3307,10 +3473,13 @@ } distribute_links (i3links); - distribute_links (i2links); - distribute_links (i1links); + if (!retain_inputs) + { + distribute_links (i2links); + distribute_links (i1links); + } - if (REG_P (i2dest)) + if (!retain_inputs && REG_P (i2dest)) { rtx link; rtx i2_insn = 0, i2_val = 0, set; @@ -3341,7 +3510,8 @@ } } - if (i1 && REG_P (i1dest)) + if (!retain_inputs && i1 && REG_P (i1dest)) + /* APPLE LOCAL end ARM DImode multiply enhancement */ { rtx link; rtx i1_insn = 0, i1_val = 0, set; Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Wed Jul 30 02:24:06 2008 @@ -2129,6 +2129,10 @@ /* APPLE LOCAL radar 5285911 */ && (expr = objc_build_property_reference_expr (object, name))) return expr; + /* APPLE LOCAL begin radar 5802025 */ + else if (objc_property_reference_expr (object)) + object = objc_build_property_getter_func_call (object); + /* APPLE LOCAL end radar 5802025 */ } /* APPLE LOCAL end C* property (Radar 4436866) */ @@ -3510,7 +3514,8 @@ if (TREE_CODE (orig_op0) == STRING_CST || TREE_CODE (orig_op1) == STRING_CST) warning (OPT_Waddress, - "comparison with string literal results in unspecified behaviour"); + /* APPLE LOCAL spelling 5808469 */ + "comparison with string literal results in unspecified behavior"); build_type = boolean_type_node; if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 02:24:06 2008 @@ -18934,6 +18934,19 @@ return function; } +/* APPLE LOCAL begin radar 5802025 */ +tree objc_build_property_getter_func_call (tree pref_expr) +{ + tree getter_call; + tree save_UOBJC_SUPER_decl = UOBJC_SUPER_decl; + UOBJC_SUPER_decl = TREE_OPERAND (pref_expr, 2); + getter_call = objc_build_getter_call (TREE_OPERAND (pref_expr, 0), + TREE_OPERAND (pref_expr, 1)); + UOBJC_SUPER_decl = save_UOBJC_SUPER_decl; + return getter_call; +} +/* APPLE LOCAL end radar 5802025 */ + /* Look for the special case of OBJC_TYPE_REF with the address of a function in OBJ_TYPE_REF_EXPR (presumably objc_msgSend or one of its cousins). */ @@ -18972,13 +18985,8 @@ /* APPLE LOCAL end radar 5276085 */ /* APPLE LOCAL begin radar 5285911 5494488 */ else if (objc_property_reference_expr (*expr_p)) - { - tree save_UOBJC_SUPER_decl = UOBJC_SUPER_decl; - UOBJC_SUPER_decl = TREE_OPERAND (*expr_p, 2); - *expr_p = objc_build_getter_call (TREE_OPERAND (*expr_p, 0), - TREE_OPERAND (*expr_p, 1)); - UOBJC_SUPER_decl = save_UOBJC_SUPER_decl; - } + /* APPLE LOCAL radar 5802025 */ + *expr_p = objc_build_property_getter_func_call (*expr_p); /* APPLE LOCAL end radar 5285911 5494488 */ #ifdef OBJCPLUS Modified: llvm-gcc-4.2/trunk/gcc/regclass.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/regclass.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/regclass.c (original) +++ llvm-gcc-4.2/trunk/gcc/regclass.c Wed Jul 30 02:24:06 2008 @@ -148,6 +148,15 @@ int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER]; #endif +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER +int dimode_reg_alloc_order[FIRST_PSEUDO_REGISTER] = DIMODE_REG_ALLOC_ORDER; + +/* The inverse of reg_alloc_order. */ +int dimode_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER]; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ + /* For each reg class, a HARD_REG_SET saying which registers are in it. */ HARD_REG_SET reg_class_contents[N_REG_CLASSES]; @@ -302,6 +311,13 @@ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) inv_reg_alloc_order[reg_alloc_order[i]] = i; #endif + +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + dimode_inv_reg_alloc_order[dimode_reg_alloc_order[i]] = i; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ } /* After switches have been processed, which perhaps alter Modified: llvm-gcc-4.2/trunk/gcc/tree-ssa.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-ssa.c?rev=54205&r1=54204&r2=54205&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-ssa.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-ssa.c Wed Jul 30 02:24:06 2008 @@ -926,19 +926,7 @@ if (lang_hooks.types_compatible_p (inner_type, outer_type)) return true; - /* If both types are pointers and the outer type is a (void *), then - the conversion is not necessary. The opposite is not true since - that conversion would result in a loss of information if the - equivalence was used. Consider an indirect function call where - we need to know the exact type of the function to correctly - implement the ABI. */ - else if (POINTER_TYPE_P (inner_type) - && POINTER_TYPE_P (outer_type) - && TYPE_REF_CAN_ALIAS_ALL (inner_type) - == TYPE_REF_CAN_ALIAS_ALL (outer_type) - && TREE_CODE (TREE_TYPE (outer_type)) == VOID_TYPE) - return true; - + /* APPLE LOCAL begin 5799099 */ /* Don't lose casts between pointers to volatile and non-volatile qualified types. Doing so would result in changing the semantics of later accesses. */ @@ -947,6 +935,7 @@ && TYPE_VOLATILE (TREE_TYPE (outer_type)) != TYPE_VOLATILE (TREE_TYPE (inner_type))) return false; + /* APPLE LOCAL end 5799099 */ /* APPLE LOCAL begin mainline */ /* Do not lose casts from const qualified to non-const @@ -959,6 +948,21 @@ return false; /* APPLE LOCAL end mainline */ + /* APPLE LOCAL begin 5799099 moved down */ + /* If both types are pointers and the outer type is a (void *), then + the conversion is not necessary. The opposite is not true since + that conversion would result in a loss of information if the + equivalence was used. Consider an indirect function call where + we need to know the exact type of the function to correctly + implement the ABI. */ + else if (POINTER_TYPE_P (inner_type) + && POINTER_TYPE_P (outer_type) + && TYPE_REF_CAN_ALIAS_ALL (inner_type) + == TYPE_REF_CAN_ALIAS_ALL (outer_type) + && TREE_CODE (TREE_TYPE (outer_type)) == VOID_TYPE) + return true; + /* APPLE LOCAL end 5799099 moved down */ + /* Pointers/references are equivalent if their pointed to types are effectively the same. This allows to strip conversions between pointer types with different type qualifiers. */ From eli.friedman at gmail.com Tue Jul 29 23:36:32 2008 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 30 Jul 2008 04:36:32 -0000 Subject: [llvm-commits] [llvm] r54194 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll Message-ID: <200807300436.m6U4aWfP023803@zion.cs.uiuc.edu> Author: efriedma Date: Tue Jul 29 23:36:32 2008 New Revision: 54194 URL: http://llvm.org/viewvc/llvm-project?rev=54194&view=rev Log: Another SCEV issue from PR2607; essentially the same issue, but this time applying to the implicit comparison in smin expressions. The correct way to transform an inequality into the opposite inequality, either signed or unsigned, is with a not expression. I looked through the SCEV code, and I don't think there are any more occurrences of this issue. Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=54194&r1=54193&r2=54194&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jul 29 23:36:32 2008 @@ -1789,10 +1789,10 @@ if (LHS == U->getOperand(1) && RHS == U->getOperand(2)) return SE.getSMaxExpr(getSCEV(LHS), getSCEV(RHS)); else if (LHS == U->getOperand(2) && RHS == U->getOperand(1)) - // -smax(-x, -y) == smin(x, y). - return SE.getNegativeSCEV(SE.getSMaxExpr( - SE.getNegativeSCEV(getSCEV(LHS)), - SE.getNegativeSCEV(getSCEV(RHS)))); + // ~smax(~x, ~y) == smin(x, y). + return SE.getNotSCEV(SE.getSMaxExpr( + SE.getNotSCEV(getSCEV(LHS)), + SE.getNotSCEV(getSCEV(RHS)))); break; case ICmpInst::ICMP_ULT: case ICmpInst::ICMP_ULE: Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll?rev=54194&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll Tue Jul 29 23:36:32 2008 @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: -scalar-evolution-max-iterations=0 | \ +; RUN: grep -F "( -2147483632 + ( 2147483632 smax ( -1 + ( -1 * %x)) smax ( -1 + ( -1 * %y)))) iterations" +; PR2607 + +define i32 @b(i32 %x, i32 %y) { +entry: + %cmp2 = icmp slt i32 %y, %x + %cond3 = select i1 %cmp2, i32 %y, i32 %x + %cmp54 = icmp slt i32 %cond3, -2147483632 + br i1 %cmp54, label %forinc, label %afterfor + +forinc: ; preds = %forinc, %entry + %j.01 = phi i32 [ %dec, %forinc ], [ -2147483632, %entry ] + %dec = add i32 %j.01, -1 + %cmp = icmp slt i32 %y, %x + %cond = select i1 %cmp, i32 %y, i32 %x + %cmp5 = icmp sgt i32 %dec, %cond + br i1 %cmp5, label %forinc, label %afterfor + +afterfor: ; preds = %forinc, %entry + %j.0.lcssa = phi i32 [ -2147483632, %entry ], [ %dec, %forinc ] + ret i32 %j.0.lcssa +} From isanbard at gmail.com Wed Jul 30 01:31:14 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 06:31:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54202 - in /llvm-gcc-4.2/trunk/gcc: c-common.c cp/decl2.c Message-ID: <200807300631.m6U6VEoo027455@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 01:31:14 2008 New Revision: 54202 URL: http://llvm.org/viewvc/llvm-project?rev=54202&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/cp/decl2.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54202&r1=54201&r2=54202&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Wed Jul 30 01:31:14 2008 @@ -699,7 +699,8 @@ handle_section_attribute }, { "aligned", 0, 1, false, false, false, handle_aligned_attribute }, - { "weak", 0, 0, true, false, false, + /* APPLE LOCAL weak types 5954418 */ + { "weak", 0, 0, false, false, false, handle_weak_attribute }, { "alias", 1, 1, true, false, false, handle_alias_attribute }, @@ -2536,8 +2537,11 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) { tree size_exp, ret; - /* LLVM LOCAL */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM bool size_set = 0; +#endif + /* LLVM LOCAL end */ /* The result is a pointer of the same type that is being added. */ @@ -2561,14 +2565,21 @@ pedwarn ("pointer to member function used in arithmetic"); size_exp = integer_one_node; } + else /* LLVM LOCAL begin */ - else { - size_set = 1; +#ifdef ENABLE_LLVM + { + size_set = 1; +#endif + /* LLVM LOCAL end */ + size_exp = size_in_bytes (TREE_TYPE (result_type)); - } - /* In LLVM we want to represent this as &P[i], not as P+i*sizeof(*P). */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM + } + + /* In LLVM we want to represent this as &P[i], not as P+i*sizeof(*P). */ /* Convert the pointer to char* if it is a pointer to a zero sized object. */ if (!size_set) ptrop = convert(build_pointer_type(char_type_node), ptrop); @@ -5114,6 +5125,13 @@ if (TREE_CODE (*node) == FUNCTION_DECL || TREE_CODE (*node) == VAR_DECL) declare_weak (*node); + /* APPLE LOCAL begin weak types 5954418 */ + else if (! targetm.cxx.class_data_always_comdat () + && TREE_CODE (*node) == RECORD_TYPE) + { + /* Leave on the type for the C++ front end */ + } + /* APPLE LOCAL end weak types 5954418 */ else warning (OPT_Wattributes, "%qE attribute ignored", name); @@ -7123,7 +7141,11 @@ /* ??? This should be in defaults.h or a CW asm specific header. */ #ifndef TARGET_IASM_OP_CONSTRAINT /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #define TARGET_IASM_OP_CONSTRAINT +#else +#define TARGET_IASM_OP_CONSTRAINT {} +#endif /* LLVM LOCAL end */ #endif @@ -7205,7 +7227,9 @@ const struct iasm_op_constraint db[] = { TARGET_IASM_OP_CONSTRAINT /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM { "", 0, "" } +#endif /* LLVM LOCAL end */ }; struct iasm_op_constraint key; @@ -7219,7 +7243,11 @@ size_t i; once = 1; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM for (i=0; i < sizeof (db) / sizeof(db[0]) - 2; ++i) +#else + for (i=0; i < sizeof (db) / sizeof(db[0]) - 1; ++i) +#endif /* LLVM LOCAL end */ gcc_assert (iasm_op_comp (&db[i+1], &db[i]) >= 0); } @@ -7231,7 +7259,11 @@ TARGET_IASM_REORDER_ARG(opcode, key.argnum, num_args, argnum); /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM r = bsearch (&key, db, sizeof (db) / sizeof (db[0]) - 1, sizeof (db[0]), iasm_op_comp); +#else + r = bsearch (&key, db, sizeof (db) / sizeof (db[0]), sizeof (db[0]), iasm_op_comp); +#endif /* LLVM LOCAL end */ IASM_SYNTH_CONSTRAINTS(r, argnum, num_args, db); @@ -7562,7 +7594,7 @@ const char **clobbers; int num; -#if defined(TARGET_IASM_EXTRA_CLOBBERS) && defined(ENABLE_CHECKING) +#ifdef ENABLE_CHECKING /* Ensure that the table is sorted. */ static int once; if (once == 0) @@ -8209,7 +8241,9 @@ && TREE_STATIC (arg) /* APPLE LOCAL begin LLVM */ /* DECL_RTL does not get set for LLVM */ -/* && MEM_P (DECL_RTL (arg))*/ +#ifndef ENABLE_LLVM + && MEM_P (DECL_RTL (arg)) +#endif ) /* APPLE LOCAL end LLVM */ { @@ -8440,7 +8474,7 @@ { /* LLVM LOCAL begin */ /* Unused variables resulting from code change below. */ -#if 1 +#ifdef ENABLE_LLVM tree stmt, label; #else tree sexpr; @@ -8460,9 +8494,8 @@ iasm_buffer[0] = '\0'; label = iasm_define_label (labid); -/* LLVM LOCAL begin */ -#if 1 -/* LLVM LOCAL end */ +/* LLVM LOCAL */ +#ifdef ENABLE_LLVM /* Ideally I'd like to do this, but, it moves the label in: nop Modified: llvm-gcc-4.2/trunk/gcc/cp/decl2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl2.c?rev=54202&r1=54201&r2=54202&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl2.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl2.c Wed Jul 30 01:31:14 2008 @@ -53,8 +53,11 @@ #include "intl.h" /* APPLE LOCAL elide global inits 3814991 */ #include "tree-iterator.h" -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif +/* LLVM LOCAL end */ extern cpp_reader *parse_in; @@ -1879,12 +1882,9 @@ int subvis = type_visibility (ftype); if (subvis == VISIBILITY_ANON) - { - if (!in_main_input_context ()) - warning (0, "\ + warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); - } else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) @@ -1899,12 +1899,9 @@ int subvis = type_visibility (TREE_TYPE (t)); if (subvis == VISIBILITY_ANON) - { - if (!in_main_input_context()) - warning (0, "\ + warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); - } else if (vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ @@ -1913,6 +1910,27 @@ } } +/* APPLE LOCAL begin weak types 5954418 */ +static bool +typeinfo_comdat (tree type) +{ + tree binfo, base_binfo; + int j; + + if (lookup_attribute ("weak", TYPE_ATTRIBUTES (type))) + return true; + + for (binfo = TYPE_BINFO (type), j = 0; + BINFO_BASE_ITERATE (binfo, j, base_binfo); ++j) + { + if (typeinfo_comdat (BINFO_TYPE (base_binfo))) + return true; + } + + return false; +} +/* APPLE LOCAL end weak types 5954418 */ + /* DECL is a FUNCTION_DECL or VAR_DECL. If the object file linkage for DECL has not already been determined, do so now by setting DECL_EXTERNAL, DECL_COMDAT and other related flags. Until this @@ -2109,7 +2127,10 @@ { comdat_p = (targetm.cxx.class_data_always_comdat () || (CLASSTYPE_KEY_METHOD (type) - && DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type)))); + /* APPLE LOCAL begin weak types 5954418 */ + && DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))) + || typeinfo_comdat (type)); + /* APPLE LOCAL end weak types 5954418 */ mark_needed (decl); if (!flag_weak) { From isanbard at gmail.com Tue Jul 29 23:54:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 04:54:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54197 - in /llvm-gcc-4.2/trunk/gcc: c-convert.c cfglayout.c tree-nested.c version.c Message-ID: <200807300454.m6U4sKOv024458@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 23:54:19 2008 New Revision: 54197 URL: http://llvm.org/viewvc/llvm-project?rev=54197&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-convert.c llvm-gcc-4.2/trunk/gcc/cfglayout.c llvm-gcc-4.2/trunk/gcc/tree-nested.c llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/c-convert.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-convert.c?rev=54197&r1=54196&r2=54197&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-convert.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-convert.c Tue Jul 29 23:54:19 2008 @@ -104,6 +104,10 @@ return fold_convert (type, c_objc_common_truthvalue_conversion (expr)); if (code == POINTER_TYPE || code == REFERENCE_TYPE) return fold (convert_to_pointer (type, e)); + /* APPLE LOCAL begin blocks (C++ ck) */ + if (code == BLOCK_POINTER_TYPE) + return fold (convert_to_block_pointer (type, e)); + /* APPLE LOCAL end blocks (C++ ck) */ if (code == REAL_TYPE) return fold (convert_to_real (type, e)); if (code == COMPLEX_TYPE) Modified: llvm-gcc-4.2/trunk/gcc/cfglayout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cfglayout.c?rev=54197&r1=54196&r2=54197&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cfglayout.c (original) +++ llvm-gcc-4.2/trunk/gcc/cfglayout.c Tue Jul 29 23:54:19 2008 @@ -996,6 +996,8 @@ case NOTE_INSN_BASIC_BLOCK: break; + /* APPLE LOCAL 5819088 alloca note needs to be copied */ + case NOTE_INSN_ALLOCA: case NOTE_INSN_REPEATED_LINE_NUMBER: case NOTE_INSN_SWITCH_TEXT_SECTIONS: emit_note_copy (insn); Modified: llvm-gcc-4.2/trunk/gcc/tree-nested.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-nested.c?rev=54197&r1=54196&r2=54197&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-nested.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-nested.c Tue Jul 29 23:54:19 2008 @@ -35,8 +35,11 @@ #include "expr.h" #include "langhooks.h" #include "ggc.h" -/* LLVM local */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "pointer-set.h" +#endif +/* LLVM LOCAL end */ /* The object of this pass is to lower the representation of a set of nested @@ -91,8 +94,9 @@ struct nesting_info *inner; struct nesting_info *next; - /* LLVM local */ + /* LLVM LOCAL begin */ struct nesting_info *next_with_chain; + /* LLVM LOCAL end */ htab_t GTY ((param_is (struct var_map_elt))) field_map; htab_t GTY ((param_is (struct var_map_elt))) var_map; @@ -107,16 +111,17 @@ tree chain_decl; tree nl_goto_field; - /* LLVM local */ + /* LLVM LOCAL begin */ struct pointer_set_t * GTY ((skip)) callers; - + /* LLVM LOCAL end */ bool any_parm_remapped; bool any_tramp_created; char static_chain_added; }; -/* LLVM local begin */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Hash table used to look up nesting_info from nesting_info->context. */ static htab_t ni_map; @@ -136,7 +141,8 @@ const struct nesting_info *i1 = p1, *i2 = p2; return DECL_UID (i1->context) == DECL_UID (i2->context); } -/* LLVM local end */ +#endif +/* LLVM LOCAL end */ /* Hashing and equality functions for nesting_info->var_map. */ @@ -455,20 +461,16 @@ /* Build or return the type used to represent a nested function trampoline. */ -/* LLVM local */ -static GTY(()) tree trampoline_storage_type; +static GTY(()) tree trampoline_type; static tree -/* LLVM local */ -get_trampoline_storage_type (void) +get_trampoline_type (void) { tree record, t; unsigned align, size; - /* LLVM local begin */ - if (trampoline_storage_type) - return trampoline_storage_type; - /* LLVM local end */ + if (trampoline_type) + return trampoline_type; align = TRAMPOLINE_ALIGNMENT; size = TRAMPOLINE_SIZE; @@ -524,9 +526,15 @@ { field = make_node (FIELD_DECL); DECL_NAME (field) = DECL_NAME (decl); - /* LLVM local begin */ + /* LLVM LOCAL begin */ + /* FIXME: Keep the LLVM-way? */ +#ifdef ENABLE_LLVM TREE_TYPE (field) = TYPE_POINTER_TO (TREE_TYPE (decl)); - /* LLVM local end */ +#else + TREE_TYPE (field) = get_trampoline_type (); + TREE_ADDRESSABLE (field) = 1; +#endif + /* LLVM LOCAL end */ insert_field_into_struct (get_frame_type (info), field); @@ -806,20 +814,25 @@ static struct nesting_info * create_nesting_tree (struct cgraph_node *cgn) { - /* LLVM local */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM struct nesting_info **slot; +#endif + /* LLVM LOCAL end */ struct nesting_info *info = GGC_CNEW (struct nesting_info); info->field_map = htab_create_ggc (7, var_map_hash, var_map_eq, ggc_free); info->var_map = htab_create_ggc (7, var_map_hash, var_map_eq, ggc_free); info->suppress_expansion = BITMAP_GGC_ALLOC (); info->context = cgn->decl; - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM info->callers = pointer_set_create (); slot = (struct nesting_info **) htab_find_slot (ni_map, info, INSERT); gcc_assert (*slot == NULL); *slot = info; - /* LLVM local end */ +#endif + /* LLVM LOCAL end */ for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) { @@ -1653,7 +1666,8 @@ return NULL_TREE; } -/* LLVM local begin */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Find the nesting context for FNDECL, a function declaration. */ static struct nesting_info * @@ -1768,7 +1782,8 @@ pointer_set_traverse (info->callers, propagate_to_caller, info->outer); } } -/* LLVM local end */ +#endif +/* LLVM LOCAL end */ /* Called via walk_function+walk_tree, rewrite all references to addresses of nested functions that require the use of trampolines. The rewrite @@ -1779,8 +1794,12 @@ { struct walk_stmt_info *wi = (struct walk_stmt_info *) data; struct nesting_info *info = wi->info, *i; - /* LLVM local */ + /* LLVM LOCAL begin */ tree t = *tp, decl, target_context, x; +#ifndef ENABLE_LLVM + tree arg; +#endif + /* LLVM LOCAL end */ *walk_subtrees = 0; switch (TREE_CODE (t)) @@ -1806,12 +1825,32 @@ we need to insert the trampoline. */ for (i = info; i->context != target_context; i = i->outer) continue; - /* LLVM local begin */ + /* LLVM LOCAL begin */ + /* FIXME: Keep the LLVM-way? */ +#ifdef ENABLE_LLVM /* Lookup the trampoline. */ x = lookup_tramp_for_decl (i, decl, INSERT); x = get_frame_field (info, target_context, x, &wi->tsi); - /* LLVM local end */ +#else + x = lookup_tramp_for_decl (i, decl, INSERT); + + /* Compute the address of the field holding the trampoline. */ + x = get_frame_field (info, target_context, x, &wi->tsi); + x = build_addr (x, target_context); + x = tsi_gimplify_val (info, x, &wi->tsi); + arg = tree_cons (NULL, x, NULL); + + /* Do machine-specific ugliness. Normally this will involve + computing extra alignment, but it can really be anything. */ + x = implicit_built_in_decls[BUILT_IN_ADJUST_TRAMPOLINE]; + x = build_function_call_expr (x, arg); + x = init_tmp_var (info, x, &wi->tsi); + + /* Cast back to the proper function type. */ + x = build1 (NOP_EXPR, TREE_TYPE (t), x); +#endif + /* LLVM LOCAL end */ x = init_tmp_var (info, x, &wi->tsi); *tp = x; @@ -1928,11 +1967,20 @@ walk_function (convert_tramp_reference, root); walk_function (convert_call_expr, root); - /* LLVM local begin */ + /* LLVM LOCAL begin */ + /* FIXME: Keep the LLVM-way? */ +#ifdef ENABLE_LLVM gcc_assert (!root->outer || DECL_NO_STATIC_CHAIN (root->context) == !(root->chain_decl || root->chain_field)); - /* LLVM local end */ +#else + /* If the function does not use a static chain, then remember that. */ + if (root->outer && !root->chain_decl && !root->chain_field) + DECL_NO_STATIC_CHAIN (root->context) = 1; + else + gcc_assert (!DECL_NO_STATIC_CHAIN (root->context)); +#endif + /* LLVM LOCAL end */ root = root->next; } @@ -2006,8 +2054,12 @@ struct nesting_info *i; for (i = root->inner; i ; i = i->next) { - /* LLVM local */ - tree arg, x, y, field; + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM + tree y; +#endif + /* LLVM LOCAL end */ + tree arg, x, field; field = lookup_tramp_for_decl (root, i->context, NO_INSERT); if (!field) @@ -2022,15 +2074,26 @@ x = build_addr (i->context, context); arg = tree_cons (NULL, x, arg); - /* LLVM local begin */ + /* LLVM LOCAL begin */ + /* FIXME: Keep the LLVM-way? */ +#ifdef ENABLE_LLVM /* Create a local variable to hold the trampoline code. */ - y = create_tmp_var_for (root, get_trampoline_storage_type(), + y = create_tmp_var_for (root, get_trampoline_type(), "TRAMP"); x = build_addr (y, context); +#else + x = build3 (COMPONENT_REF, TREE_TYPE (field), + root->frame_decl, field, NULL_TREE); + x = build_addr (x, context); +#endif + /* LLVM LOCAL end */ arg = tree_cons (NULL, x, arg); x = implicit_built_in_decls[BUILT_IN_INIT_TRAMPOLINE]; x = build_function_call_expr (x, arg); + + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM y = create_tmp_var_for (root, TREE_TYPE(x), NULL); x = build2 (MODIFY_EXPR, TREE_TYPE (x), y, x); append_to_statement_list (x, &stmt_list); @@ -2042,7 +2105,8 @@ x = build3 (COMPONENT_REF, TREE_TYPE (field), root->frame_decl, field, NULL_TREE); x = build2 (MODIFY_EXPR, TREE_TYPE (field), x, y); - /* LLVM local end */ +#endif + /* LLVM LOCAL end */ append_to_statement_list (x, &stmt_list); } @@ -2138,10 +2202,12 @@ if (root->inner) free_nesting_tree (root->inner); htab_delete (root->var_map); - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM htab_delete (root->field_map); pointer_set_destroy (root->callers); - /* LLVM local end */ +#endif + /* LLVM LOCAL end */ next = root->next; ggc_free (root); root = next; @@ -2164,24 +2230,32 @@ if (!cgn->nested) return; - /* LLVM local */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM ni_map = htab_create (11, ni_hash, ni_eq, NULL); +#endif + /* LLVM LOCAL end */ root = create_nesting_tree (cgn); walk_all_functions (convert_nonlocal_reference, root); walk_all_functions (convert_local_reference, root); walk_all_functions (convert_nl_goto_reference, root); walk_all_functions (convert_nl_goto_receiver, root); - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM walk_all_functions (construct_reverse_callgraph, root); propagate_chains (root); - /* LLVM local end */ +#endif + /* LLVM LOCAL end */ convert_all_function_calls (root); finalize_nesting_tree (root); unnest_nesting_tree (root); free_nesting_tree (root); root = NULL; - /* LLVM local */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM htab_delete (ni_map); +#endif + /* LLVM LOCAL end */ } #include "gt-tree-nested.h" Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=54197&r1=54196&r2=54197&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Tue Jul 29 23:54:19 2008 @@ -11,12 +11,12 @@ /* APPLE LOCAL begin Apple version */ #ifdef ENABLE_LLVM #ifdef LLVM_VERSION_INFO -#define VERSUFFIX " (Based on Apple Inc. build 5555) (LLVM build " LLVM_VERSION_INFO ")" +#define VERSUFFIX " (Based on Apple Inc. build 5615) (LLVM build " LLVM_VERSION_INFO ")" #else -#define VERSUFFIX " (Based on Apple Inc. build 5555) (LLVM build)" +#define VERSUFFIX " (Based on Apple Inc. build 5615) (LLVM build)" #endif #else -#define VERSUFFIX " (Based on Apple Inc. build 5555)" +#define VERSUFFIX " (Based on Apple Inc. build 5615)" #endif /* APPLE LOCAL end Apple version */ From isanbard at gmail.com Wed Jul 30 01:24:39 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 06:24:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54201 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.c config/rs6000/rs6000.c objc/objc-act.c Message-ID: <200807300624.m6U6OdT0027233@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 01:24:39 2008 New Revision: 54201 URL: http://llvm.org/viewvc/llvm-project?rev=54201&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=54201&r1=54200&r2=54201&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Wed Jul 30 01:24:39 2008 @@ -63,6 +63,10 @@ #include "c-tree.h" #include "c-common.h" /* APPLE LOCAL end regparmandstackparm */ +/* APPLE LOCAL begin dwarf call/pop 5221468 */ +#include "debug.h" +#include "dwarf2out.h" +/* APPLE LOCAL end dwarf call/pop 5221468 */ #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -1330,13 +1334,6 @@ #define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO #endif - /* APPLE LOCAL begin mainline 2005-07-31 */ -#ifdef SUBTARGET_ENCODE_SECTION_INFO -#undef TARGET_ENCODE_SECTION_INFO -#define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO -#endif - - /* APPLE LOCAL end mainline 2005-07-31 */ #undef TARGET_ASM_OPEN_PAREN #define TARGET_ASM_OPEN_PAREN "" #undef TARGET_ASM_CLOSE_PAREN @@ -1440,10 +1437,6 @@ #define TARGET_INTERNAL_ARG_POINTER ix86_internal_arg_pointer #undef TARGET_DWARF_HANDLE_FRAME_UNSPEC #define TARGET_DWARF_HANDLE_FRAME_UNSPEC ix86_dwarf_handle_frame_unspec -/* LLVM LOCAL begin mainline */ -#undef TARGET_STRICT_ARGUMENT_NAMING -#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true -/* LLVM LOCAL end mainline */ #undef TARGET_GIMPLIFY_VA_ARG_EXPR #define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg @@ -2011,6 +2004,8 @@ /* APPLE LOCAL begin mainline */ if (TARGET_64BIT) { + if (TARGET_ALIGN_DOUBLE) + error ("-malign-double makes no sense in the 64bit mode"); if (TARGET_RTD) error ("-mrtd calling convention not supported in the 64bit mode"); /* APPLE LOCAL begin radar 4877693 */ @@ -5346,7 +5341,29 @@ if (!flag_pic) output_asm_insn ("mov{l}\t{%2, %0|%0, %2}", xops); else - output_asm_insn ("call\t%a2", xops); + /* APPLE LOCAL begin dwarf call/pop 5221468 */ + { + output_asm_insn ("call\t%a2", xops); + + /* If necessary, report the effect that the instruction has on + the unwind info. */ +#if defined (DWARF2_UNWIND_INFO) + if (flag_asynchronous_unwind_tables +#if !defined (HAVE_prologue) + && !ACCUMULATE_OUTGOING_ARGS +#endif + && dwarf2out_do_frame ()) + { + rtx insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, stack_pointer_rtx, + GEN_INT (-4))); + insn = make_insn_raw (insn); + RTX_FRAME_RELATED_P (insn) = 1; + dwarf2out_frame_debug (insn, true); + } +#endif + } + /* APPLE LOCAL end dwarf call/pop 5221468 */ #if TARGET_MACHO /* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This @@ -5359,7 +5376,30 @@ CODE_LABEL_NUMBER (XEXP (xops[2], 0))); if (flag_pic) - output_asm_insn ("pop{l}\t%0", xops); + /* APPLE LOCAL begin dwarf call/pop 5221468 */ + { + output_asm_insn ("pop{l}\t%0", xops); + + /* If necessary, report the effect that the instruction has on + the unwind info. We've already done this for delay slots + and call instructions. */ +#if defined (DWARF2_UNWIND_INFO) + if (flag_asynchronous_unwind_tables +#if !defined (HAVE_prologue) + && !ACCUMULATE_OUTGOING_ARGS +#endif + && dwarf2out_do_frame ()) + { + rtx insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, stack_pointer_rtx, + GEN_INT (4))); + insn = make_insn_raw (insn); + RTX_FRAME_RELATED_P (insn) = 1; + dwarf2out_frame_debug (insn, true); + } +#endif + } + /* APPLE LOCAL end dwarf call/pop 5221468 */ } else { @@ -7778,15 +7818,13 @@ break; case SYMBOL_REF: - /* APPLE LOCAL axe stubs 5571540 */ + /* APPLE LOCAL begin axe stubs 5571540 */ if (! TARGET_MACHO || - /* LLVM LOCAL begin */ #if TARGET_MACHO - /* darwin_stubs not available on non-Darwin systems */ ! darwin_stubs || #endif - /* LLVM LOCAL end */ TARGET_64BIT) + /* APPLE LOCAL end axe stubs 5571540 */ output_addr_const (file, x); else { @@ -21840,8 +21878,13 @@ else if (IDENTIFIER_POINTER (arg)[1] == 'x') mode = SFmode; else if (IDENTIFIER_POINTER (arg)[1] == 'm') - /* LLVM LOCAL - Force MMX to use a vector mode: PR1222. */ + /* LLVM LOCAL - begin Force MMX to use a vector mode: PR1222. */ +#ifdef ENABLE_LLVM mode = V2SImode; +#else + mode = SFmode; +#endif + /* LLVM LOCAL - end Force MMX to use a vector mode: PR1222. */ if (mode != VOIDmode) type = lang_hooks.types.type_for_mode (mode, 1); @@ -21919,7 +21962,9 @@ && TREE_STATIC (v) /* APPLE LOCAL begin LLVM */ /* DECL_RTL is not set for LLVM */ -/* && MEM_P (DECL_RTL (v))*/ +#ifndef ENABLE_LLVM + && MEM_P (DECL_RTL (v)) +#endif ) /* APPLE LOCAL end LLVM */ { @@ -21934,7 +21979,9 @@ && TREE_STATIC (v) /* APPLE LOCAL begin LLVM */ /* DECL_RTL is not set for LLVM */ -/* && MEM_P (DECL_RTL (v))*/ +#ifndef ENABLE_LLVM + && MEM_P (DECL_RTL (v)) +#endif ) /* APPLE LOCAL end LLVM */ { @@ -22840,8 +22887,8 @@ } -/* APPLE LOCAL begin LLVM */ - +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* These are wrappers for type_natural_mode and examine_argument which are both static functions. */ enum machine_mode ix86_getNaturalModeForType(tree type) { @@ -22858,8 +22905,7 @@ int bit_offset) { return classify_argument(mode, type, classes, bit_offset); } - - -/* APPLE LOCAL end LLVM */ +#endif +/* LLVM LOCAL end */ #include "gt-i386.h" Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=54201&r1=54200&r2=54201&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Wed Jul 30 01:24:39 2008 @@ -1227,11 +1227,19 @@ rs6000_altivec_abi = 1; TARGET_ALTIVEC_VRSAVE = 1; + /* APPLE LOCAL begin ARM 5683689 */ + if (!darwin_macosx_version_min && !darwin_iphoneos_version_min) + darwin_macosx_version_min = "10.1"; + /* APPLE LOCAL end ARM 5683689 */ + + /* APPLE LOCAL begin ARM 5683689 */ /* APPLE LOCAL begin constant cfstrings */ if (darwin_constant_cfstrings < 0) - darwin_constant_cfstrings = (strverscmp (darwin_macosx_version_min, "10.2") - >= 0); + darwin_constant_cfstrings = + darwin_iphoneos_version_min + || (strverscmp (darwin_macosx_version_min, "10.2") >= 0); /* APPLE LOCAL end constant cfstrings */ + /* APPLE LOCAL end ARM 5683689 */ if (DEFAULT_ABI == ABI_DARWIN) { @@ -1273,6 +1281,8 @@ G4 unless targetting the kernel. */ if (!flag_mkernel && !flag_apple_kext + /* APPLE LOCAL ARM 5683689 */ + && darwin_macosx_version_min && strverscmp (darwin_macosx_version_min, "10.5") >= 0 && ! (target_flags_explicit & MASK_ALTIVEC) && ! rs6000_select[1].string) Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54201&r1=54200&r2=54201&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 01:24:39 2008 @@ -714,6 +714,11 @@ bool objc_init (void) { +/* APPLE LOCAL begin ARM 5726269 */ +#ifdef OBJC_TARGET_FLAG_OBJC_ABI + OBJC_TARGET_FLAG_OBJC_ABI; +#endif +/* APPLE LOCAL end ARM 5726269 */ /* APPLE LOCAL radar 4862848 */ OBJC_FLAG_OBJC_ABI; /* APPLE LOCAL begin radar 4531086 */ @@ -746,12 +751,18 @@ if (flag_next_runtime) { + /* APPLE LOCAL begin ARM hybrid objc-2.0 */ + bool use_hybrid_msgSend = (flag_objc_abi == 2 + && flag_objc_legacy_dispatch); TAG_GETCLASS = "objc_getClass"; TAG_GETMETACLASS = "objc_getMetaClass"; TAG_MSGSEND = "objc_msgSend"; - TAG_MSGSENDSUPER = "objc_msgSendSuper"; + TAG_MSGSENDSUPER = use_hybrid_msgSend ? "objc_msgSendSuper2" + : "objc_msgSendSuper"; TAG_MSGSEND_STRET = "objc_msgSend_stret"; - TAG_MSGSENDSUPER_STRET = "objc_msgSendSuper_stret"; + TAG_MSGSENDSUPER_STRET = use_hybrid_msgSend ? "objc_msgSendSuper2_stret" + : "objc_msgSendSuper_stret"; + /* APPLE LOCAL end ARM hybrid objc-2.0 */ default_constant_string_class_name = "NSConstantString"; /* APPLE LOCAL begin radar 4810609 */ if (flag_objc_gc_only) @@ -759,14 +770,11 @@ /* APPLE LOCAL end radar 4810609 */ /* APPLE LOCAL begin radar 4949034 */ #ifdef OBJCPLUS - if (flag_objc_abi == 2) - { - /* In objc2 abi -fobjc-call-cxx-cdtors in on by default. */ - if (flag_objc_call_cxx_cdtors == -1) - flag_objc_call_cxx_cdtors = 1; - } - else if (flag_objc_call_cxx_cdtors == -1) - flag_objc_call_cxx_cdtors = 0; + /* APPLE LOCAL begin radar 5809596 */ + /* For all objc ABIs -fobjc-call-cxx-cdtors is on by default. */ + if (flag_objc_call_cxx_cdtors == -1) + flag_objc_call_cxx_cdtors = 1; + /* APPLE LOCAL end radar 5809596 */ #endif /* APPLE LOCAL end radar 4949034 */ } @@ -3479,6 +3487,13 @@ -3 Comparison (LTYP and RTYP may match in either direction); -4 Silent comparison (for C++ overload resolution). -5 Comparison of ivar and @synthesized property type + // APPLE LOCAL begin radar 5218071 + -6 Comparison of two property types; RTYP is type of property + in 'base' and LTYP is property type in derived class. They + match if LTYP is more specialized than RTYP; this includes + when RTYP is 'id' or LTYP is an object derived from an object + of RTYP. + // APPLE LOCAL end radar 5218071 APPLE LOCAL end 4175534 */ bool @@ -4383,7 +4398,8 @@ NULL, NULL_TREE); /* APPLE LOCAL begin ObjC new abi */ - if (flag_objc_abi == 2) + /* APPLE LOCAL ARM hybrid objc-2.0 */ + if (flag_objc_abi == 2 && !flag_objc_legacy_dispatch) { /* APPLE LOCAL radar 4699834 */ /* Removed _rtp suffix from objc_msgSend_fixup_rtp and variants */ @@ -4727,6 +4743,20 @@ len1)); } +/* APPLE LOCAL begin radar 5982789 */ +/* This routine build "NSString" type if "NSString" class is declared + in scope where it is needed. */ +static tree buildNSStringType(void) +{ + tree NSString_decl; + + NSString_decl = objc_is_class_name (get_identifier ("NSString")); + if (!NSString_decl) + return NULL_TREE; + return objc_get_protocol_qualified_type (NSString_decl, NULL_TREE); +} +/* APPLE LOCAL end radar 5982789 */ + /* Given a chain of STRING_CST's, build a static instance of NXConstantString which points at the concatenation of those strings. We place the string object in the __string_objects @@ -4753,10 +4783,15 @@ ObjC string literal. On Darwin (Mac OS X), for example, we may wish to obtain a constant CFString reference instead. */ constructor = (*targetm.construct_objc_string) (string); - /* APPLE LOCAL begin radar 4494634 */ + /* APPLE LOCAL begin radar 4494634, 5982789 */ if (constructor) - return build1 (NOP_EXPR, objc_object_type, constructor); - /* APPLE LOCAL end radar 4494634 */ + { + tree NSStringPtrType = buildNSStringType(); + return build1 (NOP_EXPR, + NSStringPtrType ? build_pointer_type (NSStringPtrType) + : objc_object_type, constructor); + } + /* APPLE LOCAL end radar 4494634, 5982789 */ /* APPLE LOCAL end constant cfstrings */ /* Check whether the string class being used actually exists and has the @@ -12846,6 +12881,8 @@ /* Selector type - will eventually change to `int'. */ /* APPLE LOCAL begin ObjC new abi */ chainon (arglist, build_tree_list (NULL_TREE, flag_objc_abi == 2 + /* APPLE LOCAL ARM hybrid objc-2.0 */ + && !flag_objc_legacy_dispatch ? (superflag ? objc_v2_super_selector_type : objc_v2_selector_type) @@ -13393,7 +13430,8 @@ /* APPLE LOCAL ObjC new abi */ /* Code moved down */ /* APPLE LOCAL begin ObjC new abi */ - if (flag_objc_abi == 2) + /* APPLE LOCAL ARM hybrid objc-2.0 */ + if (flag_objc_abi == 2 && !flag_objc_legacy_dispatch) { tree ret_type; tree message_func_decl; @@ -17181,8 +17219,6 @@ else if (code == ARRAY_TYPE) encode_array (type, curtype, format); - else if (code == POINTER_TYPE) - encode_pointer (type, curtype, format); /* APPLE LOCAL begin radar 4476365 */ #ifdef OBJCPLUS else if (code == REFERENCE_TYPE) @@ -17190,6 +17226,10 @@ #endif /* APPLE LOCAL end radar 4476365 */ + /* APPLE LOCAL radar 5849129 */ + else if (code == POINTER_TYPE || code == BLOCK_POINTER_TYPE) + encode_pointer (type, curtype, format); + else if (code == RECORD_TYPE || code == UNION_TYPE || code == ENUMERAL_TYPE) encode_aggregate (type, curtype, format); @@ -19595,14 +19635,13 @@ bool objc_check_nsstring_pointer_type (tree type) { - tree NSString_decl, NSString_type; + tree NSString_type; if (TREE_CODE (type) != POINTER_TYPE) return false; - NSString_decl = objc_is_class_name (get_identifier ("NSString")); - if (!NSString_decl) + NSString_type = buildNSStringType(); + if (!NSString_type) return false; - NSString_type = objc_get_protocol_qualified_type (NSString_decl, NULL_TREE); return (TYPE_MAIN_VARIANT (TREE_TYPE (type)) == NSString_type); } From isanbard at gmail.com Wed Jul 30 00:34:33 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 05:34:33 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54200 - in /llvm-gcc-4.2/trunk/gcc: cp/name-lookup.c cp/name-lookup.h cp/parser.c objc/objc-act.c Message-ID: <200807300534.m6U5YYxP025859@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 00:34:33 2008 New Revision: 54200 URL: http://llvm.org/viewvc/llvm-project?rev=54200&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h llvm-gcc-4.2/trunk/gcc/cp/parser.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c?rev=54200&r1=54199&r2=54200&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c Wed Jul 30 00:34:33 2008 @@ -1370,10 +1370,9 @@ is_class_level = 0; } -#ifdef HANDLE_PRAGMA_VISIBILITY - if (scope->has_visibility) - pop_visibility (); -#endif + /* APPLE LOCAL begin visibility 5805832 */ + /* pop_visibility() removed */ + /* APPLE LOCAL end visibility 5805832 */ /* Move one nesting level up. */ current_binding_level = scope->level_chain; @@ -3018,13 +3017,16 @@ /* Same, but specify attributes to apply to the namespace. The attributes only apply to the current namespace-body, not to any later extensions. */ -void +/* APPLE LOCAL visibility 5805832 */ +bool push_namespace_with_attribs (tree name, tree attributes) { tree d = NULL_TREE; int need_new = 1; int implicit_use = 0; bool anon = !name; + /* APPLE LOCAL visibility 5805832 */ + bool visibility_pushed = false; timevar_push (TV_NAME_LOOKUP); @@ -3113,7 +3115,8 @@ continue; } - current_binding_level->has_visibility = 1; + /* APPLE LOCAL visibility 5805832 */ + visibility_pushed = true; push_visibility (TREE_STRING_POINTER (x)); goto found; } @@ -3121,6 +3124,8 @@ #endif timevar_pop (TV_NAME_LOOKUP); + /* APPLE LOCAL visibility 5805832 */ + return visibility_pushed; } /* Pop from the scope of the current namespace. */ Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h?rev=54200&r1=54199&r2=54200&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h Wed Jul 30 00:34:33 2008 @@ -314,8 +314,7 @@ extern void push_namespace (tree); /* APPLE LOCAL visibility 5805832 */ -/* LLVM FIXME: Uncomment !!! */ -/* extern bool push_namespace_with_attribs (tree, tree); */ +extern bool push_namespace_with_attribs (tree, tree); extern void pop_namespace (void); extern void push_nested_namespace (tree); extern void pop_nested_namespace (tree); Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=54200&r1=54199&r2=54200&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Wed Jul 30 00:34:33 2008 @@ -11528,6 +11528,8 @@ cp_parser_namespace_definition (cp_parser* parser) { tree identifier, attribs; + /* APPLE LOCAL visibility 5805832 */ + bool visibility_pushed = false; /* Look for the `namespace' keyword. */ cp_parser_require_keyword (parser, RID_NAMESPACE, "`namespace'"); @@ -11547,9 +11549,16 @@ /* Look for the `{' to start the namespace. */ cp_parser_require (parser, CPP_OPEN_BRACE, "`{'"); /* Start the namespace. */ - push_namespace_with_attribs (identifier, attribs); + /* APPLE LOCAL visibility 5805832 */ + visibility_pushed = push_namespace_with_attribs (identifier, attribs); /* Parse the body of the namespace. */ cp_parser_namespace_body (parser); + /* APPLE LOCAL begin visibility 5805832 */ +#ifdef HANDLE_PRAGMA_VISIBILITY + if (visibility_pushed) + pop_visibility (); +#endif + /* APPLE LOCAL end visibility 5805832 */ /* Finish the namespace. */ pop_namespace (); /* Look for the final `}'. */ Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54200&r1=54199&r2=54200&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 00:34:33 2008 @@ -199,11 +199,13 @@ static tree continue_class (tree); static void finish_class (tree); static void start_method_def (tree); +/* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ #ifdef OBJCPLUS -static void objc_start_function (tree, tree, tree, tree); +static void objc_start_function (tree, tree, tree, tree, tree); #else -static void objc_start_function (tree, tree, tree, struct c_arg_info *); +static void objc_start_function (tree, tree, tree, struct c_arg_info *, tree); #endif +/* APPLE LOCAL end radar 5839812 - location for synthesized methods */ /* APPLE LOCAL radar 4947311 - protocol attributes */ static tree start_protocol (tree, tree, tree); static tree build_method_decl (enum tree_code, tree, tree, tree, bool); @@ -1182,6 +1184,8 @@ arg_name = get_identifier ("_value"); /* APPLE LOCAL radar 4157812 */ selector = objc_build_keyword_decl (key_name, arg_type, arg_name, NULL_TREE); + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + DECL_SOURCE_LOCATION (selector) = DECL_SOURCE_LOCATION (x); setter_decl = build_method_decl (INSTANCE_METHOD_DECL, ret_type, selector, build_tree_list (NULL_TREE, NULL_TREE), @@ -5235,10 +5239,12 @@ #endif objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node)); + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ objc_start_function (get_identifier (TAG_GNUINIT), build_function_type (void_type_node, OBJC_VOID_AT_END), - NULL_TREE, objc_get_parm_info (0)); + NULL_TREE, objc_get_parm_info (0), NULL_TREE); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ body = c_begin_compound_stmt (true); add_stmt (build_function_call @@ -15875,6 +15881,8 @@ static void objc_synthesize_new_getter (tree class, tree class_method, tree property) { + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + location_t save_input_location; tree decl,body,ret_val,fn; /* APPLE LOCAL begin radar 5207415 */ tree property_getter = PROPERTY_GETTER_NAME (property) @@ -15887,6 +15895,11 @@ objc_implementation_context),property_getter)) return; + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + save_input_location = input_location; + input_location = DECL_SOURCE_LOCATION (property); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ + objc_lookup_property_ivar (class, property); /* Find declaration of the property in the interface. There must be one. */ @@ -15901,7 +15914,11 @@ if (!umsg_GetAtomicProperty || !umsg_CopyAtomicStruct) declare_atomic_property_api (); objc_inherit_code = INSTANCE_METHOD_DECL; - objc_start_method_definition (copy_node (decl), NULL_TREE); + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + decl = copy_node (decl); + DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (property); + objc_start_method_definition (decl, NULL_TREE); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ body = c_begin_compound_stmt (true); if (!flag_objc_gc_only && IS_ATOMIC (property) && (PROPERTY_COPY (property) == boolean_true_node @@ -15988,6 +16005,8 @@ finish_function (); #endif objc_finish_method_definition (fn); + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + input_location = save_input_location; } /* This routine synthesizes a 'setter' routine for new property. */ @@ -15998,6 +16017,8 @@ tree body, lhs; /* APPLE LOCAL begin radar 5207415 */ tree setter_ident; + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + location_t save_input_location; if (PROPERTY_SETTER_NAME (property)) setter_ident = PROPERTY_SETTER_NAME (property); @@ -16020,11 +16041,20 @@ if (!decl) return; + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + save_input_location = input_location; + input_location = DECL_SOURCE_LOCATION (property); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ + /* APPLE LOCAL begin radar 4947014 - objc atomic property */ if (!umsg_SetAtomicProperty || !umsg_CopyAtomicStruct) declare_atomic_property_api (); objc_inherit_code = INSTANCE_METHOD_DECL; - objc_start_method_definition (copy_node (decl), NULL_TREE); + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + decl = copy_node (decl); + DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (property); + objc_start_method_definition (decl, NULL_TREE); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ body = c_begin_compound_stmt (true); /* property_name = _value; */ stmt = NULL_TREE; @@ -16117,6 +16147,8 @@ finish_function (); #endif objc_finish_method_definition (fn); + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + input_location = save_input_location; } /* APPLE LOCAL begin radar 4966565 */ @@ -16451,6 +16483,10 @@ getter_decl = build_method_decl (INSTANCE_METHOD_DECL, rettype, prop_name, NULL_TREE, false); + /* APPLE LOCAL begin radar 5839812 - synthesized methods */ + DECL_SOURCE_LOCATION (getter_decl) = + DECL_SOURCE_LOCATION (x); + /* APPLE LOCAL end radar 5839812 - synthesized methods */ objc_add_method (class, getter_decl, false, OPTIONAL_PROPERTY (x)); METHOD_PROPERTY_CONTEXT (getter_decl) = x; TREE_DEPRECATED (getter_decl) = TREE_DEPRECATED (x); @@ -16469,6 +16505,10 @@ getter_decl = build_method_decl (INSTANCE_METHOD_DECL, rettype, PROPERTY_GETTER_NAME (x), NULL_TREE, false); + /* APPLE LOCAL begin radar 5839812 - synthesized methods */ + DECL_SOURCE_LOCATION (getter_decl) = + DECL_SOURCE_LOCATION (x); + /* APPLE LOCAL end radar 5839812 - synthesized methods */ objc_add_method (class, getter_decl, false, false); /* APPLE LOCAL radar 5390587 */ METHOD_PROPERTY_CONTEXT (getter_decl) = x; @@ -16547,6 +16587,10 @@ setter_decl = build_method_decl (INSTANCE_METHOD_DECL, build_tree_list (NULL_TREE, void_type_node), selector, build_tree_list (NULL_TREE, NULL_TREE), false); + /* APPLE LOCAL begin radar 5839812 - synthesized methods */ + DECL_SOURCE_LOCATION (setter_decl) = + DECL_SOURCE_LOCATION (x); + /* APPLE LOCAL end radar 5839812 - synthesized methods */ objc_add_method (class, setter_decl, false, false); METHOD_PROPERTY_CONTEXT (setter_decl) = x; /* Issue error if setter name matches a property name. */ @@ -17582,16 +17626,31 @@ static void objc_start_function (tree name, tree type, tree attrs, +/* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ #ifdef OBJCPLUS - tree params + tree params, #else - struct c_arg_info *params + struct c_arg_info *params, #endif - ) + tree method) +/* APPLE LOCAL end radar 5839812 - location for synthesized methods */ { tree fndecl = build_decl (FUNCTION_DECL, name, type); #ifdef OBJCPLUS + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + /* fndecl's source location is, by default, the current input location + (build_decl automatically does that). If the fndecl is for a synthesized + property's getter or setter method, then the current input location will + be the '@end', rather than the '@property' or '@synthesize' statement. + The following statement detects that situation and re-sets fndecl to + the correct source location for the '@property' or '@synthesize' + statement. */ + if (method + && (strcmp (DECL_SOURCE_FILE (fndecl), DECL_SOURCE_FILE (method)) != 0 + || DECL_SOURCE_LINE (fndecl) != DECL_SOURCE_LINE (method))) + DECL_SOURCE_LOCATION (fndecl) = DECL_SOURCE_LOCATION (method); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ DECL_ARGUMENTS (fndecl) = params; DECL_INITIAL (fndecl) = error_mark_node; DECL_EXTERNAL (fndecl) = 0; @@ -17607,6 +17666,19 @@ #else struct c_label_context_se *nstack_se; struct c_label_context_vm *nstack_vm; + /* APPLE LOCAL begin radar 5839812 - location for synthesized methods */ + /* fndecl's source location is, by default, the current input location + (build_decl automatically does that). If the fndecl is for a synthesized + property's getter or setter method, then the current input location will + be the '@end', rather than the '@property' or '@synthesize' statement. + The following statement detects that situation and re-sets fndecl to + the correct source location for the '@property' or '@synthesize' + statement. */ + if (method + && (strcmp (DECL_SOURCE_FILE (fndecl), DECL_SOURCE_FILE (method)) != 0 + || DECL_SOURCE_LINE (fndecl) != DECL_SOURCE_LINE (method))) + DECL_SOURCE_LOCATION (fndecl) = DECL_SOURCE_LOCATION (method); + /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se); nstack_se->labels_def = NULL; nstack_se->labels_used = NULL; @@ -17695,7 +17767,8 @@ meth_type = build_function_type (ret_type, get_arg_type_list (method, METHOD_DEF, 0)); - objc_start_function (method_id, meth_type, NULL_TREE, parmlist); + /* APPLE LOCAL radar 5839812 - location for synthesized methods */ + objc_start_function (method_id, meth_type, NULL_TREE, parmlist, method); /* Set self_decl from the first argument. */ self_decl = DECL_ARGUMENTS (current_function_decl); @@ -19451,6 +19524,9 @@ else { tree property_decl = copy_node (x); + + /* APPLE LOCAL radar 5839812 location for synthesized methods */ + DECL_SOURCE_LOCATION (property_decl) = input_location; if (impl_code == 2) /* @dynamic ... */ PROPERTY_DYNAMIC (property_decl) = boolean_true_node; From wangmp at apple.com Tue Jul 29 23:36:53 2008 From: wangmp at apple.com (Mon P Wang) Date: Wed, 30 Jul 2008 04:36:53 -0000 Subject: [llvm-commits] [llvm] r54195 - in /llvm/trunk: docs/LangRef.html include/llvm/CodeGen/ValueTypes.h include/llvm/CodeGen/ValueTypes.td include/llvm/Intrinsics.td lib/VMCore/AutoUpgrade.cpp lib/VMCore/Function.cpp lib/VMCore/Verifier.cpp test/CodeGen/X86/atomic_op.ll utils/TableGen/CodeGenDAGPatterns.cpp utils/TableGen/CodeGenDAGPatterns.h utils/TableGen/CodeGenTarget.cpp utils/TableGen/DAGISelEmitter.cpp utils/TableGen/IntrinsicEmitter.cpp Message-ID: <200807300436.m6U4arM7023838@zion.cs.uiuc.edu> Author: wangmp Date: Tue Jul 29 23:36:53 2008 New Revision: 54195 URL: http://llvm.org/viewvc/llvm-project?rev=54195&view=rev Log: Added support for overloading intrinsics (atomics) based on pointers to different address spaces. This alters the naming scheme for those intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32 Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm/CodeGen/ValueTypes.h llvm/trunk/include/llvm/CodeGen/ValueTypes.td llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/lib/VMCore/AutoUpgrade.cpp llvm/trunk/lib/VMCore/Function.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/test/CodeGen/X86/atomic_op.ll llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h llvm/trunk/utils/TableGen/CodeGenTarget.cpp llvm/trunk/utils/TableGen/DAGISelEmitter.cpp llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 29 23:36:53 2008 @@ -5788,14 +5788,15 @@

Syntax:

- This is an overloaded intrinsic. You can use llvm.atomic.cmp.swap on any - integer bit width. Not all targets support all bit widths however.

+ This is an overloaded intrinsic. You can use llvm.atomic.cmp.swap on + any integer bit width and for different address spaces. Not all targets + support all bit widths however.

-declare i8 @llvm.atomic.cmp.swap.i8( i8* <ptr>, i8 <cmp>, i8 <val> )
-declare i16 @llvm.atomic.cmp.swap.i16( i16* <ptr>, i16 <cmp>, i16 <val> )
-declare i32 @llvm.atomic.cmp.swap.i32( i32* <ptr>, i32 <cmp>, i32 <val> )
-declare i64 @llvm.atomic.cmp.swap.i64( i64* <ptr>, i64 <cmp>, i64 <val> )
+declare i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* <ptr>, i8 <cmp>, i8 <val> )
+declare i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* <ptr>, i16 <cmp>, i16 <val> )
+declare i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* <ptr>, i32 <cmp>, i32 <val> )
+declare i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* <ptr>, i64 <cmp>, i64 <val> )
 
 
Overview:
@@ -5827,13 +5828,13 @@ store i32 4, %ptr %val1 = add i32 4, 4 -%result1 = call i32 @llvm.atomic.cmp.swap.i32( i32* %ptr, i32 4, %val1 ) +%result1 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 4, %val1 ) ; yields {i32}:result1 = 4 %stored1 = icmp eq i32 %result1, 4 ; yields {i1}:stored1 = true %memval1 = load i32* %ptr ; yields {i32}:memval1 = 8 %val2 = add i32 1, 1 -%result2 = call i32 @llvm.atomic.cmp.swap.i32( i32* %ptr, i32 5, %val2 ) +%result2 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 5, %val2 ) ; yields {i32}:result2 = 8 %stored2 = icmp eq i32 %result2, 5 ; yields {i1}:stored2 = false @@ -5852,10 +5853,10 @@ This is an overloaded intrinsic. You can use llvm.atomic.swap on any integer bit width. Not all targets support all bit widths however.

-declare i8 @llvm.atomic.swap.i8( i8* <ptr>, i8 <val> )
-declare i16 @llvm.atomic.swap.i16( i16* <ptr>, i16 <val> )
-declare i32 @llvm.atomic.swap.i32( i32* <ptr>, i32 <val> )
-declare i64 @llvm.atomic.swap.i64( i64* <ptr>, i64 <val> )
+declare i8 @llvm.atomic.swap.i8.p0i8( i8* <ptr>, i8 <val> )
+declare i16 @llvm.atomic.swap.i16.p0i16( i16* <ptr>, i16 <val> )
+declare i32 @llvm.atomic.swap.i32.p0i32( i32* <ptr>, i32 <val> )
+declare i64 @llvm.atomic.swap.i64.p0i64( i64* <ptr>, i64 <val> )
 
 
Overview:
@@ -5886,13 +5887,13 @@ store i32 4, %ptr %val1 = add i32 4, 4 -%result1 = call i32 @llvm.atomic.swap.i32( i32* %ptr, i32 %val1 ) +%result1 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val1 ) ; yields {i32}:result1 = 4 %stored1 = icmp eq i32 %result1, 4 ; yields {i1}:stored1 = true %memval1 = load i32* %ptr ; yields {i32}:memval1 = 8 %val2 = add i32 1, 1 -%result2 = call i32 @llvm.atomic.swap.i32( i32* %ptr, i32 %val2 ) +%result2 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val2 ) ; yields {i32}:result2 = 8 %stored2 = icmp eq i32 %result2, 8 ; yields {i1}:stored2 = true @@ -5911,10 +5912,10 @@ This is an overloaded intrinsic. You can use llvm.atomic.load.add on any integer bit width. Not all targets support all bit widths however.

-declare i8 @llvm.atomic.load.add.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.add.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.add.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.add.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.add.i8..p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.add.i16..p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.add.i32..p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.add.i64..p0i64( i64* <ptr>, i64 <delta> )
 
 
Overview:
@@ -5941,11 +5942,11 @@
 %ptr      = malloc i32
         store i32 4, %ptr
-%result1  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 4 )
+%result1  = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 4 )
                                 ; yields {i32}:result1 = 4
-%result2  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 2 )
+%result2  = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 2 )
                                 ; yields {i32}:result2 = 8
-%result3  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 5 )
+%result3  = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 5 )
                                 ; yields {i32}:result3 = 10
 %memval1  = load i32* %ptr      ; yields {i32}:memval1 = 15
 
@@ -5960,12 +5961,13 @@
Syntax:

This is an overloaded intrinsic. You can use llvm.atomic.load.sub on - any integer bit width. Not all targets support all bit widths however.

+ any integer bit width and for different address spaces. Not all targets + support all bit widths however.

-declare i8 @llvm.atomic.load.sub.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.sub.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.sub.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.sub.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.sub.i8.p0i32( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.sub.i16.p0i32( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.sub.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.sub.i64.p0i32( i64* <ptr>, i64 <delta> )
 
 
Overview:
@@ -5992,11 +5994,11 @@
 %ptr      = malloc i32
         store i32 8, %ptr
-%result1  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 4 )
+%result1  = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 4 )
                                 ; yields {i32}:result1 = 8
-%result2  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 2 )
+%result2  = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 2 )
                                 ; yields {i32}:result2 = 4
-%result3  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 5 )
+%result3  = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 5 )
                                 ; yields {i32}:result3 = 2
 %memval1  = load i32* %ptr      ; yields {i32}:memval1 = -3
 
@@ -6015,37 +6017,37 @@

These are overloaded intrinsics. You can use llvm.atomic.load_and, llvm.atomic.load_nand, llvm.atomic.load_or, and - llvm.atomic.load_xor on any integer bit width. Not all targets - support all bit widths however.

+ llvm.atomic.load_xor on any integer bit width and for different + address spaces. Not all targets support all bit widths however.

-declare i8 @llvm.atomic.load.and.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.and.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.and.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.and.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.and.i8.p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.and.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.and.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.and.i64.p0i64( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.or.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.or.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.or.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.or.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.or.i8.p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.or.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.or.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.or.i64.p0i64( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.nand.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.nand.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.nand.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.nand.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.nand.i8.p0i32( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.nand.i16.p0i32( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.nand.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.nand.i64.p0i32( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.xor.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.xor.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.xor.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.xor.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.xor.i8.p0i32( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.xor.i16.p0i32( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.xor.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.xor.i64.p0i32( i64* <ptr>, i64 <delta> )
 
 
Overview:
@@ -6074,13 +6076,13 @@
 %ptr      = malloc i32
         store i32 0x0F0F, %ptr
-%result0  = call i32 @llvm.atomic.load.nand.i32( i32* %ptr, i32 0xFF )
+%result0  = call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %ptr, i32 0xFF )
                                 ; yields {i32}:result0 = 0x0F0F
-%result1  = call i32 @llvm.atomic.load.and.i32( i32* %ptr, i32 0xFF )
+%result1  = call i32 @llvm.atomic.load.and.i32.p0i32( i32* %ptr, i32 0xFF )
                                 ; yields {i32}:result1 = 0xFFFFFFF0
-%result2  = call i32 @llvm.atomic.load.or.i32( i32* %ptr, i32 0F )
+%result2  = call i32 @llvm.atomic.load.or.i32.p0i32( i32* %ptr, i32 0F )
                                 ; yields {i32}:result2 = 0xF0
-%result3  = call i32 @llvm.atomic.load.xor.i32( i32* %ptr, i32 0F )
+%result3  = call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %ptr, i32 0F )
                                 ; yields {i32}:result3 = FF
 %memval1  = load i32* %ptr      ; yields {i32}:memval1 = F0
 
@@ -6100,37 +6102,38 @@

These are overloaded intrinsics. You can use llvm.atomic.load_max, llvm.atomic.load_min, llvm.atomic.load_umax, and - llvm.atomic.load_umin on any integer bit width. Not all targets + llvm.atomic.load_umin on any integer bit width and for different + address spaces. Not all targets support all bit widths however.

-declare i8 @llvm.atomic.load.max.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.max.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.max.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.max.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.max.i8.p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.max.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.max.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.max.i64.p0i64( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.min.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.min.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.min.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.min.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.min.i8.p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.min.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.min.i32..p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.min.i64..p0i64( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.umax.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.umax.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.umax.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.umax.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.umax.i8.p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.umax.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.umax.i32.p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.umax.i64.p0i64( i64* <ptr>, i64 <delta> )
 
 
-declare i8 @llvm.atomic.load.umin.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.load.umin.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.load.umin.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.load.umin.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.umin.i8..p0i8( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.umin.i16.p0i16( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.umin.i32..p0i32( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.umin.i64..p0i64( i64* <ptr>, i64 <delta> )
 
 
Overview:
@@ -6159,13 +6162,13 @@
 %ptr      = malloc i32
         store i32 7, %ptr
-%result0  = call i32 @llvm.atomic.load.min.i32( i32* %ptr, i32 -2 )
+%result0  = call i32 @llvm.atomic.load.min.i32.p0i32( i32* %ptr, i32 -2 )
                                 ; yields {i32}:result0 = 7
-%result1  = call i32 @llvm.atomic.load.max.i32( i32* %ptr, i32 8 )
+%result1  = call i32 @llvm.atomic.load.max.i32.p0i32( i32* %ptr, i32 8 )
                                 ; yields {i32}:result1 = -2
-%result2  = call i32 @llvm.atomic.load.umin.i32( i32* %ptr, i32 10 )
+%result2  = call i32 @llvm.atomic.load.umin.i32.p0i32( i32* %ptr, i32 10 )
                                 ; yields {i32}:result2 = 8
-%result3  = call i32 @llvm.atomic.load.umax.i32( i32* %ptr, i32 30 )
+%result3  = call i32 @llvm.atomic.load.umax.i32.p0i32( i32* %ptr, i32 30 )
                                 ; yields {i32}:result3 = 8
 %memval1  = load i32* %ptr      ; yields {i32}:memval1 = 30
 
Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Tue Jul 29 23:36:53 2008 @@ -70,6 +70,11 @@ LAST_VALUETYPE = 27, // This always remains at the end of the list. + // iPTRAny - An int value the size of the pointer of the current + // target to any address space. This must only be used internal to + // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR. + iPTRAny = 252, + // fAny - Any floating-point or vector floating-point value. This is used // for intrinsics that have overloadings based on floating-point types. // This is only for tblgen's consumption! Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.td?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ValueTypes.td (original) +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.td Tue Jul 29 23:36:53 2008 @@ -49,6 +49,10 @@ def v4f32 : ValueType<128, 25>; // 4 x f32 vector value def v2f64 : ValueType<128, 26>; // 2 x f64 vector value +// Pseudo valuetype mapped to the current pointer size to any address space. +// Should only be used in TableGen. +def iPTRAny : ValueType<0, 252>; + // Pseudo valuetype to represent "float of any format" def fAny : ValueType<0 , 253>; Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Tue Jul 29 23:36:53 2008 @@ -64,6 +64,11 @@ LLVMType ElTy = elty; } +class LLVMAnyPointerType + : LLVMType{ + LLVMType ElTy = elty; +} + class LLVMMatchType : LLVMType{ int Number = num; @@ -84,6 +89,7 @@ def llvm_ppcf128_ty : LLVMType; def llvm_ptr_ty : LLVMPointerType; // i8* def llvm_ptrptr_ty : LLVMPointerType; // i8** +def llvm_anyptr_ty : LLVMPointerType; // (space)i8* def llvm_empty_ty : LLVMType; // { } def llvm_descriptor_ty : LLVMPointerType; // { }* @@ -271,62 +277,62 @@ llvm_i1_ty, llvm_i1_ty, llvm_i1_ty], []>; def int_atomic_cmp_swap : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_val_compare_and_swap">; def int_atomic_load_add : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_add">; def int_atomic_swap : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_lock_test_and_set">; def int_atomic_load_sub : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_sub">; def int_atomic_load_and : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_and">; def int_atomic_load_or : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_or">; def int_atomic_load_xor : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_xor">; def int_atomic_load_nand : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_nand">; def int_atomic_load_min : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_min">; def int_atomic_load_max : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_max">; def int_atomic_load_umin : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_umin">; def int_atomic_load_umax : Intrinsic<[llvm_anyint_ty, - LLVMPointerType>, + LLVMAnyPointerType>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_umax">; Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Tue Jul 29 23:36:53 2008 @@ -40,24 +40,38 @@ switch (Name[5]) { default: break; case 'a': - // This upgrades the llvm.atomic.lcs, llvm.atomic.las, and llvm.atomic.lss - // to their new function name - if (Name.compare(5,8,"atomic.l",8) == 0) { + // This upgrades the llvm.atomic.lcs, llvm.atomic.las, llvm.atomic.lss, + // and atomics with default address spaces to their new names to their new + // function name (e.g. llvm.atomic.add.i32 => llvm.atomic.add.i32.p0i32) + if (Name.compare(5,7,"atomic.",7) == 0) { if (Name.compare(12,3,"lcs",3) == 0) { std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.cmp.swap"+Name.substr(delim)); + F->setName("llvm.atomic.cmp.swap" + Name.substr(delim) + + ".p0" + Name.substr(delim+1)); NewFn = F; return true; } else if (Name.compare(12,3,"las",3) == 0) { std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.load.add"+Name.substr(delim)); + F->setName("llvm.atomic.load.add"+Name.substr(delim) + + ".p0" + Name.substr(delim+1)); NewFn = F; return true; } else if (Name.compare(12,3,"lss",3) == 0) { std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.load.sub"+Name.substr(delim)); + F->setName("llvm.atomic.load.sub"+Name.substr(delim) + + ".p0" + Name.substr(delim+1)); + NewFn = F; + return true; + } + else if (Name.rfind(".p") == std::string::npos) { + // We don't have an address space qualifier so this has be upgraded + // to the new name. Copy the type name at the end of the intrinsic + // and add to it + std::string::size_type delim = Name.find_last_of('.'); + assert(delim != std::string::npos && "can not find type"); + F->setName(Name + ".p0" + Name.substr(delim+1)); NewFn = F; return true; } Modified: llvm/trunk/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Function.cpp (original) +++ llvm/trunk/lib/VMCore/Function.cpp Tue Jul 29 23:36:53 2008 @@ -328,9 +328,14 @@ if (numTys == 0) return Table[id]; std::string Result(Table[id]); - for (unsigned i = 0; i < numTys; ++i) - if (Tys[i]) + for (unsigned i = 0; i < numTys; ++i) { + if (const PointerType* PTyp = dyn_cast(Tys[i])) { + Result += ".p" + llvm::utostr(PTyp->getAddressSpace()) + + MVT::getMVT(PTyp->getElementType()).getMVTString(); + } + else if (Tys[i]) Result += "." + MVT::getMVT(Tys[i]).getMVTString(); + } return Result; } Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 29 23:36:53 2008 @@ -1327,7 +1327,6 @@ unsigned Count, ...) { va_list VA; va_start(VA, Count); - const FunctionType *FTy = F->getFunctionType(); // For overloaded intrinsics, the Suffix of the function name must match the @@ -1423,6 +1422,21 @@ else CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a " "pointer and a pointer is required.", F); + } + } else if (VT == MVT::iPTRAny) { + // Outside of TableGen, we don't distinguish iPTRAny (to any address + // space) and iPTR. In the verifier, we can not distinguish which case + // we have so allow either case to be legal. + if (const PointerType* PTyp = dyn_cast(Ty)) { + Suffix += ".p" + utostr(PTyp->getAddressSpace()) + + MVT::getMVT(PTyp->getElementType()).getMVTString(); + } else { + if (ArgNo == 0) + CheckFailed("Intrinsic result type is not a " + "pointer and a pointer is required.", F); + else + CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a " + "pointer and a pointer is required.", F); break; } } else if (MVT((MVT::SimpleValueType)VT).isVector()) { @@ -1456,17 +1470,21 @@ va_end(VA); - // If we computed a Suffix then the intrinsic is overloaded and we need to - // make sure that the name of the function is correct. We add the suffix to - // the name of the intrinsic and compare against the given function name. If - // they are not the same, the function name is invalid. This ensures that - // overloading of intrinsics uses a sane and consistent naming convention. + // For intrinsics without pointer arguments, if we computed a Suffix then the + // intrinsic is overloaded and we need to make sure that the name of the + // function is correct. We add the suffix to the name of the intrinsic and + // compare against the given function name. If they are not the same, the + // function name is invalid. This ensures that overloading of intrinsics + // uses a sane and consistent naming convention. Note that intrinsics with + // pointer argument may or may not be overloaded so we will check assuming it + // has a suffix and not. if (!Suffix.empty()) { std::string Name(Intrinsic::getName(ID)); - if (Name + Suffix != F->getName()) + if (Name + Suffix != F->getName()) { CheckFailed("Overloaded intrinsic has incorrect suffix: '" + F->getName().substr(Name.length()) + "'. It should be '" + Suffix + "'", F); + } } // Check parameter attributes. Modified: llvm/trunk/test/CodeGen/X86/atomic_op.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atomic_op.ll?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/atomic_op.ll (original) +++ llvm/trunk/test/CodeGen/X86/atomic_op.ll Tue Jul 29 23:36:53 2008 @@ -29,65 +29,65 @@ store i32 3855, i32* %xort store i32 4, i32* %temp %tmp = load i32* %temp ; [#uses=1] - call i32 @llvm.atomic.load.add.i32( i32* %val1, i32 %tmp ) ; :0 [#uses=1] + call i32 @llvm.atomic.load.add.i32.p0i32( i32* %val1, i32 %tmp ) ; :0 [#uses=1] store i32 %0, i32* %old - call i32 @llvm.atomic.load.sub.i32( i32* %val2, i32 30 ) ; :1 [#uses=1] + call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %val2, i32 30 ) ; :1 [#uses=1] store i32 %1, i32* %old - call i32 @llvm.atomic.load.add.i32( i32* %val2, i32 1 ) ; :2 [#uses=1] + call i32 @llvm.atomic.load.add.i32.p0i32( i32* %val2, i32 1 ) ; :2 [#uses=1] store i32 %2, i32* %old - call i32 @llvm.atomic.load.sub.i32( i32* %val2, i32 1 ) ; :3 [#uses=1] + call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %val2, i32 1 ) ; :3 [#uses=1] store i32 %3, i32* %old - call i32 @llvm.atomic.load.and.i32( i32* %andt, i32 4080 ) ; :4 [#uses=1] + call i32 @llvm.atomic.load.and.i32.p0i32( i32* %andt, i32 4080 ) ; :4 [#uses=1] store i32 %4, i32* %old - call i32 @llvm.atomic.load.or.i32( i32* %ort, i32 4080 ) ; :5 [#uses=1] + call i32 @llvm.atomic.load.or.i32.p0i32( i32* %ort, i32 4080 ) ; :5 [#uses=1] store i32 %5, i32* %old - call i32 @llvm.atomic.load.xor.i32( i32* %xort, i32 4080 ) ; :6 [#uses=1] + call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %xort, i32 4080 ) ; :6 [#uses=1] store i32 %6, i32* %old - call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 16 ) ; :7 [#uses=1] + call i32 @llvm.atomic.load.min.i32.p0i32( i32* %val2, i32 16 ) ; :7 [#uses=1] store i32 %7, i32* %old %neg = sub i32 0, 1 ; [#uses=1] - call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 %neg ) ; :8 [#uses=1] + call i32 @llvm.atomic.load.min.i32.p0i32( i32* %val2, i32 %neg ) ; :8 [#uses=1] store i32 %8, i32* %old - call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 1 ) ; :9 [#uses=1] + call i32 @llvm.atomic.load.max.i32.p0i32( i32* %val2, i32 1 ) ; :9 [#uses=1] store i32 %9, i32* %old - call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 0 ) ; :10 [#uses=1] + call i32 @llvm.atomic.load.max.i32.p0i32( i32* %val2, i32 0 ) ; :10 [#uses=1] store i32 %10, i32* %old - call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 65535 ) ; :11 [#uses=1] + call i32 @llvm.atomic.load.umax.i32.p0i32( i32* %val2, i32 65535 ) ; :11 [#uses=1] store i32 %11, i32* %old - call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 10 ) ; :12 [#uses=1] + call i32 @llvm.atomic.load.umax.i32.p0i32( i32* %val2, i32 10 ) ; :12 [#uses=1] store i32 %12, i32* %old - call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 1 ) ; :13 [#uses=1] + call i32 @llvm.atomic.load.umin.i32.p0i32( i32* %val2, i32 1 ) ; :13 [#uses=1] store i32 %13, i32* %old - call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 10 ) ; :14 [#uses=1] + call i32 @llvm.atomic.load.umin.i32.p0i32( i32* %val2, i32 10 ) ; :14 [#uses=1] store i32 %14, i32* %old - call i32 @llvm.atomic.swap.i32( i32* %val2, i32 1976 ) ; :15 [#uses=1] + call i32 @llvm.atomic.swap.i32.p0i32( i32* %val2, i32 1976 ) ; :15 [#uses=1] store i32 %15, i32* %old %neg1 = sub i32 0, 10 ; [#uses=1] - call i32 @llvm.atomic.cmp.swap.i32( i32* %val2, i32 %neg1, i32 1 ) ; :16 [#uses=1] + call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %val2, i32 %neg1, i32 1 ) ; :16 [#uses=1] store i32 %16, i32* %old - call i32 @llvm.atomic.cmp.swap.i32( i32* %val2, i32 1976, i32 1 ) ; :17 [#uses=1] + call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %val2, i32 1976, i32 1 ) ; :17 [#uses=1] store i32 %17, i32* %old ret void } -declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.add.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.sub.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.sub.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.and.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.and.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.or.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.or.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.xor.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.xor.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.min.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.min.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.max.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.max.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.umax.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.umax.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.load.umin.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.umin.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.swap.i32.p0i32(i32*, i32) nounwind -declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind +declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32*, i32, i32) nounwind Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Tue Jul 29 23:36:53 2008 @@ -443,8 +443,8 @@ return true; } - if (getExtTypeNum(0) == MVT::iPTR) { - if (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == EMVT::isInt) + if (getExtTypeNum(0) == MVT::iPTR || getExtTypeNum(0) == MVT::iPTRAny) { + if (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny || ExtVTs[0] == EMVT::isInt) return false; if (EMVT::isExtIntegerInVTs(ExtVTs)) { std::vector FVTs = FilterEVTs(ExtVTs, isInteger); @@ -463,7 +463,8 @@ setTypes(FVTs); return true; } - if (ExtVTs[0] == MVT::iPTR && EMVT::isExtIntegerInVTs(getExtTypes())) { + if ((ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny) && + EMVT::isExtIntegerInVTs(getExtTypes())) { //assert(hasTypeSet() && "should be handled above!"); std::vector FVTs = FilterEVTs(getExtTypes(), isInteger); if (getExtTypes() == FVTs) @@ -495,7 +496,8 @@ setTypes(ExtVTs); return true; } - if (getExtTypeNum(0) == EMVT::isInt && ExtVTs[0] == MVT::iPTR) { + if (getExtTypeNum(0) == EMVT::isInt && + (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny)) { setTypes(ExtVTs); return true; } @@ -527,6 +529,7 @@ case EMVT::isFP : OS << ":isFP"; break; case EMVT::isUnknown: ; /*OS << ":?";*/ break; case MVT::iPTR: OS << ":iPTR"; break; + case MVT::iPTRAny: OS << ":iPTRAny"; break; default: { std::string VTName = llvm::getName(getTypeNum(0)); // Strip off MVT:: prefix if present. @@ -781,7 +784,7 @@ assert(getTypeNum(i) == VT && "TreePattern has too many types!"); VT = getTypeNum(0); - if (VT != MVT::iPTR) { + if (VT != MVT::iPTR && VT != MVT::iPTRAny) { unsigned Size = MVT(VT).getSizeInBits(); // Make sure that the value is representable for this type. if (Size < 32) { Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Tue Jul 29 23:36:53 2008 @@ -182,13 +182,14 @@ bool isLeaf() const { return Val != 0; } bool hasTypeSet() const { - return (Types[0] < MVT::LAST_VALUETYPE) || (Types[0] == MVT::iPTR); + return (Types[0] < MVT::LAST_VALUETYPE) || (Types[0] == MVT::iPTR) || + (Types[0] == MVT::iPTRAny); } bool isTypeCompletelyUnknown() const { return Types[0] == EMVT::isUnknown; } bool isTypeDynamicallyResolved() const { - return Types[0] == MVT::iPTR; + return (Types[0] == MVT::iPTR) || (Types[0] == MVT::iPTRAny); } MVT::SimpleValueType getTypeNum(unsigned Num) const { assert(hasTypeSet() && "Doesn't have a type yet!"); Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Tue Jul 29 23:36:53 2008 @@ -65,6 +65,7 @@ case MVT::v3i32: return "MVT::v3i32"; case MVT::v3f32: return "MVT::v3f32"; case MVT::iPTR: return "TLI.getPointerTy()"; + case MVT::iPTRAny: return "TLI.getPointerTy()"; default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; } } @@ -101,6 +102,7 @@ case MVT::v3i32: return "MVT::v3i32"; case MVT::v3f32: return "MVT::v3f32"; case MVT::iPTR: return "MVT::iPTR"; + case MVT::iPTRAny: return "MVT::iPTRAny"; default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; } } @@ -459,7 +461,7 @@ Record *TyEl = TypeList->getElementAsRecord(i); assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!"); MVT::SimpleValueType VT = getValueType(TyEl->getValueAsDef("VT")); - isOverloaded |= VT == MVT::iAny || VT == MVT::fAny; + isOverloaded |= VT == MVT::iAny || VT == MVT::fAny || VT == MVT::iPTRAny; ArgVTs.push_back(VT); ArgTypeDefs.push_back(TyEl); } Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Tue Jul 29 23:36:53 2008 @@ -56,7 +56,8 @@ EMVT::isExtFloatingPointInVTs(P->getExtTypes()) || P->getExtTypeNum(0) == MVT::isVoid || P->getExtTypeNum(0) == MVT::Flag || - P->getExtTypeNum(0) == MVT::iPTR) && + P->getExtTypeNum(0) == MVT::iPTR || + P->getExtTypeNum(0) == MVT::iPTRAny) && "Not a valid pattern node to size!"); unsigned Size = 3; // The node itself. // If the root node is a ConstantSDNode, increases its size. @@ -1828,6 +1829,8 @@ std::string OpVTStr; if (OpVT == MVT::iPTR) { OpVTStr = "_iPTR"; + } else if (OpVT == MVT::iPTRAny) { + OpVTStr = "_iPTRAny"; } else if (OpVT == MVT::isVoid) { // Nodes with a void result actually have a first result type of either // Other (a chain) or Flag. Since there is no one-to-one mapping from Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=54195&r1=54194&r2=54195&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Tue Jul 29 23:36:53 2008 @@ -162,6 +162,14 @@ OS << "PointerType::getUnqual("; EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy"), ArgNo); OS << ")"; + } else if (VT == MVT::iPTRAny) { + // Make sure the user has passed us an argument type to overload. If not, + // treat it as an ordinary (not overloaded) intrinsic. + OS << "(" << ArgNo << " < numTys) ? Tys[" << ArgNo + << "] : PointerType::getUnqual("; + EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy"), ArgNo); + OS << ")"; + ++ArgNo; } else if (VT == MVT::isVoid) { if (ArgNo == 0) OS << "Type::VoidTy"; From kremenek at apple.com Wed Jul 30 00:06:13 2008 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 30 Jul 2008 05:06:13 -0000 Subject: [llvm-commits] [llvm] r54198 - /llvm/tags/checker/checker-71/ Message-ID: <200807300506.m6U56Dov024925@zion.cs.uiuc.edu> Author: kremenek Date: Wed Jul 30 00:06:13 2008 New Revision: 54198 URL: http://llvm.org/viewvc/llvm-project?rev=54198&view=rev Log: Tagging checker-71. Added: llvm/tags/checker/checker-71/ - copied from r54197, llvm/trunk/ From matthijs at stdin.nl Wed Jul 30 07:14:12 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 30 Jul 2008 12:14:12 -0000 Subject: [llvm-commits] [llvm] r54209 - /llvm/trunk/docs/CodingStandards.html Message-ID: <200807301214.m6UCECNx020710@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 30 07:14:10 2008 New Revision: 54209 URL: http://llvm.org/viewvc/llvm-project?rev=54209&view=rev Log: Not that using stream headers other than iostream is allowed. Modified: llvm/trunk/docs/CodingStandards.html Modified: llvm/trunk/docs/CodingStandards.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.html?rev=54209&r1=54208&r2=54209&view=diff ============================================================================== --- llvm/trunk/docs/CodingStandards.html (original) +++ llvm/trunk/docs/CodingStandards.html Wed Jul 30 07:14:10 2008 @@ -522,6 +522,10 @@ put more pressure on the VM system on low-memory machines. +

Note that using the other stream headers (<sstream> for +example) is allowed normally, it is just <iostream> that is +causing problems.

+
From isanbard at gmail.com Tue Jul 29 22:47:56 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 03:47:56 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54193 - in /llvm-gcc-4.2/trunk/gcc: final.c fold-const.c libgcc2.c tree.h Message-ID: <200807300347.m6U3luxl022019@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 22:47:56 2008 New Revision: 54193 URL: http://llvm.org/viewvc/llvm-project?rev=54193&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/final.c llvm-gcc-4.2/trunk/gcc/fold-const.c llvm-gcc-4.2/trunk/gcc/libgcc2.c llvm-gcc-4.2/trunk/gcc/tree.h Modified: llvm-gcc-4.2/trunk/gcc/final.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/final.c?rev=54193&r1=54192&r2=54193&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/final.c (original) +++ llvm-gcc-4.2/trunk/gcc/final.c Tue Jul 29 22:47:56 2008 @@ -255,6 +255,8 @@ static tree get_mem_expr_from_op (rtx, int *); static void output_asm_operand_names (rtx *, int *, int); static void output_operand (rtx, int); +/* APPLE LOCAL ARM compact switch tables */ +static void calculate_alignments (void); #ifdef LEAF_REGISTERS static void leaf_renumber_regs (rtx); #endif @@ -717,9 +719,13 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ +/* APPLE LOCAL begin ARM compact switch tables */ +#if !defined (TARGET_EXACT_SIZE_CALCULATIONS) /* If not optimizing or optimizing for size, don't assign any alignments. */ if (! optimize || optimize_size) return 0; +#endif +/* APPLE LOCAL end ARM compact switch tables */ FOR_EACH_BB (bb) { @@ -731,9 +737,14 @@ int log, max_skip, max_log; /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ +/* APPLE LOCAL begin ARM compact switch tables */ if (!LABEL_P (label) - || probably_never_executed_bb_p (bb)) +#if !defined (TARGET_EXACT_SIZE_CALCULATIONS) + || probably_never_executed_bb_p (bb) +#endif + ) continue; +/* APPLE LOCAL end ARM compact switch tables */ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ /* If user has specified an alignment, honour it. */ if (LABEL_ALIGN_LOG (label) > 0) @@ -834,14 +845,17 @@ int i; int max_log; int max_skip; + /* APPLE LOCAL begin ARM compact switch tables */ + /* Removed seq. */ #ifdef HAVE_ATTR_length #define MAX_CODE_ALIGN 16 - rtx seq; int something_changed = 1; char *varying_length; rtx body; int uid; - rtx align_tab[MAX_CODE_ALIGN]; + /* Removed align_tab. */ + bool asms_present = false; + /* APPLE LOCAL end ARM compact switch tables */ #endif @@ -949,32 +963,11 @@ varying_length = XCNEWVEC (char, max_uid); - /* Initialize uid_align. We scan instructions - from end to start, and keep in align_tab[n] the last seen insn - that does an alignment of at least n+1, i.e. the successor - in the alignment chain for an insn that does / has a known - alignment of n. */ + /* APPLE LOCAL begin ARM compact switch tables */ uid_align = XCNEWVEC (rtx, max_uid); + calculate_alignments (); - for (i = MAX_CODE_ALIGN; --i >= 0;) - align_tab[i] = NULL_RTX; - seq = get_last_insn (); - for (; seq; seq = PREV_INSN (seq)) - { - int uid = INSN_UID (seq); - int log; -/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ - log = (LABEL_P (seq) ? LABEL_ALIGN_LOG (seq) : 0); -/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ - uid_align[uid] = align_tab[0]; - if (log) - { - /* Found an alignment label. */ - uid_align[uid] = align_tab[log]; - for (i = log - 1; i >= 0; i--) - align_tab[i] = seq; - } - } + /* APPLE LOCAL end ARM compact switch tables */ #ifdef CASE_VECTOR_SHORTEN_MODE if (optimize) { @@ -1035,7 +1028,14 @@ #endif /* CASE_VECTOR_SHORTEN_MODE */ /* Compute initial lengths, addresses, and varying flags for each insn. */ - for (insn_current_address = 0, insn = first; +/* APPLE LOCAL begin ARM compact switch tables */ +#ifdef TARGET_UNEXPANDED_PROLOGUE_SIZE + insn_current_address = TARGET_UNEXPANDED_PROLOGUE_SIZE; +#else + insn_current_address = 0; +#endif + for (insn = first; +/* APPLE LOCAL end ARM compact switch tables */ insn != 0; insn_current_address += insn_lengths[uid], insn = NEXT_INSN (insn)) { @@ -1077,7 +1077,12 @@ /* Alignment is handled by ADDR_VEC_ALIGN. */ } else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0) - insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn); + /* APPLE LOCAL begin ARM compact switch tables */ + { + insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn); + asms_present = true; + } + /* APPLE LOCAL end ARM compact switch tables */ else if (GET_CODE (body) == SEQUENCE) { int i; @@ -1139,7 +1144,14 @@ { something_changed = 0; insn_current_align = MAX_CODE_ALIGN - 1; - for (insn_current_address = 0, insn = first; +/* APPLE LOCAL begin ARM compact switch tables */ +#ifdef TARGET_UNEXPANDED_PROLOGUE_SIZE + insn_current_address = TARGET_UNEXPANDED_PROLOGUE_SIZE; +#else + insn_current_address = 0; +#endif + for (insn = first; +/* APPLE LOCAL end ARM compact switch tables */ insn != 0; insn = NEXT_INSN (insn)) { @@ -1179,6 +1191,11 @@ #ifdef CASE_VECTOR_SHORTEN_MODE if (optimize && JUMP_P (insn) +/* APPLE LOCAL begin ARM compact switch tables */ +#ifdef TARGET_EXACT_SIZE_CALCULATIONS + && !asms_present +#endif +/* APPLE LOCAL end ARM compact switch tables */ && GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC) { rtx body = PATTERN (insn); @@ -1280,7 +1297,18 @@ { insn_lengths[uid] = (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body))); +/* APPLE LOCAL begin ARM compact switch tables */ +#ifdef ADJUST_INSN_LENGTH + ADJUST_INSN_LENGTH (insn, insn_lengths[uid]); +#endif insn_current_address += insn_lengths[uid]; +#ifdef TARGET_ALIGN_ADDR_DIFF_VEC_LABEL + /* Label gets same alignment as table. */ + SET_LABEL_ALIGN (rel_lab, ADDR_VEC_ALIGN (insn), + LABEL_MAX_SKIP (rel_lab)); + calculate_alignments (); +#endif +/* APPLE LOCAL end ARM compact switch tables */ if (insn_lengths[uid] != old_length) something_changed = 1; } @@ -1372,6 +1400,41 @@ #endif /* HAVE_ATTR_length */ } +/* APPLE LOCAL begin ARM compact switch tables */ +/* Initialize uid_align. We scan instructions + from end to start, and keep in align_tab[n] the last seen insn + that does an alignment of at least n+1, i.e. the successor + in the alignment chain for an insn that does / has a known + alignment of n. */ +static void +calculate_alignments (void) +{ + int i; + rtx seq; + rtx align_tab[MAX_CODE_ALIGN]; + + for (i = MAX_CODE_ALIGN; --i >= 0;) + align_tab[i] = NULL_RTX; + seq = get_last_insn (); + for (; seq; seq = PREV_INSN (seq)) + { + int uid = INSN_UID (seq); + int log; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + log = (LABEL_P (seq) ? LABEL_ALIGN_LOG (seq) : 0); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ + uid_align[uid] = align_tab[0]; + if (log) + { + /* Found an alignment label. */ + uid_align[uid] = align_tab[log]; + for (i = log - 1; i >= 0; i--) + align_tab[i] = seq; + } + } +} +/* APPLE LOCAL end ARM compact switch tables */ + #ifdef HAVE_ATTR_length /* Given the body of an INSN known to be generated by an ASM statement, return the number of machine instructions likely to be generated for this insn. Modified: llvm-gcc-4.2/trunk/gcc/fold-const.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/fold-const.c?rev=54193&r1=54192&r2=54193&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/fold-const.c (original) +++ llvm-gcc-4.2/trunk/gcc/fold-const.c Tue Jul 29 22:47:56 2008 @@ -1890,7 +1890,9 @@ if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST) { /* And some specific cases even faster than that. */ - /* LLVM local begin gcc 121252 */ + /* LLVM LOCAL - begin gcc 121252 */ + /* FIXME: Do we need this LLVM-specific code anymore? */ +#ifdef ENABLE_LLVM if (code == PLUS_EXPR) { if (integer_zerop (arg0) && !TREE_OVERFLOW (arg0)) @@ -1908,7 +1910,16 @@ if (integer_onep (arg0) && !TREE_OVERFLOW (arg0)) return arg1; } - /* LLVM local end gcc 121252 */ +#else + if (code == PLUS_EXPR && integer_zerop (arg0)) + return arg1; + else if ((code == MINUS_EXPR || code == PLUS_EXPR) + && integer_zerop (arg1)) + return arg0; + else if (code == MULT_EXPR && integer_onep (arg0)) + return arg1; +#endif + /* LLVM LOCAL - end gcc 121252 */ /* Handle general case of two integer constants. */ return int_const_binop (code, arg0, arg1, 0); @@ -2162,6 +2173,8 @@ { case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: + /* APPLE LOCAL blocks 5862465 */ + case BLOCK_POINTER_TYPE: case OFFSET_TYPE: if (TREE_CODE (arg) == INTEGER_CST) { @@ -6833,14 +6846,14 @@ for (;; ref = TREE_OPERAND (ref, 0)) { + /* LLVM LOCAL begin */ if (TREE_CODE (ref) == ARRAY_REF - /* LLVM LOCAL begin */ -#if ENABLE_LLVM +#ifdef ENABLE_LLVM /* LLVM extends ARRAY_REF to allow pointers to be the base value. */ && (TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) == ARRAY_TYPE) #endif - /* LLVM LOCAL end */ ) + /* LLVM LOCAL end */ { itype = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (ref, 0))); if (! itype) @@ -12951,14 +12964,14 @@ { if ((TREE_CODE (exp) == INDIRECT_REF || TREE_CODE (exp) == ARRAY_REF) - && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE /* LLVM LOCAL begin */ + && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE #if ENABLE_LLVM /* LLVM extends ARRAY_REF to allow pointers to be the base value. */ && (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == ARRAY_TYPE) #endif -/* LLVM LOCAL end */ ) +/* LLVM LOCAL end */ { tree exp1 = TREE_OPERAND (exp, 0); tree index; Modified: llvm-gcc-4.2/trunk/gcc/libgcc2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/libgcc2.c?rev=54193&r1=54192&r2=54193&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/libgcc2.c (original) +++ llvm-gcc-4.2/trunk/gcc/libgcc2.c Tue Jul 29 22:47:56 2008 @@ -2091,6 +2091,10 @@ #endif } +#ifdef __i386__ +extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall)); +#endif + int mprotect (char *addr, int len, int prot) { Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=54193&r1=54192&r2=54193&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Tue Jul 29 22:47:56 2008 @@ -866,7 +866,8 @@ #define CST_CHECK(T) TREE_CLASS_CHECK (T, tcc_constant) #define STMT_CHECK(T) TREE_CLASS_CHECK (T, tcc_statement) #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE) -#define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE) +/* APPLE LOCAL blocks 5862465 */ +#define PTR_OR_REF_CHECK(T) TREE_CHECK3 (T, POINTER_TYPE, REFERENCE_TYPE, BLOCK_POINTER_TYPE) #define RECORD_OR_UNION_CHECK(T) \ TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) From isanbard at gmail.com Tue Jul 29 22:35:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 03:35:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54192 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.c global.c local-alloc.c tree-pass.h Message-ID: <200807300335.m6U3ZJ7j021518@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 22:35:16 2008 New Revision: 54192 URL: http://llvm.org/viewvc/llvm-project?rev=54192&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/global.c llvm-gcc-4.2/trunk/gcc/local-alloc.c llvm-gcc-4.2/trunk/gcc/tree-pass.h Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=54192&r1=54191&r2=54192&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Tue Jul 29 22:35:16 2008 @@ -1261,7 +1261,6 @@ ATTRIBUTE_UNUSED; /* LLVM LOCAL begin */ - #ifndef ENABLE_LLVM /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception @@ -1286,9 +1285,7 @@ X86_64_MEMORY_CLASS }; #endif /* !ENABLE_LLVM */ - /* LLVM LOCAL end */ - static const char * const x86_64_reg_class_name[] = { "no", "integer", "integerSI", "sse", "sseSF", "sseDF", "sseup", "x87", "x87up", "cplx87", "no" @@ -5233,7 +5230,8 @@ # define USE_HIDDEN_LINKONCE 0 #endif -static int pic_labels_used; +/* APPLE LOCAL 5695218 */ +static GTY(()) int pic_labels_used; /* Fills in the label name that should be used for a pc thunk for the given register. */ @@ -5424,6 +5422,49 @@ return INVALID_REGNUM; } +/* APPLE LOCAL begin 5695218 */ +/* Reload may introduce references to the PIC base register + that do not directly reference pic_offset_table_rtx. + In the rare event we choose an alternate PIC register, + walk all the insns and rewrite every reference. */ +/* Run through the insns, changing references to the original + PIC_OFFSET_TABLE_REGNUM to our new one. */ +static void +ix86_globally_replace_pic_reg (unsigned int new_pic_regno) +{ + rtx insn; + const int nregs = PIC_OFFSET_TABLE_REGNUM + 1; + rtx reg_map[FIRST_PSEUDO_REGISTER]; + memset (reg_map, 0, nregs * sizeof (rtx)); + pic_offset_table_rtx = gen_rtx_REG (SImode, new_pic_regno); + reg_map[REAL_PIC_OFFSET_TABLE_REGNUM] = pic_offset_table_rtx; + + push_topmost_sequence (); + for (insn = get_insns (); insn != NULL; insn = NEXT_INSN (insn)) + { + if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN) + { + replace_regs (PATTERN (insn), reg_map, nregs, 1); + replace_regs (REG_NOTES (insn), reg_map, nregs, 1); + } +#if defined (TARGET_TOC) + else if (GET_CODE (insn) == CALL_INSN) + { + if ( !SIBLING_CALL_P (insn)) + abort (); + } +#endif + } + pop_topmost_sequence (); + + regs_ever_live[new_pic_regno] = 1; + regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 0; +#if defined (TARGET_TOC) + cfun->machine->substitute_pic_base_reg = new_pic_regno; +#endif +} +/* APPLE LOCAL end 5695218 */ + /* Return 1 if we need to save REGNO. */ static int ix86_save_reg (unsigned int regno, int maybe_eh_return) @@ -5437,10 +5478,12 @@ if (pic_offset_table_rtx && regno == REAL_PIC_OFFSET_TABLE_REGNUM - && (regs_ever_live[REAL_PIC_OFFSET_TABLE_REGNUM] + /* APPLE LOCAL begin 5695218 */ + && (current_function_uses_pic_offset_table || current_function_profile || current_function_calls_eh_return || current_function_uses_const_pool)) + /* APPLE LOCAL end 5695218 */ { if (ix86_select_alt_pic_regnum () != INVALID_REGNUM) return 0; @@ -5464,6 +5507,16 @@ && regno == REGNO (cfun->machine->force_align_arg_pointer)) return 1; + /* APPLE LOCAL begin 5695218 */ + /* In order to get accurate usage info for the PIC register, we've + been forced to break and un-break the call_used_regs and + fixed_regs vectors. Ignore them when considering the PIC + register. */ + if (regno == REAL_PIC_OFFSET_TABLE_REGNUM + && regs_ever_live[regno]) + return 1; + /* APPLE LOCAL end 5695218 */ + return (regs_ever_live[regno] && !call_used_regs[regno] && !fixed_regs[regno] @@ -6008,14 +6061,20 @@ } pic_reg_used = false; - if (pic_offset_table_rtx - && (regs_ever_live[REAL_PIC_OFFSET_TABLE_REGNUM] - || current_function_profile)) + /* APPLE LOCAL begin 5695218 */ + if (pic_offset_table_rtx && regs_ever_live[REAL_PIC_OFFSET_TABLE_REGNUM] + && !TARGET_64BIT) { - unsigned int alt_pic_reg_used = ix86_select_alt_pic_regnum (); + unsigned int alt_pic_reg_used; + + alt_pic_reg_used = ix86_select_alt_pic_regnum (); + /* APPLE LOCAL end 5695218 */ if (alt_pic_reg_used != INVALID_REGNUM) - REGNO (pic_offset_table_rtx) = alt_pic_reg_used; + /* APPLE LOCAL begin 5695218 */ + /* REGNO (pic_offset_table_rtx) = alt_pic_reg_used; */ + ix86_globally_replace_pic_reg (alt_pic_reg_used); + /* APPLE LOCAL end 5695218 */ pic_reg_used = true; } @@ -18927,7 +18986,8 @@ return TARGET_64BIT || !TARGET_PARTIAL_REG_STALL; case DImode: - return TARGET_64BIT; + /* APPLE LOCAL 5695218 convert int to logical bool */ + return !!TARGET_64BIT; default: return false; @@ -19763,7 +19823,7 @@ { int tmp_regno = 2 /* ECX */; if (lookup_attribute ("fastcall", - TYPE_ATTRIBUTES (TREE_TYPE (function)))) + TYPE_ATTRIBUTES (TREE_TYPE (function)))) tmp_regno = 0 /* EAX */; tmp = gen_rtx_REG (SImode, tmp_regno); } Modified: llvm-gcc-4.2/trunk/gcc/global.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/global.c?rev=54192&r1=54191&r2=54192&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/global.c (original) +++ llvm-gcc-4.2/trunk/gcc/global.c Tue Jul 29 22:35:16 2008 @@ -455,17 +455,17 @@ { bool cannot_elim = (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to) -/* APPLE LOCAL begin ARM prefer SP to FP */ + /* APPLE LOCAL begin ARM prefer SP to FP */ #ifdef ALLOW_ELIMINATION_TO_SP /* There are certain performance benefits for some targets in using SP instead of FP. CAN_ELIMINATE must prevent us from using SP when we can't so there's no need for us to prevent elimination to the SP. */ - ); #else - || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp)); + || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp) #endif -/* APPLE LOCAL end ARM prefer SP to FP */ + ); + /* APPLE LOCAL end ARM prefer SP to FP */ if (!regs_asm_clobbered[eliminables[i].from]) { @@ -494,7 +494,7 @@ error ("%s cannot be used in asm here", reg_names[HARD_FRAME_POINTER_REGNUM]); } - /* APPLE LOCAL end CW asm blocks 4443946 */ + /* APPLE LOCAL end CW asm blocks 4443946 */ else regs_ever_live[HARD_FRAME_POINTER_REGNUM] = 1; #endif @@ -782,6 +782,18 @@ free (allocno_order); } + /* APPLE LOCAL begin 5695218 */ +#ifdef TARGET_386 + if ((flag_pic && !TARGET_64BIT) || PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + { + fixed_regs[REAL_PIC_OFFSET_TABLE_REGNUM] = call_used_regs[REAL_PIC_OFFSET_TABLE_REGNUM] = 1; + SET_HARD_REG_BIT (call_fixed_reg_set, REAL_PIC_OFFSET_TABLE_REGNUM); + SET_HARD_REG_BIT (fixed_reg_set, REAL_PIC_OFFSET_TABLE_REGNUM); + SET_HARD_REG_BIT (call_used_reg_set, REAL_PIC_OFFSET_TABLE_REGNUM); + } +#endif + /* APPLE LOCAL end 5695218 */ + /* Do the reloads now while the allocno data still exists, so that we can try to assign new hard regs to any pseudo regs that are spilled. */ @@ -826,6 +838,22 @@ = (((double) (floor_log2 (allocno[v2].n_refs) * allocno[v2].freq) / allocno[v2].live_length) * (10000 / REG_FREQ_MAX) * allocno[v2].size); + /* APPLE LOCAL begin 5695218 */ + /* DImode pseudos get 2x the priority of SImode pseudos because + their size (2x sizeof(SImode)) is factored in above. Since + HImode and QImode pseudoes are restricted to a subset of integer + registers on x86_32, give them more priority than SImode pseudos, + but less than DImode pseudos. */ +#if defined(TARGET_386) + if (flag_global_alloc_prefer_bytes && !TARGET_64BIT) + { + if (reg_preferred_class (allocno[v1].reg) == Q_REGS) + pri1 = (double)pri1 * 1.9; + if (reg_preferred_class (allocno[v2].reg) == Q_REGS) + pri2 = (double)pri2 * 1.9; + } +#endif + /* APPLE LOCAL end 5695218 */ if (pri2 - pri1) return pri2 - pri1; @@ -1812,6 +1840,7 @@ { int k, l; /* Mark tied pseudo-regs that have not yet been assigned a reg + and do not already have a hard reg preference and do not conflict as preferring this reg. Mark pseudo-regs conflicting with regs tied to this reg and not yet assigned a reg as not preferring this reg. */ @@ -1858,7 +1887,6 @@ void retry_global_alloc (int regno, HARD_REG_SET forbidden_regs) { - int alloc_no = reg_allocno[regno]; /* LLVM LOCAL begin - cc1 code size. */ #ifdef ENABLE_LLVM @@ -2343,9 +2371,15 @@ orig_regno = ORIGINAL_REGNO (r); if (orig_regno < FIRST_PSEUDO_REGISTER || regno >= FIRST_PSEUDO_REGISTER) continue; + /* APPLE LOCAL begin 5695218 */ if (regno == orig_regno) continue; + if (orig_regno >= max_regno) + continue; i = reg_allocno[orig_regno]; + if (i < 0) + continue; + /* APPLE LOCAL end 5695218 */ EXECUTE_IF_SET_IN_ALLOCNO_SET(pseudo_preferences + i * allocno_row_words, j, { if (i != j @@ -2648,21 +2682,55 @@ int i, j; fprintf (file, ";; Register dispositions:\n"); + /* APPLE LOCAL begin 5695218 */ for (i = FIRST_PSEUDO_REGISTER, j = 0; i < max_regno; i++) - if (reg_renumber[i] >= 0) - { - fprintf (file, "%d in %d ", i, reg_renumber[i]); - if (++j % 6 == 0) - fprintf (file, "\n"); - } + { + if (!REG_P (regno_reg_rtx[i])) + fprintf (file, "pseudo %d: ", i); + print_inline_rtx (file, regno_reg_rtx[i], 0); + if (reg_renumber[i] > -1) + fprintf (file, " w=" HOST_WIDE_INT_PRINT_DEC, local_reg_weight[reg_renumber[i]]); + fprintf (file, "\n"); + } + /* APPLE LOCAL end 5695218 */ fprintf (file, "\n\n;; Hard regs used: "); for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (regs_ever_live[i]) - fprintf (file, " %d", i); + /* APPLE LOCAL 5695218 */ + fprintf (file, " %d/%s", i, reg_names[i]); fprintf (file, "\n\n"); } +/* APPLE LOCAL begin 5695218 */ +/* Print out the current global register assignments. Invoked from the debugger. */ +void debug_global_regs (void); +void +debug_global_regs (void) +{ + dump_global_regs (stdout); +} +void dump_hard_regset (FILE *, HARD_REG_SET); +void dump_hard_regset (FILE *file, HARD_REG_SET regset) +{ + int i; + long long unsigned int ulli; + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + { + ulli = (1LL << i); + if (TEST_HARD_REG_BIT (regset, i) && *reg_names[i]) + fprintf (file, " %d=0x%llx/%s", i, ulli, reg_names[i]); + } + fprintf (file, "\n"); +} +/* Print out the registers in a hard REGSET. Invoked from the debugger. */ +void debug_hard_regset (HARD_REG_SET); +void debug_hard_regset (HARD_REG_SET regset) +{ + dump_hard_regset (stdout, regset); +} +/* APPLE LOCAL end 5695218 */ + /* This page contains code to make live information more accurate. Modified: llvm-gcc-4.2/trunk/gcc/local-alloc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/local-alloc.c?rev=54192&r1=54191&r2=54192&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/local-alloc.c (original) +++ llvm-gcc-4.2/trunk/gcc/local-alloc.c Tue Jul 29 22:35:16 2008 @@ -292,6 +292,19 @@ /* Nonzero if we recorded an equivalence for a LABEL_REF. */ static int recorded_label_ref; +/* APPLE LOCAL begin 5695218 */ +/* Pseudo registers that inherit from the PIC_OFFSET_TABLE_RTX have + their bit set here. Used to predict when a not-yet-allocated + pseudo-register might turn into a pic reference during reload. */ +GTY(()) sbitmap pic_rtx_inheritance; +/* max_allocno by max_allocno array of bits, recording inheritance; + bits j and k set in row m mean that allocno m was set by a + computation involving j and k. */ +static GTY(()) sbitmap *reg_inheritance_matrix; +static int reg_inheritance_1 (rtx *, void *); +static void reg_inheritance (void); +/* APPLE LOCAL end 5695218 */ + static void alloc_qty (int, enum machine_mode, int, int); static void validate_equiv_mem_from_store (rtx, rtx, void *); static int validate_equiv_mem (rtx, rtx, rtx); @@ -365,10 +378,28 @@ ORDER_REGS_FOR_LOCAL_ALLOC; #endif + /* APPLE LOCAL begin 5695218 */ + gcc_assert (!reg_inheritance_matrix); + if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + { + reg_inheritance_matrix = sbitmap_vector_alloc (max_regno, max_regno); + sbitmap_vector_zero (reg_inheritance_matrix, max_regno); + } + /* APPLE LOCAL end 5695218 */ + /* Promote REG_EQUAL notes to REG_EQUIV notes and adjust status of affected registers. */ update_equiv_regs (); + /* APPLE LOCAL begin 5695218 */ + if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + { + reg_inheritance (); + sbitmap_vector_free (reg_inheritance_matrix); + reg_inheritance_matrix = (sbitmap *)0; + } + /* APPLE LOCAL end 5695218 */ + /* This sets the maximum number of quantities we can have. Quantity numbers start at zero and we can have one for each pseudo. */ max_qty = (max_regno - FIRST_PSEUDO_REGISTER); @@ -861,6 +892,18 @@ dest = SET_DEST (set); src = SET_SRC (set); + /* APPLE LOCAL begin 5695218 */ + if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + { + int dstregno; + if (REG_P (dest)) + { + dstregno = REGNO (dest); + for_each_rtx (&src, reg_inheritance_1, (void*)dstregno); + } + } + /* APPLE LOCAL end 5695218 */ + /* See if this is setting up the equivalence between an argument register and its stack slot. */ note = find_reg_note (insn, REG_EQUIV, NULL_RTX); @@ -2565,6 +2608,139 @@ } #endif /* APPLE LOCAL end radar 4216496, 4229407, 4120689, 4095567 */ + +/* APPLE LOCAL begin 5695218 */ +static void dump_inheritance (FILE *); +static void +dump_inheritance (FILE *dumpfile) +{ + sbitmap_iterator sbiter; + unsigned int ui; + int emitted, width; + fprintf (dumpfile, ";; FIRST_PSEUDO_REGISTER = %d, max_regno = %d\n", FIRST_PSEUDO_REGISTER, max_regno); + dump_sbitmap_vector (dumpfile, ";; register inheritance matrix:", ";; register", reg_inheritance_matrix, max_regno); + if (pic_rtx_inheritance) + { + fprintf (dumpfile, "\n;; pic_rtx_inheritance bitmap:\n"); + dump_sbitmap (dumpfile, pic_rtx_inheritance); + fprintf (dumpfile, "\n;; pseudo-regs that inherit PIC_OFFSET_TABLE_REGNUM (=%d):\n", + PIC_OFFSET_TABLE_REGNUM); + width = 0; + EXECUTE_IF_SET_IN_SBITMAP (pic_rtx_inheritance, FIRST_PSEUDO_REGISTER, ui, sbiter) + { + emitted = fprintf (dumpfile, " %d,", ui); + gcc_assert (emitted >= 0); + width += emitted; + if (width > 75) + { + width = 0; + fprintf (dumpfile, "\n"); + } + } + fprintf (dumpfile, "\n\n"); + } + else + fprintf (dumpfile, ";; pic_rtx_inheritance=0\n"); +} +void debug_inheritance (void); +void +debug_inheritance (void) +{ + dump_inheritance (stdout); +} +/* If we've walked into a SUBREG or REG, record it as inherited. See + reg_inheritance() below. */ +static int +reg_inheritance_1 (rtx *px, void *data) +{ + rtx x = *px; + unsigned int srcregno, dstregno; + + dstregno = (int)data; +#ifdef TARGET_386 + /* Ugly special case: When moving a DImode constant into an FP + register, GCC will use the movdf_nointeger pattern, pushing the + DImode constant into memory and loading into the '387. It looks + like this: (set (reg:DF) (subreg:DF (reg:DI))). We're choosing + to match the subreg; hope this is sufficient. + */ + if (GET_CODE (x) == SUBREG + && GET_MODE (x) == DFmode + && GET_MODE (SUBREG_REG (x)) == DImode) + { + SET_BIT (reg_inheritance_matrix[dstregno], PIC_OFFSET_TABLE_REGNUM); + return 0; + } +#endif + if (GET_CODE (x) == SUBREG) + x = SUBREG_REG (x); + if (REG_P (x)) + { + srcregno = REGNO (x); + SET_BIT (reg_inheritance_matrix[dstregno], srcregno); + } + if (GET_CODE (x) == CONST_VECTOR) + { + SET_BIT (reg_inheritance_matrix[dstregno], PIC_OFFSET_TABLE_REGNUM); + } + return 0; /* Keep walking the RTX; visit all the REGs. */ +} +/* Walk all the insns and set the reg_inheritance_matrix[]. */ +void +reg_inheritance (void) +{ + unsigned int /* dstregno, */ pic_rtx_regno, ui; + /* int i; */ + /* rtx dst, insn, set, src; */ + bool changing; + + if (!optimize) + return; + + if (pic_rtx_inheritance) + sbitmap_free (pic_rtx_inheritance); + pic_rtx_inheritance = sbitmap_alloc (max_regno); + sbitmap_zero (pic_rtx_inheritance); + pic_rtx_regno = PIC_OFFSET_TABLE_REGNUM; + /* Now loop over reg_inheritance_matrix[], computing pic_rtx_inheritance. */ + for (ui = FIRST_PSEUDO_REGISTER; ui < (unsigned)max_regno; ui++) + { + /* This row of the matrix represents the regnos (pseudo and + hard) that are inherited by pseudo regno ui. If regno ui + inherits from the PIC_OFFSET_TABLE_REGNUM, set the ui bit in + pic_rtx_inheritance. */ + if (TEST_BIT (reg_inheritance_matrix[ui], pic_rtx_regno)) + SET_BIT (pic_rtx_inheritance, ui); + /* else AND pic_rtx_inheritance with reg_inheritance_matrix[ui * + max_regno_row_words + (PIC_OFFSET_TABLE_REGNUM / INT_BITS)], + if nonzero, set the same bit */ + } + /* pic_rtx_inheritance has a bit set for every pseudo that inherits + the PIC_OFFSET_TABLE_REGNUM directly. Now compute all the pseudo + registers that inherit PIC_OFFSET_TABLE_REGNUM indirectly. */ + /* now, indefinite loop over reg_inheritance_matrix[], ANDing with each entry; + when non-zero, OR in bit as above. + continue until no more change observed */ + /* FIXME: obvious candidate for sbitmap.h:EXECUTE_IF_SET_IN_SBITMAP() */ + do { + changing = false; + for (ui = FIRST_PSEUDO_REGISTER; ui < (unsigned)max_regno; ui++) + if (!TEST_BIT (pic_rtx_inheritance, ui) + && sbitmap_any_common_bits (reg_inheritance_matrix[ui], pic_rtx_inheritance)) + { + SET_BIT (pic_rtx_inheritance, ui); + changing = true; + } + } while (changing); + if (dump_file) + { + timevar_push (TV_DUMP); + dump_inheritance (dump_file); + timevar_pop (TV_DUMP); + } +} +/* APPLE LOCAL end 5695218 */ + /* LLVM LOCAL begin */ #endif /* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/tree-pass.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-pass.h?rev=54192&r1=54191&r2=54192&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-pass.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree-pass.h Tue Jul 29 22:35:16 2008 @@ -360,6 +360,9 @@ extern struct tree_opt_pass pass_recompute_reg_usage; extern struct tree_opt_pass pass_sms; extern struct tree_opt_pass pass_sched; +/* APPLE LOCAL begin 5695218 */ +extern struct tree_opt_pass pass_life3; +/* APPLE LOCAL end 5695218 */ extern struct tree_opt_pass pass_local_alloc; extern struct tree_opt_pass pass_global_alloc; extern struct tree_opt_pass pass_postreload; From nicholas at mxc.ca Tue Jul 29 22:00:18 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 29 Jul 2008 20:00:18 -0700 Subject: [llvm-commits] [llvm] r54158 - /llvm/trunk/tools/bugpoint/CrashDebugger.cpp In-Reply-To: <200807290855.m6T8tU12011543@zion.cs.uiuc.edu> References: <200807290855.m6T8tU12011543@zion.cs.uiuc.edu> Message-ID: <488FD942.2090404@mxc.ca> Matthijs Kooijman wrote: > Author: matthijs > Date: Tue Jul 29 03:55:30 2008 > New Revision: 54158 > > URL: http://llvm.org/viewvc/llvm-project?rev=54158&view=rev > Log: > Improve bugpoint output a bit by outputting the actual instructions instead of > just it's name, which is often empty. Also remove a newline from the output > that wasn't really needed. I'm not sure that's such a good idea. I've certainly had cases where the mere attempt to print an instruction would cause it to eat up enormous amounts of memory and crash. The problem is enormous Types, in case anyone is wondering, and yes the code compiles fine otherwise. Nick > Modified: > llvm/trunk/tools/bugpoint/CrashDebugger.cpp > > Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=54158&r1=54157&r2=54158&view=diff > > ============================================================================== > --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) > +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Tue Jul 29 03:55:30 2008 > @@ -469,7 +469,7 @@ > } else { > if (BugpointIsInterrupted) goto ExitLoops; > > - std::cout << "Checking instruction '" << I->getName() << "': "; > + std::cout << "Checking instruction: " << *I; > Module *M = BD.deleteInstructionFromProgram(I, Simplification); > > // Find out if the pass still crashes on this pass... > @@ -539,7 +539,6 @@ > > static bool TestForCodeGenCrash(BugDriver &BD, Module *M) { > try { > - std::cerr << '\n'; > BD.compileProgram(M); > std::cerr << '\n'; > return false; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From isanbard at gmail.com Tue Jul 29 23:41:35 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 04:41:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54196 - in /llvm-gcc-4.2/trunk/gcc: c-common.c c-decl.c c-parser.c c-typeck.c config/rs6000/rs6000.c cp/call.c cp/decl.c cp/error.c cp/mangle.c cp/name-lookup.c cp/parser.c cp/semantics.c cp/typeck.c dwarf2out.c expr.c function.c objc/objc-act.c tree.h Message-ID: <200807300441.m6U4fagj024036@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 23:41:34 2008 New Revision: 54196 URL: http://llvm.org/viewvc/llvm-project?rev=54196&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/c-decl.c llvm-gcc-4.2/trunk/gcc/c-parser.c llvm-gcc-4.2/trunk/gcc/c-typeck.c llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c llvm-gcc-4.2/trunk/gcc/cp/call.c llvm-gcc-4.2/trunk/gcc/cp/decl.c llvm-gcc-4.2/trunk/gcc/cp/error.c llvm-gcc-4.2/trunk/gcc/cp/mangle.c llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c llvm-gcc-4.2/trunk/gcc/cp/parser.c llvm-gcc-4.2/trunk/gcc/cp/semantics.c llvm-gcc-4.2/trunk/gcc/cp/typeck.c llvm-gcc-4.2/trunk/gcc/dwarf2out.c llvm-gcc-4.2/trunk/gcc/expr.c llvm-gcc-4.2/trunk/gcc/function.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/tree.h Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Tue Jul 29 23:41:34 2008 @@ -202,6 +202,11 @@ */ +/* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ +/* Move declaration of invoke_impl_ptr_type from c-typeck.c */ +tree invoke_impl_ptr_type; +/* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ + tree c_global_trees[CTI_MAX]; /* Switches common to the C front ends. */ @@ -626,6 +631,8 @@ static tree handle_warn_unused_result_attribute (tree *, tree, tree, int, bool *); static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL radar 5932809 - copyable byref blocks */ +static tree handle_blocks_attribute (tree *, tree, tree, int, bool *); /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM @@ -744,6 +751,8 @@ handle_gcroot_attribute }, #endif /* LLVM LOCAL end */ + /* APPLE LOCAL radar 5932809 - copyable byref blocks */ + { "blocks", 1, 1, true, false, false, handle_blocks_attribute }, { NULL, 0, 0, false, false, false, NULL } }; @@ -6047,6 +6056,119 @@ return NULL_TREE; } +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +/* Handle "blocks" attribute. */ +static tree +handle_blocks_attribute (tree *node, tree name, + tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + tree arg_ident; + *no_add_attrs = true; + if (!(*node) || TREE_CODE (*node) != VAR_DECL) + { + warning (OPT_Wattributes, "byref attribute can be specified on variables only - ignored"); + return NULL_TREE; + } + arg_ident = TREE_VALUE (args); + gcc_assert (TREE_CODE (arg_ident) == IDENTIFIER_NODE); + /* APPLE LOCAL radar 6096219 */ + if (strcmp (IDENTIFIER_POINTER (arg_ident), "byref")) + { + /* APPLE LOCAL radar 6096219 */ + warning (OPT_Wattributes, "Only \"byref\" is allowed - %qE attribute ignored", + name); + return NULL_TREE; + } + + COPYABLE_BYREF_LOCAL_VAR (*node) = 1; + COPYABLE_BYREF_LOCAL_NONPOD (*node) = block_requires_copying (*node); + return NULL_TREE; +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + +/* APPLE LOCAL begin blocks 6040305 */ +static tree block_byref_release_decl; + +/* Build a: void _Block_byref_release (void *) if not done + already. */ +tree +build_block_byref_release_decl (void) +{ + if (!block_byref_release_decl && + !(block_byref_release_decl = + lookup_name (get_identifier ("_Block_byref_release")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + + block_byref_release_decl = + builtin_function ("_Block_byref_release", func_type, 0, NOT_BUILT_IN, + 0, NULL_TREE); + + TREE_NOTHROW (block_byref_release_decl) = 0; + } + return block_byref_release_decl; +} + +/* This routine builds call to: + _Block_byref_release(VAR_DECL.forwarding); + and adds it to the statement list. + */ +tree +build_block_byref_release_exp (tree var_decl) +{ + tree exp = var_decl, call_exp, func_params; + tree type = TREE_TYPE (var_decl); + /* __block variables imported into Blocks are not _Block_byref_released() + from within the Block statement itself; otherwise, each envokation of + the block causes a release. Make sure to release __block variables declared + and used locally in the block though. */ + if (cur_block + && (BLOCK_DECL_COPIED (var_decl) || BLOCK_DECL_BYREF (var_decl))) + return NULL_TREE; + if (BLOCK_DECL_BYREF (var_decl)) { + /* This is a "struct Block_byref_X *" type. Get its pointee. */ + gcc_assert (POINTER_TYPE_P (type)); + type = TREE_TYPE (type); + exp = build_indirect_ref (exp, "unary *"); + } + TREE_USED (var_decl) = 1; + + /* Declare: _Block_byref_release(void*) if not done already. */ + exp = build_component_ref (exp, get_identifier ("forwarding")); + func_params = tree_cons (NULL_TREE, exp, NULL_TREE); + call_exp = build_function_call (build_block_byref_release_decl (), func_params); + return call_exp; +} +/* APPLE LOCAL begin blocks 6040305 */ +/* APPLE LOCAL begin radar 5803600 */ +/** add_block_global_byref_list - Adds global variable decl to the list of + byref global declarations in the current block. +*/ +void add_block_global_byref_list (tree decl) +{ + cur_block->block_byref_global_decl_list = + tree_cons (NULL_TREE, decl, cur_block->block_byref_global_decl_list); +} + +/** in_block_global_byref_list - returns TRUE if global variable is + in the list of 'byref' declarations. +*/ +bool in_block_global_byref_list (tree decl) +{ + tree chain; + if (TREE_STATIC (decl)) { + for (chain = cur_block->block_byref_global_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (TREE_VALUE (chain) == decl) + return true; + } + return false; +} +/* APPLE LOCAL end radar 5803600 */ + /* Handle a "sentinel" attribute. */ static tree Modified: llvm-gcc-4.2/trunk/gcc/c-decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-decl.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-decl.c Tue Jul 29 23:41:34 2008 @@ -61,8 +61,11 @@ #include "except.h" #include "langhooks-def.h" #include "pointer-set.h" -/* LLVM LOCAL */ +/* LLVM LOCAL - begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif +/* LLVM LOCAL - end */ /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context @@ -323,6 +326,14 @@ tree blocks; tree blocks_last; + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + /* None-zero if outermost block of a statement which can have a + break/continue stmt; such as while, switch, etc. This cannot be + a boolen field because the same scope can be used for a nested + while/for statement; as in, while(...) while (...). */ + unsigned int bc_stmt_body; + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ + /* The depth of this scope. Used to keep the ->shadowed chain of bindings sorted innermost to outermost. */ unsigned int depth : 28; @@ -348,6 +359,12 @@ /* True means make a BLOCK for this scope no matter what. */ BOOL_BITFIELD keep : 1; + + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + /* When true, current scope has at least one local __block variable + in its scope. This flag is used for compile-time performance. */ + BOOL_BITFIELD byref_in_current_scope : 1; + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ }; /* The scope currently in effect. */ @@ -671,6 +688,10 @@ scope->keep = keep_next_level_flag; scope->outer = current_scope; scope->depth = current_scope ? (current_scope->depth + 1) : 0; + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + scope->byref_in_current_scope = + current_scope ? current_scope->byref_in_current_scope : false; + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* Check for scope depth overflow. Unlikely (2^28 == 268,435,456) but possible. */ @@ -695,6 +716,107 @@ TYPE_CONTEXT (type) = context; } +/* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ +/* This routine is called at the begining of parsing of a while/for, etc. + statement and sets bc_stmt_body in current scope to say that outer scope + is for such a statement. */ +void in_bc_stmt_block (void) +{ + gcc_assert (current_scope); + ++current_scope->bc_stmt_body; +} + +/* This routine resets the bc_stmt_body flag before exiting the top-most + block of while/for, etc. statement. */ +void outof_bc_stmt_block (void) +{ + gcc_assert (current_scope && current_scope->bc_stmt_body > 0); + --current_scope->bc_stmt_body; +} + +/* This routine generates calls of _Block_byref_release(VAR_DECL.forwarding); + for all byref variables seen in the scope of the return statement. +*/ +void release_all_local_byrefs_at_return (void) +{ + struct c_scope *scope; + struct c_binding *b; + + gcc_assert (current_scope); + if (flag_objc_gc_only || !current_scope->byref_in_current_scope) + return; + + scope = current_scope; + while (scope && scope != file_scope) + { + for (b = scope->bindings; b; b = b->prev) + { + tree p = b->decl; + if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) + gen_block_byref_release_exp (p); + } + /* Release up to scope of the block. */ + if (cur_block && cur_block->the_scope == scope) + break; + scope = scope->outer; + } +} + +/* This routine issues a diagnostic if a __block variable is seen in + the current scope. This is for now called from a goto statement. */ +void +diagnose_byref_var_in_current_scope (void) +{ + struct c_scope *scope; + struct c_binding *b; + + gcc_assert (current_scope); + if (flag_objc_gc_only || !current_scope->byref_in_current_scope) + return; + + scope = current_scope; + while (scope && scope != file_scope) + { + for (b = scope->bindings; b; b = b->prev) + { + tree p = b->decl; + if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) { + error ("local byref variable %s is in the scope of this goto", + IDENTIFIER_POINTER (DECL_NAME (p))); + return; + } + } + scope = scope->outer; + } +} + +/* This routine generates call to _Block_byref_release(VAR_DECL.forwarding); + for all __block variables which go out of scope when 'break' is executed. +*/ +void release_local_byrefs_at_break (void) +{ + struct c_scope *scope; + struct c_binding *b; + + gcc_assert (current_scope); + if (flag_objc_gc_only || !current_scope->byref_in_current_scope) + return; + + scope = current_scope; + while (scope && !scope->bc_stmt_body) + { + for (b = scope->bindings; b; b = b->prev) + { + tree p = b->decl; + if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) + gen_block_byref_release_exp (p); + } + scope = scope->outer; + } +} + +/* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ + /* Exit a scope. Restore the state of the identifier-decl mappings that were in effect when this scope was entered. Return a BLOCK node containing all the DECLs in this scope that are of interest @@ -825,6 +947,11 @@ goto common_symbol; case VAR_DECL: + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + if (!flag_objc_gc_only && COPYABLE_BYREF_LOCAL_VAR (p)) + gen_block_byref_release_exp (p); + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ + /* Warnings for unused variables. */ if (!TREE_USED (p) && !TREE_NO_WARNING (p) @@ -3552,16 +3679,316 @@ return; c_eh_initialized_p = true; - /* LLVM local begin */ + /* LLVM LOCAL - begin */ +#ifdef ENABLE_LLVM llvm_eh_personality_libfunc = llvm_init_one_libfunc (USING_SJLJ_EXCEPTIONS ? "__gcc_personality_sj0" : "__gcc_personality_v0"); - /* LLVM local end */ +#else + eh_personality_libfunc + = init_one_libfunc (USING_SJLJ_EXCEPTIONS + ? "__gcc_personality_sj0" + : "__gcc_personality_v0"); +#endif + /* LLVM LOCAL - end */ default_init_unwind_resume_libfunc (); using_eh_for_cleanups (); } +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +static tree block_byref_id_object_copy; +static tree block_byref_id_object_dispose; + +/* This routine builds: + *(id *)(EXP+20) expression which references the object id pointer. +*/ +static tree +build_indirect_object_id_exp (tree exp) +{ + tree dst_obj; + int offset; + + /* dst->object = [src->object retail]; In thid case 'object' is the field + of the object passed offset by: void* + int + int + void* + void * + This must match definition of Block_byref structs. */ + offset = GET_MODE_SIZE (Pmode) + sizeof (unsigned_type_node) + + sizeof (unsigned_type_node) + GET_MODE_SIZE (Pmode) + + GET_MODE_SIZE (Pmode); + dst_obj = build2 (PLUS_EXPR, ptr_type_node, exp, + build_int_cst (NULL_TREE, offset)); + /* Type case to: 'id *' */ + dst_obj = cast_to_pointer_to_id (dst_obj); + dst_obj = build_indirect_ref (dst_obj, "unary *"); + return dst_obj; +} + + +/** + This routine builds: + + void __Block_byref_id_object_copy(struct Block_byref_id_object *dst, + struct Block_byref_id_object *src) { + dst->object = [src->object retain]; + } +*/ +static void synth_block_byref_id_object_copy_func (void) +{ + tree stmt, fnbody; + tree dst_arg, src_arg; + tree dst_obj, src_obj, retain_exp, store; + struct c_arg_info * arg_info; + + gcc_assert (block_byref_id_object_copy); + /* Set up: (void* _dest, void*_src) parameters. */ + dst_arg = build_decl (PARM_DECL, get_identifier ("_dst"), + ptr_type_node); + TREE_USED (dst_arg) = 1; + DECL_ARG_TYPE (dst_arg) = ptr_type_node; + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + ptr_type_node); + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = ptr_type_node; + arg_info = xcalloc (1, sizeof (struct c_arg_info)); + TREE_CHAIN (dst_arg) = src_arg; + arg_info->parms = dst_arg; + arg_info->types = tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, + ptr_type_node, + NULL_TREE)); + /* function header synthesis. */ + push_function_context (); + start_block_helper_function (block_byref_id_object_copy, true); + store_parm_decls_from (arg_info); + + /* Body of the function. */ + stmt = c_begin_compound_stmt (true); + /* Build dst->object */ + dst_obj = build_indirect_object_id_exp (dst_arg); + + + /* src_obj is: _src->object. */ + src_obj = build_indirect_object_id_exp (src_arg); + + retain_exp = retain_block_component (src_obj); + + /* dst->object = [src->object retain]; */ + store = build_modify_expr (dst_obj, NOP_EXPR, retain_exp); + + add_stmt (store); + + fnbody = c_end_compound_stmt (stmt, true); + add_stmt (fnbody); + finish_function (); + pop_function_context (); + free (arg_info); +} + +/** + This routine builds: + + void __Block_byref_id_object_dispose(struct Block_byref_id_object *_src) { + [_src->object release]; + } +*/ +static void synth_block_byref_id_object_dispose_func (void) +{ + tree stmt, fnbody; + tree src_arg, src_obj, rel_exp; + struct c_arg_info * arg_info; + + gcc_assert (block_byref_id_object_dispose); + /* Set up: (void *_src) parameter. */ + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + ptr_type_node); + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = ptr_type_node; + arg_info = xcalloc (1, sizeof (struct c_arg_info)); + arg_info->parms = src_arg; + arg_info->types = tree_cons (NULL_TREE, ptr_type_node, + NULL_TREE); + /* function header synthesis. */ + push_function_context (); + start_block_helper_function (block_byref_id_object_dispose, true); + store_parm_decls_from (arg_info); + + /* Body of the function. */ + stmt = c_begin_compound_stmt (true); + /* [_src->object release]; */ + src_obj = build_indirect_object_id_exp (src_arg); + + rel_exp = release_block_component (src_obj); + add_stmt (rel_exp); + + fnbody = c_end_compound_stmt (stmt, true); + add_stmt (fnbody); + finish_function (); + pop_function_context (); + free (arg_info); +} + +/* new_block_byref_decl - This routine changes a 'typex x' declared variable into: + + struct __Block_byref_x { + struct Block_byref_x *forwarding; + int32_t flags; + int32_t size; + void *ByrefKeepFuncPtr; // Only if variable is __block ObjC object + void *ByrefDestroyFuncPtr; // Only if variable is __block ObjC object + typex x; + } x; +*/ + +static tree +new_block_byref_decl (tree decl) +{ + static int unique_count; + tree Block_byref_type; + tree field_decl_chain, field_decl; + const char *prefix = "__Block_byref_"; + char *string = alloca (strlen (IDENTIFIER_POINTER (DECL_NAME (decl))) + + strlen (prefix) + 8 /* to hold the count */); + + sprintf (string, "%s%d_%s", prefix, ++unique_count, + IDENTIFIER_POINTER (DECL_NAME (decl))); + + push_to_top_level (); + Block_byref_type = start_struct (RECORD_TYPE, get_identifier (string)); + + /* struct Block_byref_x *forwarding; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("forwarding"), + build_pointer_type (Block_byref_type)); + field_decl_chain = field_decl; + + /* int32_t flags; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("flags"), + unsigned_type_node); + chainon (field_decl_chain, field_decl); + + /* int32_t size; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("size"), + unsigned_type_node); + chainon (field_decl_chain, field_decl); + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + { + /* void *ByrefKeepFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("ByrefKeepFuncPtr"), + ptr_type_node); + chainon (field_decl_chain, field_decl); + + /* void *ByrefDestroyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("ByrefDestroyFuncPtr"), + ptr_type_node); + chainon (field_decl_chain, field_decl); + } + + /* typex x; */ + field_decl = build_decl (FIELD_DECL, DECL_NAME (decl), TREE_TYPE (decl)); + chainon (field_decl_chain, field_decl); + + pop_from_top_level (); + finish_struct (Block_byref_type, field_decl_chain, NULL_TREE); + + TREE_TYPE (decl) = Block_byref_type; + /* Force layout_decl to recompute these fields. */ + DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0; + layout_decl (decl, 0); + return decl; +} + +/* init_byref_decl - This routine builds the initializer for the __Block_byref_x + type in the form of: + { &x, 0, sizeof(struct __Block_byref_x), initializer-expr}; + + or: + { &x, 0, sizeof(struct __Block_byref_x)}; + when INIT is NULL_TREE + + For __block ObjC objects, it also adds "byref_keep" and "byref_destroy" + Funtion pointers. So the most general initializers would be: + + { &x, 0, sizeof(struct __Block_byref_x), &byref_keep, &byref_destroy, + &initializer-expr}; + +*/ +static tree +init_byref_decl (tree decl, tree init) +{ + tree initlist; + tree block_byref_type = TREE_TYPE (decl); + int size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_byref_type)); + unsigned flags = 0; + tree fields; + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + flags = BLOCK_HAS_COPY_DISPOSE; + + fields = TYPE_FIELDS (block_byref_type); + initlist = tree_cons (fields, + build_unary_op (ADDR_EXPR, decl, 0), 0); + fields = TREE_CHAIN (fields); + + initlist = tree_cons (fields, build_int_cst (TREE_TYPE (fields), flags), + initlist); + fields = TREE_CHAIN (fields); + initlist = tree_cons (fields, build_int_cst (TREE_TYPE (fields), size), + initlist); + fields = TREE_CHAIN (fields); + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + { + char name [64]; + /* Add &__Block_byref_id_object_copy, &__Block_byref_id_object_dispose + initializers. */ + if (!block_byref_id_object_copy) + { + /* Build a void __Block_byref_id_object_copy(void*, void*) type. */ + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, + void_list_node))); + strcpy (name, "__Block_byref_id_object_copy"); + block_byref_id_object_copy = build_helper_func_decl (get_identifier (name), + func_type); + /* Synthesize function definition. */ + synth_block_byref_id_object_copy_func (); + } + initlist = tree_cons (fields, + build_fold_addr_expr (block_byref_id_object_copy), + initlist); + fields = TREE_CHAIN (fields); + + if (!block_byref_id_object_dispose) + { + /* Synthesize void __Block_byref_id_object_dispose (void*) and + build &__Block_byref_id_object_dispose. */ + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + strcpy (name, "__Block_byref_id_object_dispose"); + block_byref_id_object_dispose = build_helper_func_decl (get_identifier (name), + func_type); + /* Synthesize function definition. */ + synth_block_byref_id_object_dispose_func (); + } + initlist = tree_cons (fields, + build_fold_addr_expr (block_byref_id_object_dispose), + initlist); + fields = TREE_CHAIN (fields); + } + + if (init) + { + init = do_digest_init (TREE_TYPE (fields), init); + initlist = tree_cons (fields, init, initlist); + } + init = build_constructor_from_list (block_byref_type, nreverse (initlist)); + return init; +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* Finish processing of a declaration; install its initial value. If the length of an array type is not known before, @@ -3588,7 +4015,28 @@ /* Don't crash if parm is initialized. */ if (TREE_CODE (decl) == PARM_DECL) init = 0; - + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + /* We build a new type for each local variable declared as __block + and initialize it to a list of initializers. */ + else if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) + { + if (DECL_EXTERNAL (decl) || TREE_STATIC (decl)) + { + warning (0, + "__block attribute is only allowed on local variables - ignored"); + COPYABLE_BYREF_LOCAL_VAR (decl) = 0; + COPYABLE_BYREF_LOCAL_NONPOD (decl) = 0; + } + else + { + decl = new_block_byref_decl (decl); + init = init_byref_decl (decl, init); + /* Mark that current scope has a __block local variable. */ + current_scope->byref_in_current_scope = true; + } + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + if (init) store_init_value (decl, init); @@ -4151,6 +4599,8 @@ case cdk_function: case cdk_array: case cdk_pointer: + /* APPLE LOCAL radar 5732232 - blocks */ + case cdk_block_pointer: funcdef_syntax = (decl->kind == cdk_function); decl = decl->declarator; break; @@ -4775,6 +5225,29 @@ declarator = declarator->declarator; break; } + + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cj) */ + case cdk_block_pointer: + { + if (TREE_CODE (type) != FUNCTION_TYPE) + { + error ("block pointer to non-function type is invalid"); + type = error_mark_node; + } + else + { + type = build_block_pointer_type (type); + /* APPLE LOCAL begin radar 5814025 (C++ cj) */ + /* Process type qualifiers (such as const or volatile) + that were given inside the `^'. */ + type_quals = declarator->u.pointer_quals; + /* APPLE LOCAL end radar 5814025 (C++ cj) */ + declarator = declarator->declarator; + } + break; + } + /* APPLE LOCAL end radar 5732232 - blocks (C++ cj) */ + default: gcc_unreachable (); } @@ -7268,7 +7741,10 @@ { struct language_function *p = f->language; - if (DECL_STRUCT_FUNCTION (current_function_decl) == 0 + /* APPLE LOCAL begin blocks 6040305 */ + if (current_function_decl + && DECL_STRUCT_FUNCTION (current_function_decl) == 0 + /* APPLE LOCAL end blocks 6040305 */ && DECL_SAVED_TREE (current_function_decl) == NULL_TREE) { /* Stop pointing to the local nodes about to be freed. */ @@ -7453,6 +7929,489 @@ return ret; } +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ +/* build_byref_local_var_access - converts EXPR to: + EXPR.forwarding->. +*/ +tree +build_byref_local_var_access (tree expr, tree decl_name) +{ + tree exp = build_component_ref (expr, get_identifier ("forwarding")); + exp = build_indirect_ref (exp, "unary *"); + exp = build_component_ref (exp, decl_name); + return exp; +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */ +/* APPLE LOCAL begin radar 5732232 - blocks (C++ ch) */ +/** + build_block_byref_decl - This routine inserts a variable declared as a + 'byref' variable using the |...| syntax in helper function's outer-most scope. +*/ +tree +build_block_byref_decl (tree name, tree decl, tree exp) +{ + /* If it is already a byref declaration, do not add the pointer type + because such declarations already have the pointer type + added. This happens when we have two nested byref declarations in + nested blocks. */ + tree ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) + ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); + tree byref_decl = build_decl (VAR_DECL, name, ptr_type); + DECL_CONTEXT (byref_decl) = current_function_decl; + BLOCK_DECL_BYREF (byref_decl) = 1; + + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ + if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) + { + COPYABLE_BYREF_LOCAL_VAR (byref_decl) = 1; + COPYABLE_BYREF_LOCAL_NONPOD (byref_decl) = COPYABLE_BYREF_LOCAL_NONPOD (decl); + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */ + + /* Current scope must be that of the main function body. */ + gcc_assert (current_scope->function_body); + bind (name, byref_decl, + current_scope, /*invisible=*/false, /*nested=*/false); + cur_block->block_byref_decl_list = + tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); + cur_block->block_original_byref_decl_list = + tree_cons (NULL_TREE, exp, cur_block->block_original_byref_decl_list); + return byref_decl; +} + +#define BINDING_VALUE(b) ((b)->decl) + +/** + build_block_ref_decl - This routine inserts a copied-in variable (a variable + referenced in the block but whose scope is outside the block) in helper + function's outer-most scope. It also sets its type to 'const' as such + variables are read-only. +*/ +tree +build_block_ref_decl (tree name, tree decl) +{ + struct c_scope *scope = current_scope; + tree ref_decl; + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ + /* 'decl' was previously declared as __block. Simply, copy the value + embedded in the above variable. */ + if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) + decl = build_byref_local_var_access (decl, DECL_NAME (decl)); + else { + /* APPLE LOCAL begin radar 5988451 (C++ ch) */ + if (cur_block->prev_block_info) { + /* Traverse enclosing blocks. Insert a copied-in variable in each + enclosing block which has no declaration of this variable. This is + to ensure that the current (inner) block has the 'frozen' value of the + copied-in variable; which means the value of the copied in variable + is at the point of the block declaration and *not* when the inner block + is invoked. + */ + struct block_sema_info *cb = cur_block->prev_block_info; + while (cb) { + struct c_binding *b = I_SYMBOL_BINDING (name); + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + gcc_assert ((b->depth >= cur_block->the_scope->depth) + == (DECL_CONTEXT (BINDING_VALUE (b)) == cur_block->helper_func_decl)); + /* Find the first declaration not in current block. */ + while (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) == cur_block->helper_func_decl) + { + /* FIXME: This can't happen?! */ + abort (); + b = b->shadowed; + } + + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + gcc_assert ((b->depth < cb->the_scope->depth) + == (DECL_CONTEXT (BINDING_VALUE (b)) != cb->helper_func_decl)); + + /* Is the next declaration not in the enclosing block? */ + if (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) != cb->helper_func_decl) + { + /* No declaration of variable seen in the block. Must + insert one, so it 'freezes' the variable in this + block. */ + struct c_scope *save_scope = current_scope; + struct block_sema_info *save_current_block = cur_block; + tree save_current_function_decl = current_function_decl; + current_scope = cb->the_scope; + cur_block = cb; + current_function_decl = cb->helper_func_decl; + decl = build_block_ref_decl (name, decl); + cur_block = save_current_block; + current_scope = save_scope; + current_function_decl = save_current_function_decl; + } + cb = cb->prev_block_info; + } + } + /* APPLE LOCAL end radar 5988451 (C++ ch) */ + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */ + + ref_decl = build_decl (VAR_DECL, name, + build_qualified_type (TREE_TYPE (decl), + TYPE_QUAL_CONST)); + DECL_CONTEXT (ref_decl) = current_function_decl; + DECL_INITIAL (ref_decl) = error_mark_node; + /* APPLE LOCAL radar 5805175 - blocks (C++ ch) */ + c_apply_type_quals_to_decl (TYPE_QUAL_CONST, ref_decl); + BLOCK_DECL_COPIED (ref_decl) = 1; + + /* Find the scope for function body (outer-most scope) and insert + this variable in that scope. This is to avoid duplicate + declaration of the save variable. */ + while (scope && !scope->function_body) + scope = scope->outer; + /* We are enterring the copied-in variable in helper function's + outer scope; that of its main body. */ + gcc_assert (scope); + bind (name, ref_decl, + scope, /*invisible=*/false, /*nested=*/false); + cur_block->block_ref_decl_list = + tree_cons (NULL_TREE, ref_decl, cur_block->block_ref_decl_list); + cur_block->block_original_ref_decl_list = + tree_cons (NULL_TREE, decl, cur_block->block_original_ref_decl_list); + return ref_decl; +} + +/* APPLE LOCAL begin radar 5939894 (C++ ch) */ +/** build_block_internal_types - This routine builds the block type: + struct __invoke_impl { + void *isa; + int32_t Flags; + int32_t Size; + void *FuncPtr; + } *invoke_impl_ptr_type; + */ +void +build_block_internal_types (void) +{ + tree field_decl_chain, field_decl; + tree invoke_impl_type; + + /* APPLE LOCAL begin radar 5939894 (C++ ch) */ + /* If a user-declaration of "struct __invoke_impl" is seen, use it. */ + invoke_impl_type = lookup_tag (RECORD_TYPE, get_identifier ("__invoke_impl"), 0); + if (invoke_impl_type) + { + invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); + return; + } + /* APPLE LOCAL end radar 5939894 (C++ ch) */ + + push_to_top_level (); + invoke_impl_type = start_struct (RECORD_TYPE, get_identifier ("__invoke_impl")); + + /* APPLE LOCAL begin radar 5811599 (C++ ch) */ + /* void *isa; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); + /* APPLE LOCAL end radar 5811599 (C++ ch) */ + field_decl_chain = field_decl; + + /* int32_t Flags; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Flags"), unsigned_type_node); + chainon (field_decl_chain, field_decl); + + /* int32_t Size */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), unsigned_type_node); + chainon (field_decl_chain, field_decl); + + /* void *FuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("FuncPtr"), ptr_type_node); + chainon (field_decl_chain, field_decl); + + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks (C++ ch) */ + /* Mark this struct as being a block struct rather than a 'normal' + struct. */ + TYPE_BLOCK_IMPL_STRUCT (invoke_impl_type) = 1; + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks (C++ ch) */ + finish_struct (invoke_impl_type, field_decl_chain, NULL_TREE); + pop_from_top_level (); + invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); +} +/* APPLE LOCAL end radar 5939894 (C++ ch) */ + +/* APPLE LOCAL begin radar 5814025 (C++ ch) */ +struct c_declarator * +make_block_pointer_declarator (struct c_declspecs *type_quals_attrs, + struct c_declarator *target) +{ + int quals = 0; + struct c_declarator *itarget = target; + struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); + + /* APPLE LOCAL begin radar 5732232 - blocks (C++ ch) */ + /* Closure contructs seen -- generate supporting types. */ + if (!invoke_impl_ptr_type) + build_block_internal_types (); + /* APPLE LOCAL end radar 5732232 - blocks (C++ ch) */ + + if (type_quals_attrs) + { + tree attrs = type_quals_attrs->attrs; + quals = quals_from_declspecs (type_quals_attrs); + if (attrs != NULL_TREE) + itarget = build_attrs_declarator (attrs, target); + } + ret->kind = cdk_block_pointer; + /* APPLE LOCAL radar 5882266 (C++ ch) */ + ret->declarator = itarget; + ret->u.pointer_quals = quals; + return ret; +} +/* APPLE LOCAL end radar 5814025 (C++ ch) */ + +tree +begin_block (void) +{ + struct block_sema_info *csi; + push_scope (); + csi = (struct block_sema_info*)xcalloc (1, sizeof (struct block_sema_info)); + csi->prev_block_info = cur_block; + cur_block = csi; + return NULL_TREE; +} + +struct block_sema_info * +finish_block (tree block __attribute__ ((__unused__))) +{ + struct block_sema_info *csi = cur_block; + cur_block = cur_block->prev_block_info; + pop_scope (); + return csi; +} + +bool +in_imm_block (void) +{ + /* APPLE LOCAL radar 5988451 (C++ ch) */ + return (cur_block && cur_block->the_scope == current_scope); +} + +/* This routine returns 'true' if 'name' has a declaration inside the + current block, 'false' otherwise. If 'name' has no declaration in + the current block, it returns in DECL the user declaration for + 'name' found in the enclosing scope. Note that if it is declared + in current declaration, it can be either a user declaration or a + byref/copied-in declaration added in current block's scope by the + compiler. */ +bool +lookup_name_in_block (tree name, tree *decl) +{ + if (cur_block) + { + struct c_binding *b = I_SYMBOL_BINDING (name); + gcc_assert ((b->depth >= cur_block->the_scope->depth) + == (DECL_CONTEXT (BINDING_VALUE (b)) == current_function_decl)); + if (DECL_CONTEXT (BINDING_VALUE (b)) == current_function_decl) + return true; + + /* Check for common case of block nested inside a non-block. */ + if (!cur_block->prev_block_info) + return false; + /* Check for less common case of nested blocks. */ + /* Declaration not in current block. Find the first user + declaration of 'name' in outer scope. */ + /* APPLE LOCAL begin radar 5988451 (C++ ch) */ + /* Check for variables only, as we may have parameters, such as + 'self' */ + /* Note that if a copied-in variable (BLOCK_DECL_COPIED) in the + enclosing block is found, it must be returned as this is + where the variable in current (nested block) will have to get + its value. */ + while (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL) + && BLOCK_DECL_BYREF (BINDING_VALUE (b))) + b = b->shadowed; + /* APPLE LOCAL end radar 5988451 (C++ ch) */ + if (b && BINDING_VALUE (b)) + *decl = BINDING_VALUE (b); + } + return false; +} + +static struct c_scope *save_current_scope; +static tree save_current_function_decl; +void +push_to_top_level (void) +{ + save_current_scope = current_scope; + save_current_function_decl = current_function_decl; + current_scope = file_scope; + current_function_decl = NULL_TREE; +} + +void +pop_from_top_level (void) +{ + current_scope = save_current_scope; + current_function_decl = save_current_function_decl; +} + +/** + build_helper_func_decl - This routine builds a FUNCTION_DECL for + a block helper function. +*/ +tree +build_helper_func_decl (tree ident, tree type) +{ + tree func_decl = build_decl (FUNCTION_DECL, ident, type); + DECL_EXTERNAL (func_decl) = 0; + TREE_PUBLIC (func_decl) = 0; + TREE_USED (func_decl) = 1; + TREE_NOTHROW (func_decl) = 0; + return func_decl; +} + +/** + start_block_helper_function - This is a light-weight version of start_function(). + It has removed all the fuss in the start_function(). + */ +void +start_block_helper_function (tree decl1, bool add_result_decl) +{ + struct c_label_context_se *nstack_se; + struct c_label_context_vm *nstack_vm; + + current_function_returns_value = 0; /* Assume, until we see it does. */ + current_function_returns_null = 0; + current_function_returns_abnormally = 0; + warn_about_return_type = 0; + c_switch_stack = NULL; + + nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack_se->labels_def = NULL; + nstack_se->labels_used = NULL; + nstack_se->next = label_context_stack_se; + label_context_stack_se = nstack_se; + + nstack_vm = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack_vm->labels_def = NULL; + nstack_vm->labels_used = NULL; + nstack_vm->scope = 0; + nstack_vm->next = label_context_stack_vm; + label_context_stack_vm = nstack_vm; + + /* Indicate no valid break/continue context by setting these variables + to some non-null, non-label value. We'll notice and emit the proper + error message in c_finish_bc_stmt. */ + c_break_label = c_cont_label = size_zero_node; + + announce_function (decl1); + + /* Make the init_value nonzero so pushdecl knows this is not tentative. + error_mark_node is replaced below (in pop_scope) with the BLOCK. */ + DECL_INITIAL (decl1) = error_mark_node; + + current_function_prototype_locus = UNKNOWN_LOCATION; + current_function_prototype_built_in = false; + current_function_prototype_arg_types = NULL_TREE; + + /* This function exists in static storage. + (This does not mean `static' in the C sense!) */ + TREE_STATIC (decl1) = 1; + /* A helper function is not global */ + TREE_PUBLIC (decl1) = 0; + + /* This is the earliest point at which we might know the assembler + name of the function. Thus, if it's set before this, die horribly. */ + gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl1)); + current_function_decl = pushdecl (decl1); + + /* APPLE LOCAL begin optimization pragmas 3124235/3420242 (C++ ch) */ + /* Build a mapping between this decl and the per-function options in + effect at this point. */ + + record_func_cl_pf_opts_mapping (current_function_decl); + /* APPLE LOCAL end optimization pragmas 3124235/3420242 (C++ ch) */ + + push_scope (); + declare_parm_level (); + + if (add_result_decl) + { + tree restype = TREE_TYPE (TREE_TYPE (current_function_decl)); + tree resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (current_function_decl) = resdecl; + } + start_fname_decls (); +} + +/** + declare_block_prologue_local_vars - utility routine to do the actual + declaration and initialization for each referecned block variable. +*/ +static void +declare_block_prologue_local_vars (tree self_parm, tree component, + tree stmt) +{ + tree decl, block_component; + tree_stmt_iterator i; + tree decl_stmt; + + decl = component; + block_component = build_component_ref (build_indirect_ref (self_parm, "->"), + DECL_NAME (component)); + gcc_assert (block_component); + DECL_EXTERNAL (decl) = 0; + TREE_STATIC (decl) = 0; + TREE_USED (decl) = 1; + DECL_CONTEXT (decl) = current_function_decl; + DECL_ARTIFICIAL (decl) = 1; + DECL_INITIAL (decl) = block_component; + /* Prepend a DECL_EXPR statement to the statement list. */ + i = tsi_start (stmt); + decl_stmt = build_stmt (DECL_EXPR, decl); + /* APPLE LOCAL Radar 5811961, Fix location of block prologue vars (C++ ch) */ + SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl)); + tsi_link_before (&i, decl_stmt, TSI_SAME_STMT); +} + +/** + block_build_prologue + - This routine builds the declarations for the + variables referenced in the block; as in: + int *y = _self->y; + int x = _self->x; + + The decl_expr declaration for each initialization is enterred at the + beginning of the helper function's statement-list which is passed + in block_impl->block_body. +*/ +void +block_build_prologue (struct block_sema_info *block_impl) +{ + tree chain; + tree self_parm = lookup_name (get_identifier ("_self")); + gcc_assert (self_parm); + + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain), + block_impl->block_body); + + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain), + block_impl->block_body); +} +/* APPLE LOCAL end radar 5732232 - blocks (C++ ch) */ + /* Return a pointer to a structure for an empty list of declaration specifiers. */ Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-parser.c Tue Jul 29 23:41:34 2008 @@ -1131,6 +1131,10 @@ static void c_parser_do_statement (c_parser *); static void c_parser_for_statement (c_parser *); static tree c_parser_asm_statement (c_parser *); +/* APPLE LOCAL begin radar 5732232 - blocks (C++ ca) */ +static tree c_parser_block_literal_expr (c_parser *); +static bool c_parser_block_byref_declarations (c_parser *); +/* APPLE LOCAL end radar 5732232 - blocks (C++ ca) */ static tree c_parser_asm_operands (c_parser *, bool); static tree c_parser_asm_clobbers (c_parser *); static struct c_expr c_parser_expr_no_commas (c_parser *, struct c_expr *); @@ -2515,6 +2519,20 @@ else return make_pointer_declarator (quals_attrs, inner); } + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cc) */ + else if (flag_blocks && c_parser_next_token_is (parser, CPP_XOR)) { + struct c_declspecs *quals_attrs = build_null_declspecs (); + struct c_declarator *inner; + c_parser_consume_token (parser); + c_parser_declspecs (parser, quals_attrs, false, false, true); + inner = c_parser_declarator (parser, type_seen_p, kind, seen_id); + if (inner == NULL) + return NULL; + else + /* APPLE LOCAL radar 5814025 (C++ cc) */ + return make_block_pointer_declarator (quals_attrs, inner); + } + /* APPLE LOCAL end radar 5732232 - blocks (C++ cc) */ /* Now we have a direct declarator, direct abstract declarator or nothing (which counts as a direct abstract declarator here). */ return c_parser_direct_declarator (parser, type_seen_p, kind, seen_id); @@ -3622,6 +3640,8 @@ { bool last_stmt = false; bool last_label = false; + /* APPLE LOCAL radar 5732232 - blocks (not in C++) */ + bool first_stmt = true; if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) { c_parser_consume_token (parser); @@ -3736,6 +3756,14 @@ else goto statement; } + /* APPLE LOCAL begin radar 5732232 - blocks (not in C++) */ + else if (flag_blocks && first_stmt && + c_parser_next_token_is (parser, CPP_OR) && + c_parser_block_byref_declarations (parser)) + { + ; + } + /* APPLE LOCAL end radar 5732232 - blocks (not in C++) */ else if (c_parser_next_token_is (parser, CPP_PRAGMA)) { /* External pragmas, and some omp pragmas, are not associated @@ -3767,6 +3795,8 @@ if (flag_iasm_blocks) iasm_in_decl = false; /* APPLE LOCAL end CW asm blocks (in 4.2 al) */ parser->error = false; + /* APPLE LOCAL radar 5732232 - blocks (not in C++) */ + first_stmt = false; } /* APPLE LOCAL begin CW asm blocks (in 4.2 am) */ if (flag_iasm_blocks) @@ -3986,6 +4016,10 @@ c_parser_for_statement (parser); break; case RID_GOTO: + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cb) */ + if (cur_block) + error ("goto not allowed in block literal"); + /* APPLE LOCAL end radar 5732232 - blocks (C++ cb) */ c_parser_consume_token (parser); if (c_parser_next_token_is (parser, CPP_NAME)) { @@ -4517,18 +4551,18 @@ { c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, NULL); c_parser_error (parser, "asm blocks not enabled, use `-fasm-blocks'"); - iasm_state = iasm_none; + iasm_state = iasm_none; } return NULL_TREE; } if (quals == NULL_TREE && (c_parser_next_token_is (parser, CPP_DOT) - || c_parser_next_token_is (parser, CPP_ATSIGN) - || c_parser_next_token_is (parser, CPP_NAME) - || c_parser_next_token_is_keyword (parser, RID_ASM) - || c_parser_next_token_is (parser, CPP_SEMICOLON) - || (c_parser_iasm_bol (parser) - && ! c_parser_next_token_is (parser, CPP_OPEN_PAREN)))) + || c_parser_next_token_is (parser, CPP_ATSIGN) + || c_parser_next_token_is (parser, CPP_NAME) + || c_parser_next_token_is_keyword (parser, RID_ASM) + || c_parser_next_token_is (parser, CPP_SEMICOLON) + || (c_parser_iasm_bol (parser) + && ! c_parser_next_token_is (parser, CPP_OPEN_PAREN)))) { if (flag_iasm_blocks) c_parser_iasm_top_statement (parser); @@ -5529,6 +5563,35 @@ expr.value = build_external_ref (id, (c_parser_peek_token (parser)->type == CPP_OPEN_PAREN), loc); + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cd) */ + /* If a variabled declared as referenced variable, using |...| syntax, + is used in the block, it has to be derefrenced because this + variable holds address of the outside variable referenced in. */ + + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ cd) */ + if (TREE_CODE (expr.value) == VAR_DECL + && !building_block_byref_decl) + { + if (BLOCK_DECL_BYREF (expr.value)) + { + tree orig_decl = expr.value; + expr.value = build_indirect_ref (expr.value, "unary *"); + if (COPYABLE_BYREF_LOCAL_VAR (orig_decl)) { + /* What we have is an expression which is of type + struct __Block_byref_X. Must get to the value of the variable + embedded in this structure. It is at: + __Block_byref_X.forwarding->x */ + expr.value = build_byref_local_var_access (expr.value, + DECL_NAME (orig_decl)); + } + } + else if (COPYABLE_BYREF_LOCAL_VAR (expr.value)) + expr.value = build_byref_local_var_access (expr.value, + DECL_NAME (expr.value)); + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + + /* APPLE LOCAL end radar 5732232 - blocks (C++ cd) */ expr.original_code = ERROR_MARK; } break; @@ -5864,6 +5927,18 @@ break; } break; + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cf) */ + case CPP_XOR: + if (flag_blocks) { + expr.value = c_parser_block_literal_expr (parser); + expr.original_code = ERROR_MARK; + break; + } + c_parser_error (parser, "expected expression"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + /* APPLE LOCAL end radar 5732232 - blocks (C++ cf) */ case CPP_OPEN_SQUARE: /* APPLE LOCAL begin CW asm blocks */ if (inside_iasm_block) @@ -9294,5 +9369,798 @@ c_parser_iasm_maybe_skip_comments (parser); } /* APPLE LOCAL end CW asm blocks */ +/* APPLE LOCAL begin radar 5732232 - blocks (C++ ce) */ +static tree block_copy_assign_decl; +static tree block_destroy_decl; +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ +static tree block_byref_assign_copy_decl; +/* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ + +/* APPLE LOCAL begin radar 6083129 - byref escapes (C++ ce) */ +void +gen_block_byref_release_exp (tree var_decl) +{ + tree cleanup = build_block_byref_release_exp (var_decl); + if (cleanup) + add_stmt (cleanup); +} +/* APPLE LOCAL end radar 6083129 - byref escapes (C++ ce) */ + +bool building_block_byref_decl = false; +static bool +c_parser_block_byref_declarations (c_parser* parser) +{ + if (!in_imm_block ()) + return false; + warning (0, "| x | has been deprecated in blocks"); + do { + struct c_expr byref_decl_expr; + c_parser_consume_token (parser); /* consume '|' or ',' */ + if (!c_parser_next_token_is (parser, CPP_NAME)) + { + error ("expected identifier in block by-reference variable list"); + return false; + } + building_block_byref_decl = true; + byref_decl_expr = c_parser_cast_expression (parser, NULL); + building_block_byref_decl = false; + if (byref_decl_expr.value != error_mark_node && + !(TREE_CODE (byref_decl_expr.value) == VAR_DECL && + /* APPLE LOCAL begin radar 5803600 (C++ ce) */ + (BLOCK_DECL_BYREF (byref_decl_expr.value) || + in_block_global_byref_list (byref_decl_expr.value)))) + /* APPLE LOCAL end radar 5803600 (C++ ce) */ + error ( + "only a visible variable may be used in a block byref declaration"); + } while (c_parser_next_token_is (parser, CPP_COMMA)); + + if (!c_parser_next_token_is (parser, CPP_OR)) + { + error ("expected identifier or '|' at end of block by-reference variable list"); + return false; + } + c_parser_consume_token (parser); /* consume '|' */ + return true; +} + +/** build_block_struct_type - + struct block_1 { + struct invok_impl impl; + void *CopyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + void *DestroyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + int x; // ref variable list ... + int *y; // byref variable list + }; + */ +static tree +build_block_struct_type (struct block_sema_info * block_impl) +{ + tree field_decl_chain, field_decl, chain; + char buffer[32]; + static int unique_count; + tree block_struct_type; + /* build struct invok_impl */ + if (!invoke_impl_ptr_type) + build_block_internal_types (); + + /* Check and see if this block is required to have a Copy/Dispose + helper function. If yes, set BlockHasCopyDispose to TRUE. */ + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + block_impl->BlockHasCopyDispose = TRUE; + break; + } + + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ + /* Further check to see that we have __block variables which require + Copy/Dispose helpers. */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + block_impl->BlockHasCopyDispose = TRUE; + block_impl->BlockHasByrefVar = TRUE; + break; + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ + + sprintf(buffer, "__block_%d", ++unique_count); + push_to_top_level (); + block_struct_type = start_struct (RECORD_TYPE, get_identifier (buffer)); + /* struct invok_impl impl; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("impl"), + TREE_TYPE (invoke_impl_ptr_type)); + field_decl_chain = field_decl; + /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ + if (block_impl->BlockHasCopyDispose) + { + /* void *CopyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), + ptr_type_node); + chainon (field_decl_chain, field_decl); + /* void *DestroyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), + ptr_type_node); + chainon (field_decl_chain, field_decl); + /* APPLE LOCAL begin radar 5988451 (C++ ce) */ + /* If inner block of a nested block has BlockHasCopyDispose, so + does its outer block. */ + if (block_impl->prev_block_info) + block_impl->prev_block_info->BlockHasCopyDispose = TRUE; + /* APPLE LOCAL end radar 5988451 (C++ ce) */ + } + + /* int x; // ref variable list ... */ + for (chain = block_impl->block_ref_decl_list; chain; chain = TREE_CHAIN (chain)) + { + tree p = TREE_VALUE (chain); + /* Note! const-ness of copied in variable must not be carried over to the + type of the synthesized struct field. It prevents to assign to this + field when copy constructor is synthesized. */ + field_decl = build_decl (FIELD_DECL, DECL_NAME (p), + c_build_qualified_type (TREE_TYPE (p), + TYPE_UNQUALIFIED)); + chainon (field_decl_chain, field_decl); + } + + /* int *y; // byref variable list */ + for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) + { + tree p = TREE_VALUE (chain); + field_decl = build_decl (FIELD_DECL, DECL_NAME (p), + TREE_TYPE (p)); + chainon (field_decl_chain, field_decl); + } + pop_from_top_level (); + finish_struct (block_struct_type, field_decl_chain, NULL_TREE); + return block_struct_type; +} + +/** + build_block_struct_initlist - builds the initializer list: + { &_NSConcreteStackBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + sizeof(struct block_1), + helper_1 }, + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + x, + &y + } +*/ +static tree +build_block_struct_initlist (tree block_struct_type, + struct block_sema_info *block_impl) +{ + tree initlist; + int size; + tree helper_addr, chain, fields; + unsigned flags = 0; + /* APPLE LOCAL radar 5811599 (C++ ce) */ + static tree NSConcreteStackBlock_decl = NULL_TREE; + + /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ + if (block_impl->BlockHasCopyDispose) + /* Note! setting of this flag merely indicates to the runtime that + we have destroy_helper_block/copy_helper_block helper + routines. */ + flags |= BLOCK_HAS_COPY_DISPOSE; + /* Set BLOCK_NO_COPY flag only if we are using the old byref, + indirect reference byref variables. */ + if (block_impl->block_byref_decl_list && !block_impl->BlockHasByrefVar) + flags |= BLOCK_NO_COPY; + + fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type)); + + /* APPLE LOCAL begin radar 5811599 (C++ ce) */ + /* Find an existing declaration for _NSConcreteStackBlock or declare + extern void *_NSConcreteStackBlock; */ + if (NSConcreteStackBlock_decl == NULL_TREE) + { + tree name_id = get_identifier("_NSConcreteStackBlock"); + NSConcreteStackBlock_decl = lookup_name (name_id); + if (!NSConcreteStackBlock_decl) + { + NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; + TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; + pushdecl_top_level (NSConcreteStackBlock_decl); + rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); + } + } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteStackBlock_decl)); + /* APPLE LOCAL end radar 5811599 (C++ ce) */ + fields = TREE_CHAIN (fields); + + initlist = tree_cons (fields, + build_int_cst (unsigned_type_node, flags), + initlist); + fields = TREE_CHAIN (fields); + size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); + initlist = tree_cons (fields, + build_int_cst (unsigned_type_node, size), + initlist); + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + gcc_assert (invoke_impl_ptr_type); + initlist = build_constructor_from_list (TREE_TYPE (invoke_impl_ptr_type), + nreverse (initlist)); + fields = TYPE_FIELDS (block_struct_type); + initlist = build_tree_list (fields, initlist); + /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ + if (block_impl->BlockHasCopyDispose) + { + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + } + for (chain = block_impl->block_original_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + { + /* APPLE LOCAL begin radar 5834569 (C++ ce) */ + tree y = TREE_VALUE (chain); + TREE_USED (y) = 1; + fields = TREE_CHAIN (fields); + initlist = tree_cons (fields, copy_in_object (y), initlist); + /* APPLE LOCAL end radar 5834569 (C++ ce) */ + } + for (chain = block_impl->block_original_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + { + tree y = TREE_VALUE (chain); + /* APPLE LOCAL radar 5834569 (C++ ce) */ + TREE_USED (y) = 1; + fields = TREE_CHAIN (fields); + y = build_fold_addr_expr (y); + initlist = tree_cons (fields, y, initlist); + } + return initlist; +} + +/** + build_block_literal_tmp - This routine: + + 1) builds block type: + struct block_1 { + struct invok_impl impl; + void *CopyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + int x; // ref variable list ... + int *y; // byref variable list + }; + + 2) build function prototype: + double helper_1(struct block_1 *ii, int z); + + 3) build the temporary initialization: + struct block_1 I = { + { &_NSConcreteStackBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + sizeof(struct block_1), + helper_1 }, + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + x, + &y +}; + +It return the temporary. +*/ + +static tree +build_block_literal_tmp (const char *name, + struct block_sema_info * block_impl) +{ + extern tree create_tmp_var_raw (tree, const char *); + tree block_holder_tmp_decl; + tree constructor, initlist; + tree exp, bind; + tree block_struct_type = TREE_TYPE (block_impl->block_arg_ptr_type); + + + block_holder_tmp_decl = create_tmp_var_raw (block_struct_type, name); + /* Context will not be known until when the literal is synthesized. + This is more so in the case of nested block literal blocks. */ + DECL_CONTEXT (block_holder_tmp_decl) = current_function_decl; + DECL_ARTIFICIAL (block_holder_tmp_decl) = 1; + + initlist = build_block_struct_initlist (block_struct_type, + block_impl); + initlist = nreverse (initlist); + constructor = build_constructor_from_list (block_struct_type, + initlist); + TREE_CONSTANT (constructor) = 1; + TREE_STATIC (constructor) = 1; + TREE_READONLY (constructor) = 1; + DECL_INITIAL (block_holder_tmp_decl) = constructor; + exp = build_stmt (DECL_EXPR, block_holder_tmp_decl); + bind = build3 (BIND_EXPR, void_type_node, block_holder_tmp_decl, exp, NULL); + TREE_SIDE_EFFECTS (bind) = 1; + add_stmt (bind); + return block_holder_tmp_decl; +} + +static tree +clean_and_exit (tree block) +{ + pop_function_context (); + free (finish_block (block)); + return error_mark_node; +} + +/** synth_copy_helper_block_func - This function synthesizes + void copy_helper_block (struct block* _dest, struct block *_src) function. +*/ + +static void +synth_copy_helper_block_func (struct block_sema_info * block_impl) +{ + tree stmt, chain, fnbody; + tree dst_arg, src_arg; + struct c_arg_info * arg_info; + /* Set up: (struct block* _dest, struct block *_src) parameters. */ + dst_arg = build_decl (PARM_DECL, get_identifier ("_dst"), + block_impl->block_arg_ptr_type); + DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + TREE_USED (dst_arg) = 1; + DECL_ARG_TYPE (dst_arg) = block_impl->block_arg_ptr_type; + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + block_impl->block_arg_ptr_type); + DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; + arg_info = xcalloc (1, sizeof (struct c_arg_info)); + TREE_CHAIN (dst_arg) = src_arg; + arg_info->parms = dst_arg; + arg_info->types = tree_cons (NULL_TREE, block_impl->block_arg_ptr_type, + tree_cons (NULL_TREE, + block_impl->block_arg_ptr_type, + NULL_TREE)); + /* function header synthesis. */ + push_function_context (); + start_block_helper_function (cur_block->copy_helper_func_decl, true); + store_parm_decls_from (arg_info); + + /* Body of the function. */ + stmt = c_begin_compound_stmt (true); + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + tree p = TREE_VALUE (chain); + tree dst_block_component, src_block_component; + dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), + DECL_NAME (p)); + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) + { + tree func_params, call_exp; + /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure) */ + /* Build a: void _Block_copy_assign (void *, void *) if not done + already. */ + if (!block_copy_assign_decl) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + + block_copy_assign_decl = builtin_function ("_Block_copy_assign", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_copy_assign_decl) = 0; + } + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + NULL_TREE)); + call_exp = build_function_call (block_copy_assign_decl, func_params); + add_stmt (call_exp); + } + else + { + /* _dest-> imported_object_x = [_src->imported_object_x retain] */ + tree rhs, store; + /* [_src->imported_object_x retain] */ + rhs = retain_block_component (src_block_component); + store = build_modify_expr (dst_block_component, NOP_EXPR, rhs); + add_stmt (store); + } + } + + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ + /* For each __block declared variable used in |...| Must generate call to: + _Block_byref_assign_copy(&_dest->myImportedBlock, _src->myImportedBlock) + */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + tree func_params, call_exp; + tree p = TREE_VALUE (chain); + tree dst_block_component, src_block_component; + dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), + DECL_NAME (p)); + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + /* _Block_byref_assign_copy(&_dest->myImportedClosure, _src->myImportedClosure) */ + /* Build a: void _Block_byref_assign_copy (void *, void *) if + not done already. */ + if (!block_byref_assign_copy_decl + && !(block_byref_assign_copy_decl + = lookup_name (get_identifier ("_Block_byref_assign_copy")))) + { + tree func_type + = build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + + block_byref_assign_copy_decl + = builtin_function ("_Block_byref_assign_copy", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_byref_assign_copy_decl) = 0; + } + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + NULL_TREE)); + call_exp = build_function_call (block_byref_assign_copy_decl, func_params); + add_stmt (call_exp); + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ + + fnbody = c_end_compound_stmt (stmt, true); + add_stmt (fnbody); + finish_function (); + pop_function_context (); + free (arg_info); +} + +static void +synth_destroy_helper_block_func (struct block_sema_info * block_impl) +{ + tree stmt, chain, fnbody; + tree src_arg; + struct c_arg_info * arg_info; + /* Set up: (struct block *_src) parameter. */ + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + block_impl->block_arg_ptr_type); + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; + arg_info = xcalloc (1, sizeof (struct c_arg_info)); + arg_info->parms = src_arg; + arg_info->types = tree_cons (NULL_TREE, block_impl->block_arg_ptr_type, + NULL_TREE); + + /* function header synthesis. */ + push_function_context (); + start_block_helper_function (cur_block->destroy_helper_func_decl, true); + store_parm_decls_from (arg_info); + + /* Body of the function. */ + stmt = c_begin_compound_stmt (true); + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + tree p = TREE_VALUE (chain); + tree src_block_component; + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) + { + tree func_params, call_exp; + /* _Block_destroy(_src->myImportedClosure); */ + /* _Block_destroy (void *); */ + /* Build a: void _Block_destroy (void *) if not done already. */ + /* APPLE LOCAL begin radar 5992047 (C++ ce) */ + if (!block_destroy_decl && + !(block_destroy_decl = lookup_name (get_identifier ("_Block_destroy")))) + /* APPLE LOCAL end radar 5992047 (C++ ce) */ + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + + block_destroy_decl = builtin_function ("_Block_destroy", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_destroy_decl) = 0; + } + func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + call_exp = build_function_call (block_destroy_decl, func_params); + add_stmt (call_exp); + } + else + { + tree rel_exp; + /* [_src->imported_object_0 release]; */ + rel_exp = release_block_component (src_block_component); + add_stmt (rel_exp); + } + } + + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ + /* For each __block declared variable used in |...| Must generate call to: + _Block_byref_release(_src->myImportedClosure) + */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + tree func_params, call_exp; + tree p = TREE_VALUE (chain); + tree src_block_component; + + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + /* _Block_byref_release(_src->myImportedClosure) */ + /* Build a: void _Block_byref_release (void *) if not done + already. */ + func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + call_exp = build_function_call (build_block_byref_release_decl (), func_params); + add_stmt (call_exp); + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ + + fnbody = c_end_compound_stmt (stmt, true); + add_stmt (fnbody); + finish_function (); + pop_function_context (); + free (arg_info); +} + +/** c_parser_block_literal_expr - Main routine to process a block literal + with the syntax of ^arg-list[OPT] block or ^()expression. It synthesizes + the helper function for later generation and builds the necessary data to + represent the block literal where it is declared. +*/ +static tree +c_parser_block_literal_expr (c_parser* parser) +{ + char name [32]; + static int global_unique_count; + int unique_count = ++global_unique_count; + tree block_helper_function_decl; + tree expr, body, type, arglist, ftype; + tree self_arg, stmt; + struct c_arg_info *args = NULL; + tree arg_type = void_list_node; + struct block_sema_info *block_impl; + tree tmp; + bool open_paren_seen = false; + tree restype, resdecl; + tree fnbody, typelist; + tree helper_function_type; + /* APPLE LOCAL radar 5824092 (C++ ce) */ + bool at_file_scope = global_bindings_p (); + tree block; + + c_parser_consume_token (parser); /* eat '^' */ + + /* Parse the optional argument list */ + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + c_parser_consume_token (parser); + /* Open the scope to collect parameter decls */ + push_scope (); + args = c_parser_parms_declarator (parser, true, NULL_TREE); + /* Check for args as it might be NULL due to error. */ + if (args) { + arglist = args->parms; + arg_type = args->types; + } + else + { + pop_scope (); + return error_mark_node; + } + open_paren_seen = true; + pop_scope (); + } + else + arglist = build_tree_list (NULL_TREE, void_type_node); + + block = begin_block (); + + cur_block->arg_info = NULL; + cur_block->return_type = NULL_TREE; + + if (args) + { + tree list = NULL_TREE; + cur_block->arg_info = args; + if (arg_type) + { + cur_block->hasPrototype = true; + /* This is the only way in gcc to know if argument list ends with ... */ + for (list = arg_type; TREE_CHAIN (list); list = TREE_CHAIN (list)) + ; + cur_block->isVariadic = (list != void_list_node); + } + else + { + /* K&R syle () argument list. */ + cur_block->hasPrototype = false; + cur_block->isVariadic = true; + } + } + else + { + cur_block->hasPrototype = false; + cur_block->isVariadic = false; + cur_block->arg_info = xcalloc (1, sizeof (struct c_arg_info)); + } + + /* Must also build hidden parameter _self added to the helper + function, even though we do not know its type yet. */ + self_arg = build_decl (PARM_DECL, get_identifier ("_self"), + ptr_type_node); + /* APPLE LOCAL radar 5925784 (C++ ce) */ + TREE_USED (self_arg) = 1; /* Prevent unused parameter '_self' warning. */ + TREE_CHAIN (self_arg) = cur_block->arg_info->parms; + cur_block->arg_info->types = tree_cons (NULL_TREE, ptr_type_node, arg_type); + cur_block->arg_info->parms = self_arg; + + /* Build the declaration of the helper function (we do not know its result + type yet, so assume it is 'void'). Treat this as a nested function and use + nested function infrastructure for its generation. */ + sprintf (name, "__helper_%d", unique_count); + + ftype = build_function_type (void_type_node, cur_block->arg_info->types); + block_helper_function_decl = build_helper_func_decl (get_identifier (name), + ftype); + DECL_CONTEXT (block_helper_function_decl) = current_function_decl; + BLOCK_HELPER_FUNC (block_helper_function_decl) = 1; + cur_block->helper_func_decl = block_helper_function_decl; + + push_function_context (); + start_block_helper_function (cur_block->helper_func_decl, false); + /* APPLE LOCAL begin radar 5988451 (C++ ce) */ + /* Set block's scope to the scope of the helper function's main body. + This is primarily used when nested blocks are declared. */ + /* FIXME: Name of objc_get_current_scope needs to get changed. */ + cur_block->the_scope = (struct c_scope*)objc_get_current_scope (); + /* APPLE LOCAL end radar 5988451 (C++ ce) */ + + /* Enter parameter list to the scope of the helper function. */ + store_parm_decls_from (cur_block->arg_info); + + /* Start parsing body or expression part of the block literal. */ + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) { + tree save_c_break_label = c_break_label; + tree save_c_cont_label = c_cont_label; + /* Indicate no valid break/continue context by setting these variables + to some non-null, non-label value. We'll notice and emit the proper + error message in c_finish_bc_stmt. */ + c_break_label = c_cont_label = size_zero_node; + c_parser_consume_token (parser); /* Consure '{'. */ + stmt = c_begin_compound_stmt (true); + c_parser_compound_statement_nostart (parser); + c_cont_label = save_c_cont_label; + c_break_label = save_c_break_label; + } + else { + struct c_expr expr; + stmt = c_begin_compound_stmt (true); + /* APPLE LOCAL radar 6034839 */ + error ("blocks require { }"); + expr = c_parser_cast_expression (parser, NULL); + body = expr.value; + if (body == error_mark_node) + return clean_and_exit (block); + + if (cur_block->return_type) { + error ("return not allowed in block expression literal"); + return clean_and_exit (block); + } + else if (!open_paren_seen) { + error ("argument list is required for block expression literals"); + return clean_and_exit (block); + } + else { + add_stmt (body); + cur_block->return_type = TREE_TYPE (body); + } + } + + cur_block->block_arg_ptr_type = + build_pointer_type (build_block_struct_type (cur_block)); + + restype = !cur_block->return_type ? void_type_node + : cur_block->return_type; + /* APPLE LOCAL begin radar 5824092 (C++ ce) */ + if (at_file_scope) + { + error ("block literal cannot be declared at global scope"); + return clean_and_exit (block); + } + /* APPLE LOCAL end radar 5824092 (C++ ce) */ + if (restype == error_mark_node) + return clean_and_exit (block); + + /* Now that we know type of the hidden _self argument, fix its type. */ + TREE_TYPE (self_arg) = cur_block->block_arg_ptr_type; + DECL_ARG_TYPE (self_arg) = cur_block->block_arg_ptr_type; + + /* Now that we know helper's result type, fix its result variable decl. */ + resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (current_function_decl) = resdecl; + + cur_block->block_body = stmt; + block_build_prologue (cur_block); + + fnbody = c_end_compound_stmt (stmt, true); + add_stmt (fnbody); + finish_function (); + pop_function_context (); + + /* Build the declaration for copy_helper_block and destroy_helper_block + helper functions for later use. */ + + /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ + if (cur_block->BlockHasCopyDispose) + { + /* void copy_helper_block (struct block*, struct block *); */ + tree s_ftype = build_function_type (void_type_node, + tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + tree_cons (NULL_TREE, + cur_block->block_arg_ptr_type, + void_list_node))); + sprintf (name, "__copy_helper_block_%d", unique_count); + cur_block->copy_helper_func_decl = + build_helper_func_decl (get_identifier (name), s_ftype); + synth_copy_helper_block_func (cur_block); + + /* void destroy_helper_block (struct block*); */ + s_ftype = build_function_type (void_type_node, + tree_cons (NULL_TREE, + cur_block->block_arg_ptr_type, void_list_node)); + sprintf (name, "__destroy_helper_block_%d", unique_count); + cur_block->destroy_helper_func_decl = + build_helper_func_decl (get_identifier (name), s_ftype); + synth_destroy_helper_block_func (cur_block); + } + + + /* We are out of helper function scope and back in its enclosing scope. + We also know all we need to know about the helper function. So, fix its + type here. */ + ftype = build_function_type (restype, arg_type); + /* Declare helper function; as in: + double helper_1(struct block_1 *ii, int z); */ + typelist = TYPE_ARG_TYPES (ftype); + /* (struct block_1 *ii, int z, ...) */ + typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + typelist); + helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); + TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; + + block_impl = finish_block (block); + + /* Build unqiue name of the temporary used in code gen. */ + sprintf (name, "__block_holder_tmp_%d", unique_count); + tmp = build_block_literal_tmp (name, block_impl); + tmp = build_fold_addr_expr (tmp); + type = build_block_pointer_type (ftype); + expr = convert (type, convert (ptr_type_node, tmp)); + free (block_impl); + return expr; +} +/* APPLE LOCAL end radar 5732232 - blocks (C++ ce) */ #include "gt-c-parser.h" Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Tue Jul 29 23:41:34 2008 @@ -75,6 +75,13 @@ static int require_constant_value; static int require_constant_elements; +/* APPLE LOCAL begin radar 5732232 - blocks */ +/* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ +/* Move declaration of invoke_impl_ptr_type to c-common.c */ +/* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ +static bool types_are_block_compatible (tree lhptee, tree rhptee); +static tree build_block_call (tree, tree, tree); +/* APPLE LOCAL end radar 5732232 - blocks */ static bool null_pointer_constant_p (tree); static tree qualify_type (tree, tree); static int tagged_types_tu_compatible_p (tree, tree); @@ -2136,9 +2143,54 @@ /* In Objective-C, an instance variable (ivar) may be preferred to whatever lookup_name() found. */ decl = objc_lookup_ivar (decl, id); - + /* APPLE LOCAL begin radar 5732232 - blocks (C++ ci) */ if (decl && decl != error_mark_node) - ref = decl; + { + if (cur_block + && (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL) + && !lookup_name_in_block (id, &decl)) + { + /* APPLE LOCAL begin radar 5803005 (C++ ci) */ + bool gdecl; + /* We are referencing a variable inside a block whose declaration + is outside. */ + gcc_assert (decl && + (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL)); + gdecl = (TREE_CODE (decl) == VAR_DECL && + (DECL_EXTERNAL (decl) + || (TREE_STATIC (decl) && !DECL_CONTEXT (decl)))); + /* Treat all 'global' variables as 'byref' by default. */ + /* APPLE LOCAL begin radar 6014138 */ + if (building_block_byref_decl || gdecl + || (TREE_CODE (decl) == VAR_DECL + && COPYABLE_BYREF_LOCAL_VAR (decl))) + /* APPLE LOCAL end radar 6014138 */ + { + /* APPLE LOCAL begin radar 5803600 (C++ ci) */ + /* byref globals are directly accessed. */ + if (!gdecl) + /* build a decl for the byref variable. */ + decl = build_block_byref_decl (id, decl, decl); + else + add_block_global_byref_list (decl); + } + else + { + /* 'byref' globals are never copied-in. So, do not add + them to the copied-in list. */ + if (!in_block_global_byref_list (decl)) + /* build a new decl node. set its type to 'const' type + of the old decl. */ + decl = build_block_ref_decl (id, decl); + /* APPLE LOCAL end radar 5803600 (C++ ci) */ + /* APPLE LOCAL end radar 5803005 (C++ ci) */ + } + } + ref = decl; + } + /* APPLE LOCAL end radar 5732232 - blocks (C++ ci) */ else if (fun) /* Implicit function declaration. */ ref = implicitly_declare (id); @@ -2366,8 +2418,10 @@ if (TREE_CODE (fntype) == ERROR_MARK) return error_mark_node; - - if (!(TREE_CODE (fntype) == POINTER_TYPE + /* APPLE LOCAL begin radar 5732232 - blocks */ + if (!((TREE_CODE (fntype) == POINTER_TYPE + || TREE_CODE (fntype) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL end radar 5732232 - blocks */ && TREE_CODE (TREE_TYPE (fntype)) == FUNCTION_TYPE)) { error ("called object %qE is not a function", function); @@ -2434,6 +2488,11 @@ check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params, TYPE_ARG_TYPES (fntype)); + /* APPLE LOCAL begin radar 5732232 - blocks */ + if (TREE_CODE (TREE_TYPE (function)) == BLOCK_POINTER_TYPE) + result = build_block_call (fntype, function, coerced_params); + else + /* APPLE LOCAL end radar 5732232 - blocks */ if (require_constant_value) { result = fold_build3_initializer (CALL_EXPR, TREE_TYPE (fntype), @@ -2505,6 +2564,13 @@ if (type == void_type_node) { + /* APPLE LOCAL begin radar 5732232 - blocks */ + if (TREE_CODE (TREE_TYPE (function)) == BLOCK_POINTER_TYPE) + { + error ("too many arguments to block call"); + break; + } + /* APPLE LOCAL end radar 5732232 - blocks */ /* APPLE LOCAL begin radar 4491608 */ error ("too many arguments to function %qE", selector ? selector : function); @@ -2691,7 +2757,12 @@ if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) { - error ("too few arguments to function %qE", function); + /* APPLE LOCAL begin radar 5732232 - blocks */ + if (TREE_CODE (TREE_TYPE (function)) == BLOCK_POINTER_TYPE) + error ("too few arguments to block %qE", function); + else + error ("too few arguments to function %qE", function); + /* APPLE LOCAL end radar 5732232 - blocks */ return error_mark_node; } @@ -2868,12 +2939,14 @@ if ((code1 == STRING_CST && !integer_zerop (arg2.value)) || (code2 == STRING_CST && !integer_zerop (arg1.value))) warning (OPT_Waddress, - "comparison with string literal results in unspecified behaviour"); + /* APPLE LOCAL mainline 5808469 */ + "comparison with string literal results in unspecified behavior"); } else if (TREE_CODE_CLASS (code) == tcc_comparison && (code1 == STRING_CST || code2 == STRING_CST)) warning (OPT_Waddress, - "comparison with string literal results in unspecified behaviour"); + /* APPLE LOCAL mainline 5808469 */ + "comparison with string literal results in unspecified behavior"); overflow_warning (result.value); @@ -3069,6 +3142,8 @@ case TRUTH_NOT_EXPR: if (typecode != INTEGER_TYPE + /* APPLE LOCAL radar 5732232 - blocks */ + && typecode != BLOCK_POINTER_TYPE && typecode != REAL_TYPE && typecode != POINTER_TYPE && typecode != COMPLEX_TYPE) { @@ -3600,7 +3675,31 @@ } result_type = type2; } - + /* APPLE LOCAL begin radar 5732232 - blocks (C++ co) */ + /* APPLE LOCAL radar 5957801 */ + else if (code1 == BLOCK_POINTER_TYPE && (code2 == INTEGER_TYPE || code2 == POINTER_TYPE)) + { + if (!null_pointer_constant_p (orig_op2)) + error ("block pointer/integer type mismatch in conditional expression"); + else + { + op2 = convert (type1, null_pointer_node); + } + result_type = type1; + } + /* APPLE LOCAL radar 5957801 */ + else if (code2 == BLOCK_POINTER_TYPE && (code1 == INTEGER_TYPE || code1 == POINTER_TYPE)) + { + if (!null_pointer_constant_p (orig_op1)) + error ("block pointer/integer type mismatch in conditional expression"); + else + { + op1 = convert (type2, null_pointer_node); + } + result_type = type2; + } + + /* APPLE LOCAL end radar 5732232 - blocks (C++ co) */ if (!result_type) { if (flag_cond_mismatch) @@ -3755,6 +3854,12 @@ otype = TREE_TYPE (value); + /* APPLE LOCAL begin radar 5732232 - blocks */ + if (TREE_CODE (otype) == BLOCK_POINTER_TYPE && + TREE_CODE (type) == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (type))) + return build1 (NOP_EXPR, type, value); + /* APPLE LOCAL end radar 5732232 - blocks */ + /* Optionally warn about potentially worrisome casts. */ if (warn_cast_qual @@ -3892,6 +3997,88 @@ return value; } +/* APPLE LOCAL begin radar 5732232 - blocks (C++ cm) */ +static bool +functiontypes_are_block_compatible (tree f1, tree f2) +{ + tree arg1, arg2; + if (!types_are_block_compatible (TREE_TYPE (f1), TREE_TYPE (f2))) + return false; + arg1 = TYPE_ARG_TYPES (f1); + arg2 = TYPE_ARG_TYPES (f2); + while (arg1 && arg2) + { + tree a1, a2; + a1 = TREE_VALUE (arg1); + a2 = TREE_VALUE (arg2); + if (TREE_CODE (a1) == BLOCK_POINTER_TYPE + && TREE_CODE (a2) == BLOCK_POINTER_TYPE) + { + a1 = TREE_TYPE (a1); + a2 = TREE_TYPE (a2); + } + if (!types_are_block_compatible (a1, a2)) + return false; + arg1 = TREE_CHAIN (arg1); + arg2 = TREE_CHAIN (arg2); + } + return !arg1 && !arg2; +} + +static bool +types_are_block_compatible (tree lhptee, tree rhptee) +{ + if (TYPE_MAIN_VARIANT (lhptee) == TYPE_MAIN_VARIANT (rhptee)) + return true; + if (TREE_CODE (lhptee) == FUNCTION_TYPE && TREE_CODE (rhptee) == FUNCTION_TYPE) + return functiontypes_are_block_compatible (lhptee, rhptee); + /* APPLE LOCAL begin radar 5882266 */ + if (TREE_CODE (lhptee) == POINTER_TYPE && TREE_CODE (rhptee) == POINTER_TYPE) + return types_are_block_compatible (TREE_TYPE (lhptee), TREE_TYPE (rhptee)); + /* APPLE LOCAL end radar 5882266 */ + /* APPLE LOCAL begin radar 5988995 */ + if (TREE_CODE (lhptee) == BLOCK_POINTER_TYPE + && TREE_CODE (rhptee) == BLOCK_POINTER_TYPE) + return types_are_block_compatible (TREE_TYPE (lhptee), TREE_TYPE (rhptee)); + /* APPLE LOCAL end radar 5988995 */ + return false; +} + +/** + build_block_call - Routine to build a block call; as in: + ((double(*)(struct invok_impl *, int))(BLOCK_PTR_VAR->FuncPtr))(I, 42); + FNTYPE is the original function type derived from the syntax. + FUNCTION is the4 block pointer variable. + PARAMS is the parameter list. +*/ +static tree +build_block_call (tree fntype, tree function, tree params) +{ + tree block_ptr_exp; + tree function_ptr_exp; + tree typelist; + + /* (struct invok_impl *)BLOCK_PTR_VAR */ + /* First convert it to 'void *'. */ + block_ptr_exp = convert (ptr_type_node, function); + gcc_assert (invoke_impl_ptr_type); + block_ptr_exp = convert (invoke_impl_ptr_type, block_ptr_exp); + params = tree_cons (NULL_TREE, block_ptr_exp, params); + /* BLOCK_PTR_VAR->FuncPtr */ + function_ptr_exp = + build_component_ref (build_indirect_ref (block_ptr_exp, "->"), + get_identifier ("FuncPtr")); + + /* Build: result_type(*)(struct invok_impl *, function-arg-type-list) */ + typelist = TYPE_ARG_TYPES (fntype); + typelist = tree_cons (NULL_TREE, invoke_impl_ptr_type, typelist); + fntype = build_function_type (TREE_TYPE (fntype), typelist); + function_ptr_exp = convert (build_pointer_type (fntype), function_ptr_exp); + return fold_build3 (CALL_EXPR, TREE_TYPE (fntype), + function_ptr_exp, params, NULL_TREE); +} +/* APPLE LOCAL end radar 5732232 - blocks (C++ cm) */ + /* Interpret a cast of expression EXPR to type TYPE. */ tree c_cast_expr (struct c_type_name *type_name, tree expr) @@ -4494,6 +4681,43 @@ return convert (type, rhs); } + /* APPLE LOCAL begin radar 5732232 - blocks */ + else if (codel == BLOCK_POINTER_TYPE && coder == INTEGER_TYPE) + { + if (!null_pointer_constant_p (rhs)) + { + error("invalid conversion %s integer 'int', expected block pointer", + errtype == ic_assign ? "assigning" : "initializing"); + return error_mark_node; + } + return build_int_cst (type, 0); + } + else if (codel == BLOCK_POINTER_TYPE && coder == codel) + { + tree lhptee = TREE_TYPE (type); + tree rhptee = TREE_TYPE(rhstype); + if (lhptee == rhptee) + return rhs; + if (!types_are_block_compatible (lhptee, rhptee)) + { + error ("incompatible block pointer types %s %qT, expected %qT", + errtype == ic_assign ? "assigning" : "initializing", + rhstype, type); + return error_mark_node; + } + return rhs; + } + /* APPLE LOCAL begin radar 5831855 */ + /* APPLE LOCAL radar 5878380 */ + else if (codel == BLOCK_POINTER_TYPE && POINTER_TYPE_P (rhstype) && + (VOID_TYPE_P (TREE_TYPE (rhstype)) || objc_is_id (rhstype))) + return convert (type, rhs); + /* APPLE LOCAL radar 5878380 */ + else if (coder == BLOCK_POINTER_TYPE && POINTER_TYPE_P (type) && + (VOID_TYPE_P (TREE_TYPE (type)) || objc_is_id (type))) + /* APPLE LOCAL end radar 5831855 */ + return convert (type, rhs); + /* APPLE LOCAL end radar 5732232 - blocks */ else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) { WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes integer " @@ -4828,6 +5052,13 @@ pedwarn_init ("array initialized from parenthesized string constant"); } +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +tree do_digest_init (tree type, tree init) +{ + return digest_init (type, init, true, false); +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* Digest the parser output INIT as an initializer for type TYPE. Return a C expression of type TYPE to represent the initial value. @@ -5095,6 +5326,8 @@ /* Handle scalar types, including conversions. */ if (code == INTEGER_TYPE || code == REAL_TYPE || code == POINTER_TYPE + /* APPLE LOCAL radar 5732232 - blocks */ + || code == BLOCK_POINTER_TYPE || code == ENUMERAL_TYPE || code == BOOLEAN_TYPE || code == COMPLEX_TYPE || code == VECTOR_TYPE) { @@ -7275,7 +7508,8 @@ nlist->label = decl; label_context_stack_vm->labels_used = nlist; } - + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + diagnose_byref_var_in_current_scope (); TREE_USED (decl) = 1; return add_stmt (build1 (GOTO_EXPR, void_type_node, decl)); } @@ -7421,16 +7655,77 @@ return error_mark_node; } /* APPLE LOCAL end CW asm blocks */ - + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cm) */ +/** c_finish_block_return_stmt - Utilty routine to figure out block's return + type. +*/ +static tree +c_finish_block_return_stmt (tree retval) +{ + tree valtype; + /* If this is the first return we've seen in the block, infer the type of + the block from it. */ + if (cur_block->return_type == NULL_TREE) + { + if (retval) + cur_block->return_type = TYPE_MAIN_VARIANT (TREE_TYPE (retval)); + else + cur_block->return_type = void_type_node; + return retval; + } + + /* Otherwise, verify that this result type matches the previous one. We are + pickier with blocks than for normal functions because this is a new + feature and we set the rules. */ + if (TREE_CODE (cur_block->return_type) == VOID_TYPE) + { + if (retval) + { + error ("void block should not return a value"); + retval = NULL_TREE; + } + return retval; + } + + if (!retval) + { + error ("non-void block should return a value"); + return retval; + } + + /* We have a non-void block with an expression, continue checking. */ + valtype = TREE_TYPE (retval); + + /* For now, restrict multiple return statements in a block to have + strict compatible types only. */ + if (!types_are_block_compatible (cur_block->return_type, valtype)) + error ("incompatible type returning %qT, expected %qT", + valtype, cur_block->return_type); + return retval; +} +/* APPLE LOCAL end radar 5732232 - blocks (C++ cm) */ + /* Generate a C `return' statement. RETVAL is the expression for what to return, or a null pointer for `return;' with no value. */ tree c_finish_return (tree retval) { - tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)), ret_stmt; + /* APPLE LOCAL begin radar 5732232 - blocks */ + tree valtype, ret_stmt; bool no_warning = false; - + + if (cur_block) { + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + release_all_local_byrefs_at_return (); + retval = c_finish_block_return_stmt (retval); + ret_stmt = build_stmt (RETURN_EXPR, retval); + return add_stmt (ret_stmt); + } + + valtype = TREE_TYPE (TREE_TYPE (current_function_decl)); + /* APPLE LOCAL end radar 5732232 - blocks */ + if (TREE_THIS_VOLATILE (current_function_decl)) warning (0, "function declared % has a % statement"); @@ -7515,7 +7810,15 @@ && !DECL_EXTERNAL (inner) && !TREE_STATIC (inner) && DECL_CONTEXT (inner) == current_function_decl) - warning (0, "function returns address of local variable"); + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cn) */ + { + if (TREE_CODE (valtype) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL radar 6048570 */ + error ("returning block that lives on the local stack"); + else + warning (0, "function returns address of local variable"); + } + /* APPLE LOCAL end radar 5732232 - blocks (C++ cn) */ break; default: @@ -7527,7 +7830,14 @@ retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t); } - + /* APPLE LOCAL begin radar 5732232 - blocks */ + /* When this routine is called for the helper function, during gimplification, + we are only interested in the actual return expression. */ + if (current_function_decl && BLOCK_HELPER_FUNC (current_function_decl)) + return retval; + /* APPLE LOCAL end radar 5732232 - blocks */ + /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ + release_all_local_byrefs_at_return (); ret_stmt = build_stmt (RETURN_EXPR, retval); TREE_NO_WARNING (ret_stmt) |= no_warning; return add_stmt (ret_stmt); @@ -7873,6 +8183,11 @@ if (skip) return NULL_TREE; + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + /* Before breaking out or on continue, release all local __block + variables which go out of scope. */ + release_local_byrefs_at_break (); + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ return add_stmt (build1 (GOTO_EXPR, void_type_node, label)); } @@ -8581,6 +8896,32 @@ result_type = type1; pedwarn ("comparison between pointer and integer"); } + /* APPLE LOCAL begin radar 5732232 - blocks (C++ cl) */ + if (code0 == BLOCK_POINTER_TYPE && null_pointer_constant_p (orig_op1)) + result_type = type0; + else if (code1 == BLOCK_POINTER_TYPE + && null_pointer_constant_p (orig_op0)) + result_type = type1; + else if (code0 == BLOCK_POINTER_TYPE && code1 == BLOCK_POINTER_TYPE) + { + if (!types_are_block_compatible (TREE_TYPE(type0), TREE_TYPE(type1))) + error ("comparison of distinct block types (%qT and %qT)", + type0, type1); + result_type = type0; + } + else if (code0 == BLOCK_POINTER_TYPE && code1 == INTEGER_TYPE) + { + result_type = type0; + error ("comparison between pointer and integer (%qT and %qT)", + type0, type1); + } + else if (code0 == INTEGER_TYPE && code1 == BLOCK_POINTER_TYPE) + { + result_type = type1; + error ("comparison between integer and pointer (%qT and %qT)", + type0, type1); + } + /* APPLE LOCAL end radar 5732232 - blocks (C++ cl) */ break; case LE_EXPR: Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Tue Jul 29 23:41:34 2008 @@ -152,7 +152,9 @@ /* Target cpu type */ /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM const char *rs6000_cpu_target = "ppc"; +#endif /* LLVM LOCAL end */ enum processor_type rs6000_cpu; @@ -164,6 +166,10 @@ { (const char *)0, "-mtune=", 1, 0 }, }; +/* APPLE LOCAL begin 5774356 */ +static int debug_sp_offset = 0; +static int debug_vrsave_offset = 0; +/* APPLE LOCAL end 5774356 */ /* Always emit branch hint bits. */ static GTY(()) bool rs6000_always_hint; @@ -703,7 +709,6 @@ static int redefine_groups (FILE *, int, rtx, rtx); static int pad_groups (FILE *, int, rtx, rtx); static void rs6000_sched_finish (FILE *, int); - static int rs6000_use_sched_lookahead (void); /* LLVM LOCAL - Disable scheduler. */ #endif @@ -977,6 +982,7 @@ #define TARGET_SCHED_IS_COSTLY_DEPENDENCE rs6000_is_costly_dependence #undef TARGET_SCHED_FINISH #define TARGET_SCHED_FINISH rs6000_sched_finish + #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD rs6000_use_sched_lookahead /* LLVM LOCAL - Disable scheduler. */ @@ -1440,7 +1446,9 @@ rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM rs6000_cpu_target = TARGET_POWERPC64 ? "ppc64" : "ppc"; +#endif /* LLVM LOCAL end */ /* APPLE LOCAL begin -fast or -fastf or -fastcp */ @@ -1471,12 +1479,13 @@ target_flags &= ~set_masks; target_flags |= (processor_target_table[j].target_enable & set_masks); - /* APPLE LOCAL begin -fast */ + /* APPLE LOCAL begin -fast or -fastf or -fastcp */ mcpu_cpu = processor_target_table[j].processor; - /* APPLE LOCAL end -fast */ - + /* APPLE LOCAL end -fast or -fastf or -fastcp */ /* LLVM LOCAL begin */ - rs6000_cpu_target = processor_target_table[j].name; +#ifdef ENABLE_LLVM + rs6000_cpu_target = processor_target_table[j].name; +#endif /* LLVM LOCAL end */ } break; @@ -1507,11 +1516,10 @@ { flag_disable_opts_for_faltivec = 1; /* APPLE LOCAL radar 4161346 */ -/* LLVM LOCAL begin handle -mpim-altivec correctly */ target_flags |= MASK_ALTIVEC; } + /* APPLE LOCAL radar 5822514 */ target_flags |= MASK_PIM_ALTIVEC; -/* LLVM LOCAL begin handle -mpim-altivec correctly */ } /* APPLE LOCAL end AltiVec */ @@ -4899,6 +4907,7 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) { /* LLVM LOCAL begin struct return check */ +#ifdef ENABLE_LLVM /* FIXME darwin ppc64 often returns structs partly in memory and partly in regs. The binary interface of return_in_memory (which does the work for aggregate_value_p) is not a good match for this; in fact @@ -4910,6 +4919,7 @@ TREE_CODE(TYPE_SIZE_UNIT(type)) == INTEGER_CST && TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) > 8) return true; +#endif /* LLVM LOCAL end struct return check */ /* In the darwin64 abi, try to use registers for larger structs @@ -9340,7 +9350,11 @@ if (d->code == fcode) return rs6000_expand_ternop_builtin (d->icode, arglist, target); - gcc_unreachable (); + /* APPLE LOCAL begin 5774356 */ + /* It looks like a builtin call, but there is something wrong; + maybe the wrong number of arguments. Return failure. */ + return NULL_RTX; + /* APPLE LOCAL end 5774356 */ } static tree @@ -9409,7 +9423,6 @@ bool_V4SI_type_node = build_vector_type (bool_int_type_node, 4); pixel_V8HI_type_node = build_vector_type (pixel_type_node, 8); - /* APPLE LOCAL begin LLVM */ #ifdef ENABLE_LLVM /* LLVM doesn't initialize the RTL backend, so build_vector_type will assign @@ -17183,6 +17196,10 @@ { /* Save VRSAVE. */ offset = info->vrsave_save_offset + sp_offset; + /* APPLE LOCAL begin 5774356 */ + debug_vrsave_offset = offset; + debug_sp_offset = sp_offset; + /* APPLE LOCAL end 5774356 */ mem = gen_frame_mem (SImode, gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); @@ -17486,7 +17503,10 @@ /* APPLE LOCAL begin mainline */ /* Set sp_offset based on the stack push from the prologue. */ - if ((DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return) + /* APPLE LOCAL begin 5774356 */ + if (info->push_p + && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN || current_function_calls_eh_return) + /* APPLE LOCAL end 5664356 */ && info->total_size < 32767) sp_offset = info->total_size; @@ -17520,6 +17540,10 @@ { rtx addr, mem, reg; + /* APPLE LOCAL begin 5774356 */ + gcc_assert (debug_sp_offset == sp_offset); + gcc_assert (debug_vrsave_offset == (info->vrsave_save_offset + sp_offset)); + /* APPLE LOCAL end 5774356 */ addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (info->vrsave_save_offset + sp_offset)); mem = gen_frame_mem (SImode, addr); @@ -19064,9 +19088,9 @@ break; } } + /* LLVM LOCAL - Disable scheduler. */ #ifndef ENABLE_LLVM - /* Power4 load update and store update instructions are cracked into a load or store and an integer insn which are executed in the same cycle. @@ -19292,6 +19316,7 @@ INSN earlier, reduce the priority to execute INSN later. Do not define this macro if you do not need to adjust the scheduling priorities of insns. */ + static int rs6000_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority) { @@ -19394,7 +19419,6 @@ return 0; } - /* Determine is PAT refers to memory. */ static bool @@ -19981,6 +20005,7 @@ /* LLVM LOCAL - Disable scheduler. */ #endif ENABLE_LLVM + /* Length in units of the trampoline for entering a nested function. */ int Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/call.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/call.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/call.c Tue Jul 29 23:41:34 2008 @@ -281,7 +281,8 @@ function = build_addr_func (function); - gcc_assert (TYPE_PTR_P (TREE_TYPE (function))); + /* APPLE LOCAL blocks 6040305 */ + gcc_assert (TYPE_PTR_P (TREE_TYPE (function)) || TREE_CODE (TREE_TYPE (function)) == BLOCK_POINTER_TYPE); fntype = TREE_TYPE (TREE_TYPE (function)); gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE || TREE_CODE (fntype) == METHOD_TYPE); @@ -657,7 +658,8 @@ if (same_type_p (from, to)) return conv; - if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to)) + /* APPLE LOCAL blocks 6040305 (ck) */ + if ((tcode == POINTER_TYPE || tcode == BLOCK_POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to)) && expr && null_ptr_cst_p (expr)) conv = build_conv (ck_std, to, conv); else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE) @@ -675,6 +677,14 @@ conv = build_conv (ck_std, to, conv); conv->bad_p = true; } + /* APPLE LOCAL begin blocks (ck) */ + else if (tcode == POINTER_TYPE && fcode == BLOCK_POINTER_TYPE + && (objc_is_id (to) + || VOID_TYPE_P (TREE_TYPE (to)))) + { + conv = build_conv (ck_ptr, to, conv); + } + /* APPLE LOCAL end blocks (ck) */ else if ((tcode == POINTER_TYPE && fcode == POINTER_TYPE) || (TYPE_PTRMEM_P (to) && TYPE_PTRMEM_P (from))) { @@ -827,6 +837,8 @@ if (ARITHMETIC_TYPE_P (from) || fcode == ENUMERAL_TYPE || fcode == POINTER_TYPE + /* APPLE LOCAL blocks 6040305 (cl) */ + || fcode == BLOCK_POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (from)) { conv = build_conv (ck_std, to, conv); @@ -3543,10 +3555,20 @@ cv-qualification of either the second or the third operand. The result is of the common type. */ else if ((null_ptr_cst_p (arg2) - && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type))) + /* APPLE LOCAL begin blocks 6040305 (co) */ + && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type) + || TREE_CODE (arg3_type) == BLOCK_POINTER_TYPE)) + /* APPLE LOCAL end blocks 6040305 (co) */ || (null_ptr_cst_p (arg3) - && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type))) + /* APPLE LOCAL begin blocks 6040305 (co) */ + && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type) + || TREE_CODE (arg2_type) == BLOCK_POINTER_TYPE)) + /* APPLE LOCAL end blocks 6040305 (co) */ || (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type)) + /* APPLE LOCAL begin blocks 6040305 (co) */ + || (TREE_CODE (arg2_type) == BLOCK_POINTER_TYPE + && TREE_CODE (arg3_type) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL end blocks 6040305 (co) */ || (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type)) || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type))) { Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Tue Jul 29 23:41:34 2008 @@ -54,7 +54,8 @@ /* APPLE LOCAL optimization pragmas 3124235/3420242 */ #include "opts.h" -static tree grokparms (cp_parameter_declarator *, tree *); +/* APPLE LOCAL blocks 6040305 (ce) */ +tree grokparms (cp_parameter_declarator *, tree *); static const char *redeclaration_error_message (tree, tree); static int decl_jump_unsafe (tree); @@ -9201,7 +9202,8 @@ *PARMS is set to the chain of PARM_DECLs created. */ -static tree +/* APPLE LOCAL blocks 6040305 (ce) */ +tree grokparms (cp_parameter_declarator *first_parm, tree *parms) { tree result = NULL_TREE; Modified: llvm-gcc-4.2/trunk/gcc/cp/error.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/error.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/error.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/error.c Tue Jul 29 23:41:34 2008 @@ -342,6 +342,8 @@ reduces code size. */ case ARRAY_TYPE: case POINTER_TYPE: + /* APPLE LOCAL blocks 6040305 */ + case BLOCK_POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: offset_type: @@ -497,6 +499,8 @@ switch (TREE_CODE (t)) { case POINTER_TYPE: + /* APPLE LOCAL blocks 6040305 */ + case BLOCK_POINTER_TYPE: case REFERENCE_TYPE: { tree sub = TREE_TYPE (t); @@ -507,7 +511,10 @@ pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); } - pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); + /* APPLE LOCAL begin blocks 6040305 */ + pp_character (cxx_pp, "&*^"[(TREE_CODE (t) == POINTER_TYPE) + + (TREE_CODE (t) == BLOCK_POINTER_TYPE)*2]); + /* APPLE LOCAL end blocks 6040305 */ pp_base (cxx_pp)->padding = pp_before; pp_cxx_cv_qualifier_seq (cxx_pp, t); } @@ -593,6 +600,8 @@ switch (TREE_CODE (t)) { case POINTER_TYPE: + /* APPLE LOCAL blocks 6040305 */ + case BLOCK_POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) Modified: llvm-gcc-4.2/trunk/gcc/cp/mangle.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/mangle.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/mangle.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/mangle.c Tue Jul 29 23:41:34 2008 @@ -1649,6 +1649,13 @@ write_type (TREE_TYPE (type)); break; + /* APPLE LOCAL begin blocks 6040305 */ + case BLOCK_POINTER_TYPE: + write_string ("U13block_pointer"); + write_type (TREE_TYPE (type)); + break; + /* APPLE LOCAL end blocks 6040305 */ + case REFERENCE_TYPE: write_char ('R'); write_type (TREE_TYPE (type)); Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c Tue Jul 29 23:41:34 2008 @@ -366,6 +366,8 @@ { binding = cxx_binding_make (decl, NULL_TREE); binding->scope = level; + /* APPLE LOCAL blocks 6040305 (ch) */ + binding->declared_in_block = cur_block != 0; } else binding = new_class_binding (id, decl, /*type=*/NULL_TREE, level); @@ -1824,6 +1826,8 @@ result->scope = scope; result->is_local = false; result->value_is_inherited = false; + /* APPLE LOCAL blocks 6040305 (ch) */ + result->declared_in_block = 0; IDENTIFIER_NAMESPACE_BINDINGS (name) = result; return result; } @@ -4560,6 +4564,8 @@ return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type)); return arg_assoc_class (k, type); case POINTER_TYPE: + /* APPLE LOCAL blocks 6040305 */ + case BLOCK_POINTER_TYPE: case REFERENCE_TYPE: case ARRAY_TYPE: return arg_assoc_type (k, TREE_TYPE (type)); Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Tue Jul 29 23:41:34 2008 @@ -1628,6 +1628,9 @@ (cp_parser *, bool, bool *); static tree cp_parser_builtin_offsetof (cp_parser *); +/* APPLE LOCAL begin blocks 6040305 (ca) */ +static tree cp_parser_block_literal_expr (cp_parser *); +/* APPLE LOCAL end blocks 6040305 (ca) */ /* APPLE LOCAL begin C* language */ static void objc_foreach_stmt (cp_parser *, tree); @@ -1656,7 +1659,8 @@ static tree cp_parser_expression_statement (cp_parser *, tree); static tree cp_parser_compound_statement - (cp_parser *, tree, bool); + /* APPLE LOCAL radar 5982990 */ + (cp_parser *, tree, bool, bool); static void cp_parser_statement_seq_opt (cp_parser *, tree); static tree cp_parser_selection_statement @@ -3288,6 +3292,8 @@ ( compound-statement ) __builtin_va_arg ( assignment-expression , type-id ) __builtin_offsetof ( type-id , offsetof-expression ) + APPLE LOCAL blocks 6040305 (cf) + ^ block-literal-expr Objective-C++ Extension: @@ -3323,6 +3329,16 @@ token = cp_lexer_peek_token (parser->lexer); switch (token->type) { + /* APPLE LOCAL begin blocks 6040305 (cf) */ + case CPP_XOR: + if (flag_blocks) + { + tree expr = cp_parser_block_literal_expr (parser); + return expr; + } + cp_parser_error (parser, "expected primary-expression"); + return error_mark_node; + /* APPLE LOCAL end blocks 6040305 (cf) */ /* literal: integer-literal character-literal @@ -3416,7 +3432,8 @@ /* Start the statement-expression. */ expr = begin_stmt_expr (); /* Parse the compound-statement. */ - cp_parser_compound_statement (parser, expr, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, expr, false, false); /* Finish up. */ expr = finish_stmt_expr (expr, false); } @@ -6862,7 +6879,8 @@ } /* Anything that starts with a `{' must be a compound-statement. */ else if (token->type == CPP_OPEN_BRACE) - statement = cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + statement = cp_parser_compound_statement (parser, NULL, false, false); /* CPP_PRAGMA is a #pragma inside a function body, which constitutes a statement all its own. */ else if (token->type == CPP_PRAGMA) @@ -7036,7 +7054,8 @@ static tree cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr, - bool in_try) + /* APPLE LOCAL radar 5982990 */ + bool in_try, bool objc_sjlj_exceptions) { tree compound_stmt; @@ -7070,6 +7089,10 @@ /* APPLE LOCAL end CW asm blocks */ /* Parse an (optional) statement-seq. */ cp_parser_statement_seq_opt (parser, in_statement_expr); + /* APPLE LOCAL begin radar 5982990 */ + if (objc_sjlj_exceptions) + objc_mark_locals_volatile (NULL); + /* APPLE LOCAL end radar 5982990 */ /* Finish the compound-statement. */ finish_compound_stmt (compound_stmt); /* Consume the `}'. */ @@ -7772,6 +7795,10 @@ break; case RID_GOTO: + /* APPLE LOCAL begin blocks 6040305 (cb) */ + if (cur_block) + error ("goto not allowed in block literal"); + /* APPLE LOCAL end blocks 6040305 (cb) */ /* Create the goto-statement. */ if (cp_lexer_next_token_is (parser->lexer, CPP_MULT)) { @@ -7844,7 +7871,8 @@ } /* if a compound is opened, we simply parse the statement directly. */ else if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) - statement = cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + statement = cp_parser_compound_statement (parser, NULL, false, false); /* If the token is not a `{', then we must take special action. */ else { @@ -12298,6 +12326,37 @@ return decl; } +/* APPLE LOCAL begin blocks 6040305 (cc) */ +static cp_cv_quals +cp_parser_cv_qualifier_or_attribute_seq_opt (cp_parser *parser, tree *attrs_p) +{ + cp_cv_quals quals = TYPE_UNQUALIFIED; + cp_cv_quals q; + cp_token *token; + + *attrs_p = NULL_TREE; + while (true) + { + /* Peek at the next token. */ + token = cp_lexer_peek_token (parser->lexer); + /* Handle attributes. */ + if (token->keyword == RID_ATTRIBUTE) + { + /* Parse the attributes. */ + *attrs_p = chainon (*attrs_p, + cp_parser_attributes_opt (parser)); + continue; + } + + q = cp_parser_cv_qualifier_seq_opt (parser); + if (q == TYPE_UNQUALIFIED) + break; + quals |= q; + } + return quals; +} +/* APPLE LOCAL end blocks 6040305 (cc) */ + /* Parse a declarator. declarator: @@ -12362,6 +12421,28 @@ /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); + /* APPLE LOCAL begin blocks 6040305 (cc) */ + if (flag_blocks && token->type == CPP_XOR) + { + cp_cv_quals quals; + cp_declarator *inner; + tree attrs; + + cp_lexer_consume_token (parser->lexer); + + /* cp_parse_declspecs (parser, quals_attrs, false, false, true); */ + quals = cp_parser_cv_qualifier_or_attribute_seq_opt (parser, &attrs); + + inner = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_EITHER, + /*ctor_dtor_or_conv_p=*/NULL, + /*parenthesized_p=*/NULL, + /*member_p=*/false); + if (inner == cp_error_declarator) + return inner; + return make_block_pointer_declarator (attrs, quals, inner); + } + /* APPLE LOCAL end blocks 6040305 (cc) */ + /* Check for the ptr-operator production. */ cp_parser_parse_tentatively (parser); /* Parse the ptr-operator. */ @@ -12839,6 +12920,8 @@ ptr-operator: & cv-qualifier-seq [opt] + APPLE LOCAL blocks 6040305 (cc) + ^ Returns INDIRECT_REF if a pointer, or pointer-to-member, was used. Returns ADDR_EXPR if a reference was used. In the case of a @@ -13621,7 +13704,8 @@ static void cp_parser_function_body (cp_parser *parser) { - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, false); } /* Parse a ctor-initializer-opt followed by a function-body. Return @@ -15389,7 +15473,8 @@ cp_parser_require_keyword (parser, RID_TRY, "`try'"); try_block = begin_try_block (); - cp_parser_compound_statement (parser, NULL, true); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, true, false); finish_try_block (try_block); cp_parser_handler_seq (parser); finish_handler_sequence (try_block); @@ -15466,7 +15551,8 @@ declaration = cp_parser_exception_declaration (parser); finish_handler_parms (declaration, handler); cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, false); finish_handler (handler); } @@ -16251,6 +16337,8 @@ case cdk_pointer: case cdk_reference: case cdk_ptrmem: + /* APPLE LOCAL blocks 6040305 */ + case cdk_block_pointer: return (cp_parser_check_declarator_template_parameters (parser, declarator->declarator)); @@ -20024,7 +20112,8 @@ /* NB: The @try block needs to be wrapped in its own STATEMENT_LIST node, lest it get absorbed into the surrounding block. */ stmt = push_stmt_list (); - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, false); objc_begin_try_stmt (location, pop_stmt_list (stmt)); while (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_CATCH)) @@ -20060,7 +20149,8 @@ /* APPLE LOCAL end radar 2848255 */ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); objc_begin_catch_clause (parm); - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, false); objc_finish_catch_clause (); } @@ -20071,7 +20161,8 @@ /* NB: The @finally block needs to be wrapped in its own STATEMENT_LIST node, lest it get absorbed into the surrounding block. */ stmt = push_stmt_list (); - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, false); objc_build_finally_clause (location, pop_stmt_list (stmt)); } @@ -20100,7 +20191,8 @@ /* NB: The @synchronized block needs to be wrapped in its own STATEMENT_LIST node, lest it get absorbed into the surrounding block. */ stmt = push_stmt_list (); - cp_parser_compound_statement (parser, NULL, false); + /* APPLE LOCAL radar 5982990 */ + cp_parser_compound_statement (parser, NULL, false, flag_objc_sjlj_exceptions); return objc_build_synchronized (location, lock, pop_stmt_list (stmt)); } @@ -20363,6 +20455,1081 @@ objc_finish_foreach_stmt (statement); } /* APPLE LOCAL end C* language */ +/* APPLE LOCAL begin blocks 6040305 (ce) */ +#define I_SYMBOL_BINDING(t) IDENTIFIER_BINDING(t) + +tree build_component_ref (tree e, tree member); +tree +build_component_ref (tree e, tree member) +{ + /* See declare_block_prologue_local_vars for code to find + FIELD_DECLs, if the below doesn't work. */ + return build_class_member_access_expr (e, member, + NULL_TREE, false); +} + +static tree block_copy_assign_decl; +static tree block_destroy_decl; +static tree block_byref_assign_copy_decl; + +/** build_block_struct_type - + struct block_1 { + struct invok_impl impl; + void *CopyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + void *DestroyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + int x; // ref variable list ... + int *y; // byref variable list + }; + */ +static tree +build_block_struct_type (struct block_sema_info * block_impl) +{ + tree fields = NULL_TREE, field, chain; + char buffer[32]; + static int unique_count; + tree block_struct_type; + /* build struct invok_impl */ + if (!invoke_impl_ptr_type) + build_block_internal_types (); + + /* Check and see if this block is required to have a Copy/Dispose + helper function. If yes, set BlockHasCopyDispose to TRUE. */ + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + block_impl->BlockHasCopyDispose = TRUE; + break; + } + + /* Further check to see that we have __byref variables which require + Copy/Dispose helpers. */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + block_impl->BlockHasCopyDispose = TRUE; + block_impl->BlockHasByrefVar = TRUE; + break; + } + + sprintf(buffer, "__block_%d", ++unique_count); + push_to_top_level (); + /* block_struct_type = start_struct (RECORD_TYPE, get_identifier (buffer)); */ + block_struct_type = make_aggr_type (RECORD_TYPE); + xref_basetypes (block_struct_type, NULL_TREE); + + /* struct invok_impl impl; */ + field = build_decl (FIELD_DECL, get_identifier ("impl"), + TREE_TYPE (invoke_impl_ptr_type)); + TREE_CHAIN (field) = fields; + fields = field; + if (block_impl->BlockHasCopyDispose) + { + /* void *CopyFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), + ptr_type_node); + TREE_CHAIN (field) = fields; + fields = field; + /* void *DestroyFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), + ptr_type_node); + TREE_CHAIN (field) = fields; + fields = field; + /* If inner block of a nested block has BlockHasCopyDispose, so + does its outer block. */ + if (block_impl->prev_block_info) + block_impl->prev_block_info->BlockHasCopyDispose = TRUE; + } + + /* int x; // ref variable list ... */ + for (chain = block_impl->block_ref_decl_list; chain; chain = TREE_CHAIN (chain)) + { + tree p = TREE_VALUE (chain); + /* Note! const-ness of copied in variable must not be carried over to the + type of the synthesized struct field. It prevents to assign to this + field when copy constructor is synthesized. */ + field = build_decl (FIELD_DECL, DECL_NAME (p), + c_build_qualified_type (TREE_TYPE (p), + TYPE_UNQUALIFIED)); + TREE_CHAIN (field) = fields; + fields = field; + } + + /* int *y; // byref variable list */ + for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) + { + tree p = TREE_VALUE (chain); + field = build_decl (FIELD_DECL, DECL_NAME (p), + TREE_TYPE (p)); + TREE_CHAIN (field) = fields; + fields = field; + } + + pop_from_top_level (); + /* finish_struct (block_struct_type, field_decl_chain, NULL_TREE); */ + finish_builtin_struct (block_struct_type, buffer, + fields, NULL_TREE); + + /* Zap out the name so that the back-end will give us the debugging + information for this anonymous RECORD_TYPE. */ + TYPE_NAME (block_struct_type) = NULL_TREE; + + return block_struct_type; +} + +/** + build_block_struct_initlist - builds the initializer list: + { &_NSConcreteStackBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + sizeof(struct block_1), + helper_1 }, + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + x, + &y + } +*/ +static tree +build_block_struct_initlist (tree block_struct_type, + struct block_sema_info *block_impl) +{ + tree initlist; + int size; + tree helper_addr, chain, fields; + unsigned flags = 0; + static tree NSConcreteStackBlock_decl = NULL_TREE; + + if (block_impl->BlockHasCopyDispose) + /* Note! setting of this flag merely indicates to the runtime that + we have destroy_helper_block/copy_helper_block helper + routines. */ + flags |= BLOCK_HAS_COPY_DISPOSE; + /* Set BLOCK_NO_COPY flag only if we are using the old byref, + indirect reference byref variables. */ + if (block_impl->block_byref_decl_list && !block_impl->BlockHasByrefVar) + flags |= BLOCK_NO_COPY; + + fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type)); + + /* Find an existing declaration for _NSConcreteStackBlock or declare + extern void *_NSConcreteStackBlock; */ + if (NSConcreteStackBlock_decl == NULL_TREE) + { + tree name_id = get_identifier("_NSConcreteStackBlock"); + NSConcreteStackBlock_decl = lookup_name (name_id); + if (!NSConcreteStackBlock_decl) + { + NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; + TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; + pushdecl_top_level (NSConcreteStackBlock_decl); + rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); + } + } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteStackBlock_decl)); + fields = TREE_CHAIN (fields); + + initlist = tree_cons (fields, + build_int_cst (unsigned_type_node, flags), + initlist); + fields = TREE_CHAIN (fields); + size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); + initlist = tree_cons (fields, + build_int_cst (unsigned_type_node, size), + initlist); + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + gcc_assert (invoke_impl_ptr_type); + initlist = build_constructor_from_list (TREE_TYPE (invoke_impl_ptr_type), + nreverse (initlist)); + fields = TYPE_FIELDS (block_struct_type); + initlist = build_tree_list (fields, initlist); + + if (block_impl->BlockHasCopyDispose) + { + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + } + for (chain = block_impl->block_original_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + { + tree y = TREE_VALUE (chain); + TREE_USED (y) = 1; + fields = TREE_CHAIN (fields); + initlist = tree_cons (fields, copy_in_object (y), initlist); + } + for (chain = block_impl->block_original_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + { + tree y = TREE_VALUE (chain); + TREE_USED (y) = 1; + fields = TREE_CHAIN (fields); + y = build_fold_addr_expr (y); + initlist = tree_cons (fields, y, initlist); + } + return initlist; +} + +/** + build_block_literal_tmp - This routine: + + 1) builds block type: + struct block_1 { + struct invok_impl impl; + void *CopyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + int x; // ref variable list ... + int *y; // byref variable list + }; + + 2) build function prototype: + double helper_1(struct block_1 *ii, int z); + + 3) build the temporary initialization: + struct block_1 I = { + { &_NSConcreteStackBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + sizeof(struct block_1), + helper_1 }, + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + x, + &y +}; + +It return the temporary. +*/ + +static tree +build_block_literal_tmp (const char *name, + struct block_sema_info * block_impl) +{ + extern tree create_tmp_var_raw (tree, const char *); + tree block_holder_tmp_decl; + tree constructor, initlist; + tree exp, bind; + tree block_struct_type = TREE_TYPE (block_impl->block_arg_ptr_type); + + + block_holder_tmp_decl = create_tmp_var_raw (block_struct_type, name); + /* Context will not be known until when the literal is synthesized. + This is more so in the case of nested block literal blocks. */ + DECL_CONTEXT (block_holder_tmp_decl) = current_function_decl; + DECL_ARTIFICIAL (block_holder_tmp_decl) = 1; + + initlist = build_block_struct_initlist (block_struct_type, + block_impl); + initlist = nreverse (initlist); + constructor = build_constructor_from_list (block_struct_type, + initlist); + TREE_CONSTANT (constructor) = 1; + TREE_STATIC (constructor) = 1; + TREE_READONLY (constructor) = 1; + DECL_INITIAL (block_holder_tmp_decl) = constructor; + exp = build_stmt (DECL_EXPR, block_holder_tmp_decl); + bind = build3 (BIND_EXPR, void_type_node, block_holder_tmp_decl, exp, NULL); + TREE_SIDE_EFFECTS (bind) = 1; + add_stmt (bind); + return block_holder_tmp_decl; +} + +static tree +clean_and_exit (tree block) +{ + pop_function_context (); + pop_lang_context (); + free (finish_block (block)); + return error_mark_node; +} + +/** synth_copy_helper_block_func - This function synthesizes + void copy_helper_block (struct block* _dest, struct block *_src) function. +*/ + +static void +synth_copy_helper_block_func (struct block_sema_info * block_impl) +{ + tree stmt, chain; + tree dst_arg, src_arg; + /* struct c_arg_info * arg_info; */ + /* Set up: (struct block* _dest, struct block *_src) parameters. */ + dst_arg = build_decl (PARM_DECL, get_identifier ("_dst"), + block_impl->block_arg_ptr_type); + DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + TREE_USED (dst_arg) = 1; + DECL_ARG_TYPE (dst_arg) = block_impl->block_arg_ptr_type; + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + block_impl->block_arg_ptr_type); + DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; + /* arg_info = xcalloc (1, sizeof (struct c_arg_info)); */ + TREE_CHAIN (dst_arg) = src_arg; + + pushdecl (cur_block->copy_helper_func_decl); + /* arg_info->parms = dst_arg; */ + /* arg_info->types = tree_cons (NULL_TREE, block_impl->block_arg_ptr_type, + tree_cons (NULL_TREE, + block_impl->block_arg_ptr_type, + NULL_TREE)); */ + DECL_ARGUMENTS (cur_block->copy_helper_func_decl) = dst_arg; + /* function header synthesis. */ + push_function_context (); + /* start_block_helper_function (cur_block->copy_helper_func_decl, true); */ + /* store_parm_decls (arg_info); */ + start_preparsed_function (cur_block->copy_helper_func_decl, + /*attrs*/NULL_TREE, + SF_PRE_PARSED); + + /* Body of the function. */ + stmt = begin_compound_stmt (BCS_FN_BODY); + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + tree p = TREE_VALUE (chain); + tree dst_block_component, src_block_component; + dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), + DECL_NAME (p)); + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) + { + tree func_params, call_exp; + /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure) */ + /* Build a: void _Block_copy_assign (void *, void *) if not done + already. */ + if (!block_copy_assign_decl) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + + block_copy_assign_decl = builtin_function ("_Block_copy_assign", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_copy_assign_decl) = 0; + } + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + NULL_TREE)); + call_exp = build_function_call (block_copy_assign_decl, func_params); + add_stmt (call_exp); + } + else + { + /* _dest-> imported_object_x = [_src->imported_object_x retain] */ + tree rhs, store; + /* [_src->imported_object_x retain] */ + rhs = retain_block_component (src_block_component); + store = build_modify_expr (dst_block_component, NOP_EXPR, rhs); + add_stmt (store); + } + } + + /* For each __block declared variable used in |...| Must generate call to: + _Block_byref_assign_copy(&_dest->myImportedBlock, _src->myImportedBlock) + */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + tree func_params, call_exp; + tree p = TREE_VALUE (chain); + tree dst_block_component, src_block_component; + dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), + DECL_NAME (p)); + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + /* _Block_byref_assign_copy(&_dest->myImportedClosure, _src->myImportedClosure) */ + /* Build a: void _Block_byref_assign_copy (void *, void *) if + not done already. */ + if (!block_byref_assign_copy_decl + && !(block_byref_assign_copy_decl + = lookup_name (get_identifier ("_Block_byref_assign_copy")))) + { + tree func_type + = build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + + block_byref_assign_copy_decl + = builtin_function ("_Block_byref_assign_copy", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_byref_assign_copy_decl) = 0; + } + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + NULL_TREE)); + call_exp = build_function_call (block_byref_assign_copy_decl, func_params); + add_stmt (call_exp); + } + + finish_compound_stmt (stmt); + finish_function (0); + pop_function_context (); + /* free (arg_info); */ +} + +static void +synth_destroy_helper_block_func (struct block_sema_info * block_impl) +{ + tree stmt, chain; + tree src_arg; + /* struct c_arg_info * arg_info; */ + /* Set up: (struct block *_src) parameter. */ + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + block_impl->block_arg_ptr_type); + DECL_CONTEXT (src_arg) = cur_block->destroy_helper_func_decl; + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; + /* arg_info = xcalloc (1, sizeof (struct c_arg_info)); */ + + pushdecl (cur_block->destroy_helper_func_decl); + /* arg_info->parms = src_arg; */ + /* arg_info->types = tree_cons (NULL_TREE, block_impl->block_arg_ptr_type, + NULL_TREE); */ + DECL_ARGUMENTS (cur_block->destroy_helper_func_decl) = src_arg; + + /* function header synthesis. */ + push_function_context (); + /* start_block_helper_function (cur_block->destroy_helper_func_decl, true); */ + /* store_parm_decls_from (arg_info); */ + start_preparsed_function (cur_block->destroy_helper_func_decl, + /*attrs*/NULL_TREE, + SF_PRE_PARSED); + + /* Body of the function. */ + stmt = begin_compound_stmt (BCS_FN_BODY); + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (block_requires_copying (TREE_VALUE (chain))) + { + tree p = TREE_VALUE (chain); + tree src_block_component; + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + + if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) + { + tree func_params, call_exp; + /* _Block_destroy(_src->myImportedClosure); */ + /* _Block_destroy (void *); */ + /* Build a: void _Block_destroy (void *) if not done already. */ + if (!block_destroy_decl && + !(block_destroy_decl = lookup_name (get_identifier ("_Block_destroy")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + + block_destroy_decl = builtin_function ("_Block_destroy", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_destroy_decl) = 0; + } + func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + call_exp = build_function_call (block_destroy_decl, func_params); + add_stmt (call_exp); + } + else + { + tree rel_exp; + /* [_src->imported_object_0 release]; */ + rel_exp = release_block_component (src_block_component); + add_stmt (rel_exp); + } + } + + /* For each __byref declared variable used in |...| Must generate call to: + _Block_byref_release(_src->myImportedClosure) + */ + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain))) + { + tree func_params, call_exp; + tree p = TREE_VALUE (chain); + tree src_block_component; + + src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), + DECL_NAME (p)); + /* _Block_byref_release(_src->myImportedClosure) */ + /* Build a: void _Block_byref_release (void *) if not done + already. */ + func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + call_exp = build_function_call (build_block_byref_release_decl (), func_params); + add_stmt (call_exp); + } + + finish_compound_stmt (stmt); + finish_function (0); + pop_function_context (); +} + +/** cp_parser_block_literal_expr - Main routine to process a block literal + with the syntax of ^arg-list[OPT] block or ^()expression. It synthesizes + the helper function for later generation and builds the necessary data to + represent the block literal where it is declared. +*/ +static tree +cp_parser_block_literal_expr (cp_parser* parser) +{ + char name [32]; + static int global_unique_count; + int unique_count = ++global_unique_count; + tree block_helper_function_decl; + tree expr, type, arglist = NULL_TREE, ftype; + tree self_arg, stmt; + /* struct c_arg_info *args = NULL; */ + cp_parameter_declarator *args = NULL; + tree arg_type = void_list_node; + struct block_sema_info *block_impl; + tree tmp; + tree restype, resdecl; + tree typelist; + tree helper_function_type; + bool at_file_scope = global_bindings_p (); + tree block; + + cp_lexer_consume_token (parser->lexer); /* eat '^' */ + + /* Parse the optional argument list */ + if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN)) + { + cp_lexer_consume_token (parser->lexer); + /* Open the scope to collect parameter decls */ + /* push_scope (); */ + /* args = c_parser_parms_declarator (parser, true, NULL_TREE); */ + /* Parse the parameter-declaration-clause. */ + args = cp_parser_parameter_declaration_clause (parser); + cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); + arg_type = grokparms (args, &arglist); + /* Check for args as it might be NULL due to error. */ + if (! args) + { + /* pop_scope (); */ + return error_mark_node; + } + /* pop_scope (); */ + } +#if 0 + else + arglist = build_tree_list (NULL_TREE, void_type_node); +#endif + + block = begin_block (); + + /* cur_block->arg_info = NULL; */ + cur_block->return_type = NULL_TREE; + + if (args) + { + /* cur_block->arg_info = args; */ + if (arg_type) + { + cur_block->hasPrototype = true; + /* This is the only way in gcc to know if argument list ends with ... */ + cur_block->isVariadic = args->ellipsis_p; + } + else + { + /* K&R syle () argument list. */ + cur_block->hasPrototype = false; + cur_block->isVariadic = true; + } + } + else + { + cur_block->hasPrototype = false; + cur_block->isVariadic = false; + /* cur_block->arg_info = xcalloc (1, sizeof (struct c_arg_info)); */ + } + + /* Must also build hidden parameter _self added to the helper + function, even though we do not know its type yet. */ + self_arg = build_artificial_parm (get_identifier ("_self"), ptr_type_node); + + /* TREE_CHAIN (self_arg) = cur_block->arg_info->parms; */ + TREE_CHAIN (self_arg) = arglist; + arg_type = tree_cons (NULL_TREE, ptr_type_node, arg_type); + arglist = self_arg; + + /* Build the declaration of the helper function (we do not know its result + type yet, so assume it is 'void'). Treat this as a nested function and use + nested function infrastructure for its generation. */ + sprintf (name, "__helper_%d", unique_count); + + push_lang_context (lang_name_c); + ftype = build_function_type (void_type_node, arg_type); + block_helper_function_decl = build_helper_func_decl (get_identifier (name), + ftype); + DECL_NO_STATIC_CHAIN (current_function_decl) = 0; + DECL_CONTEXT (block_helper_function_decl) = current_function_decl; + BLOCK_HELPER_FUNC (block_helper_function_decl) = 1; + cur_block->helper_func_decl = block_helper_function_decl; + + DECL_ARGUMENTS (block_helper_function_decl) = arglist; + + push_function_context (); + /* start_block_helper_function (cur_block->helper_func_decl, false); */ + /* Enter parameter list to the scope of the helper function. */ + /* store_parm_decls_from (cur_block->arg_info); */ + start_preparsed_function (cur_block->helper_func_decl, + /*attrs*/NULL_TREE, + SF_PRE_PARSED); + + /* Set block's scope to the scope of the helper function's main body. + This is primarily used when nested blocks are declared. */ + cur_block->cp_the_scope = current_binding_level; + + /* Start parsing body or expression part of the block literal. */ + { + unsigned save = parser->in_statement; + /* Indicate no valid break/continue context. We'll notice and + emit the proper error message in c_finish_bc_stmt. */ + parser->in_statement = 0; + stmt = begin_compound_stmt (BCS_FN_BODY); + cp_parser_compound_statement (parser, NULL, false, false); + parser->in_statement = save; + } + + cur_block->block_arg_ptr_type = + build_pointer_type (build_block_struct_type (cur_block)); + + restype = !cur_block->return_type ? void_type_node + : cur_block->return_type; + if (at_file_scope) + { + error ("block literal cannot be declared at global scope"); + return clean_and_exit (block); + } + if (restype == error_mark_node) + return clean_and_exit (block); + + /* Now that we know type of the hidden _self argument, fix its type. */ + TREE_TYPE (self_arg) = cur_block->block_arg_ptr_type; + DECL_ARG_TYPE (self_arg) = cur_block->block_arg_ptr_type; + + /* Now that we know helper's result type, fix its result variable decl. */ + resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (current_function_decl) = resdecl; + + cur_block->block_body = stmt; + block_build_prologue (cur_block); + + finish_compound_stmt (stmt); + /* add_stmt (fnbody); */ + finish_function (0); + pop_function_context (); + pop_lang_context (); + + /* Build the declaration for copy_helper_block and destroy_helper_block + helper functions for later use. */ + + if (cur_block->BlockHasCopyDispose) + { + /* void copy_helper_block (struct block*, struct block *); */ + tree s_ftype = build_function_type (void_type_node, + tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + tree_cons (NULL_TREE, + cur_block->block_arg_ptr_type, + void_list_node))); + sprintf (name, "__copy_helper_block_%d", unique_count); + cur_block->copy_helper_func_decl = + build_helper_func_decl (get_identifier (name), s_ftype); + synth_copy_helper_block_func (cur_block); + + /* void destroy_helper_block (struct block*); */ + s_ftype = build_function_type (void_type_node, + tree_cons (NULL_TREE, + cur_block->block_arg_ptr_type, void_list_node)); + sprintf (name, "__destroy_helper_block_%d", unique_count); + cur_block->destroy_helper_func_decl = + build_helper_func_decl (get_identifier (name), s_ftype); + synth_destroy_helper_block_func (cur_block); + } + + + /* We are out of helper function scope and back in its enclosing scope. + We also know all we need to know about the helper function. So, fix its + type here. */ + ftype = build_function_type (restype, TREE_CHAIN (arg_type)); + /* Declare helper function; as in: + double helper_1(struct block_1 *ii, int z); */ + typelist = TYPE_ARG_TYPES (ftype); + /* (struct block_1 *ii, int z, ...) */ + typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + typelist); + helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); + TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; + + block_impl = finish_block (block); + + /* Build unqiue name of the temporary used in code gen. */ + sprintf (name, "__block_holder_tmp_%d", unique_count); + tmp = build_block_literal_tmp (name, block_impl); + tmp = build_fold_addr_expr (tmp); + type = build_block_pointer_type (ftype); + expr = convert (type, convert (ptr_type_node, tmp)); + free (block_impl); + return expr; +} +/* APPLE LOCAL end blocks 6040305 (ce) */ + +/* APPLE LOCAL begin blocks 6040305 (ch) */ +/* build_byref_local_var_access - converts EXPR to: + EXPR.forwarding->. +*/ +tree +build_byref_local_var_access (tree expr, tree decl_name) +{ + tree exp = build_component_ref (expr, get_identifier ("forwarding")); + exp = build_indirect_ref (exp, "unary *"); + exp = build_component_ref (exp, decl_name); + return exp; +} + +/** + build_block_byref_decl - This routine inserts a variable declared as a + 'byref' variable using the |...| syntax in helper function's outer-most scope. +*/ +tree +build_block_byref_decl (tree name, tree decl, tree exp) +{ + /* If it is already a byref declaration, do not add the pointer type + because such declarations already have the pointer type + added. This happens when we have two nested byref declarations in + nested blocks. */ + tree ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) + ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); + tree byref_decl = build_decl (VAR_DECL, name, ptr_type); + DECL_CONTEXT (byref_decl) = current_function_decl; + BLOCK_DECL_BYREF (byref_decl) = 1; + + if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) + { + COPYABLE_BYREF_LOCAL_VAR (byref_decl) = 1; + COPYABLE_BYREF_LOCAL_NONPOD (byref_decl) = COPYABLE_BYREF_LOCAL_NONPOD (decl); + } + + /* Current scope must be that of the main function body. */ + /* FIXME gcc_assert (current_scope->function_body);*/ + pushdecl (byref_decl); + /* APPLE LOCAL begin radar 6083129 - byref escapes (cp) */ + /* FIXME: finish this off, ensure the decl is scoped appropriately + for when we want the cleanup to run. */ + if (! flag_objc_gc_only) + push_cleanup (byref_decl, build_block_byref_release_exp (byref_decl), false); + /* APPLE LOCAL end radar 6083129 - byref escapes (cp) */ + cur_block->block_byref_decl_list = + tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); + cur_block->block_original_byref_decl_list = + tree_cons (NULL_TREE, exp, cur_block->block_original_byref_decl_list); + return byref_decl; +} + +#define BINDING_VALUE(b) ((b)->value) + +/** + build_block_ref_decl - This routine inserts a copied-in variable (a variable + referenced in the block but whose scope is outside the block) in helper + function's outer-most scope. It also sets its type to 'const' as such + variables are read-only. +*/ +tree +build_block_ref_decl (tree name, tree decl) +{ + tree ref_decl; + /* 'decl' was previously declared as __block. Simply, copy the value + embedded in the above variable. */ + if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) + decl = build_byref_local_var_access (decl, DECL_NAME (decl)); + else { + if (cur_block->prev_block_info) { + /* Traverse enclosing blocks. Insert a copied-in variable in each + enclosing block which has no declaration of this variable. This is + to ensure that the current (inner) block has the 'frozen' value of the + copied-in variable; which means the value of the copied in variable + is at the point of the block declaration and *not* when the inner block + is invoked. + */ + struct block_sema_info *cb = cur_block->prev_block_info; + while (cb) { + struct cxx_binding *b = I_SYMBOL_BINDING (name); + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + /* Find the first declaration not in current block. */ + while (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) == cur_block->helper_func_decl) + { + /* FIXME: This can't happen?! */ + abort (); + /* b = b->previous; */ + } + + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + + /* Is the next declaration not in the enclosing block? */ + if (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) != cb->helper_func_decl) + { + /* No declaration of variable seen in the block. Must + insert one, so it 'freezes' the variable in this + block. */ + /* FIXME: does this push enough? scope? */ + struct cp_binding_level *save_scope = current_binding_level; + struct block_sema_info *save_current_block = cur_block; + tree save_current_function_decl = current_function_decl; + current_binding_level = cb->cp_the_scope; + cur_block = cb; + current_function_decl = cb->helper_func_decl; + decl = build_block_ref_decl (name, decl); + cur_block = save_current_block; + current_binding_level = save_scope; + current_function_decl = save_current_function_decl; + } + cb = cb->prev_block_info; + } + } + } + + ref_decl = build_decl (VAR_DECL, name, + build_qualified_type (TREE_TYPE (decl), + TYPE_QUAL_CONST)); + DECL_CONTEXT (ref_decl) = current_function_decl; + DECL_INITIAL (ref_decl) = error_mark_node; + c_apply_type_quals_to_decl (TYPE_QUAL_CONST, ref_decl); + BLOCK_DECL_COPIED (ref_decl) = 1; + + /* Find the scope for function body (outer-most scope) and insert + this variable in that scope. This is to avoid duplicate + declaration of the save variable. */ + { + struct cp_binding_level *b = current_binding_level; + while (b->level_chain->kind != sk_function_parms) + b = b->level_chain; + pushdecl_with_scope (ref_decl, b, /*is_friend=*/false); + cp_finish_decl (ref_decl, NULL_TREE, /*init_const_expr_p=*/false, NULL_TREE, + LOOKUP_ONLYCONVERTING); + } + cur_block->block_ref_decl_list = + tree_cons (NULL_TREE, ref_decl, cur_block->block_ref_decl_list); + cur_block->block_original_ref_decl_list = + tree_cons (NULL_TREE, decl, cur_block->block_original_ref_decl_list); + return ref_decl; +} + +/** build_block_internal_types - This routine builds the block type: + struct __invoke_impl { + void *isa; + int32_t Flags; + int32_t Size; + void *FuncPtr; + } *invoke_impl_ptr_type; + */ +void +build_block_internal_types (void) +{ + tree fields = NULL_TREE, field_decl; + tree invoke_impl_type; + + /* If a user-declaration of "struct __invoke_impl" is seen, use it. */ + invoke_impl_type = lookup_name_prefer_type (get_identifier ("__invoke_impl"), 2); + if (invoke_impl_type) + { + invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); + return; + } + + push_to_top_level (); + + /* invoke_impl_type = start_struct (RECORD_TYPE, get_identifier ("__invoke_impl")); */ + invoke_impl_type = make_aggr_type (RECORD_TYPE); + xref_basetypes (invoke_impl_type, NULL_TREE); + + /* void *isa; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); + TREE_CHAIN (field_decl) = fields; + fields = field_decl; + + /* int32_t Flags; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Flags"), unsigned_type_node); + TREE_CHAIN (field_decl) = fields; + fields = field_decl; + + /* int32_t Size */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), unsigned_type_node); + TREE_CHAIN (field_decl) = fields; + fields = field_decl; + + /* void *FuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("FuncPtr"), ptr_type_node); + TREE_CHAIN (field_decl) = fields; + fields = field_decl; + + /* Mark this struct as being a block struct rather than a 'normal' + struct. */ + TYPE_BLOCK_IMPL_STRUCT (invoke_impl_type) = 1; + /* finish_struct (invoke_impl_type, field_decl_chain, NULL_TREE); */ + finish_builtin_struct (invoke_impl_type, "__invoke_impl", fields, NULL_TREE); + pop_from_top_level (); + invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); +} + +cp_declarator * +make_block_pointer_declarator (tree attributes, + cp_cv_quals quals, + cp_declarator *target) +{ + struct cp_declarator *itarget = target; + struct cp_declarator *ret = make_declarator (cdk_block_pointer); + + /* Closure contructs seen -- generate supporting types. */ + if (!invoke_impl_ptr_type) + build_block_internal_types (); + + ret->attributes = attributes; + ret->declarator = itarget; + ret->u.block_pointer.qualifiers = quals; + return ret; +} + +bool in_imm_block (void) +{ + return (cur_block && cur_block->cp_the_scope == current_binding_level); +} + +/* This routine returns 'true' if 'name' has a declaration inside the + current block, 'false' otherwise. If 'name' has no declaration in + the current block, it returns in DECL the user declaration for + 'name' found in the enclosing scope. Note that if it is declared + in current declaration, it can be either a user declaration or a + byref/copied-in declaration added in current block's scope by the + compiler. */ +bool +lookup_name_in_block (tree name, tree *decl) +{ + cxx_binding *b = I_SYMBOL_BINDING (name); + if (b && b->declared_in_block + && DECL_CONTEXT (BINDING_VALUE (b)) == current_function_decl) + return true; + + /* Check for variables only, as we may have parameters, such as + 'self' */ + /* Note that if a copied-in variable (BLOCK_DECL_COPIED) in the + enclosing block is found, it must be returned as this is + where the variable in current (nested block) will have to get + its value. */ + while (b + && TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + && (BLOCK_DECL_BYREF (BINDING_VALUE (b)))) + b = b->previous; + if (b) + *decl = BINDING_VALUE (b); + return false; +} + +/** + build_helper_func_decl - This routine builds a FUNCTION_DECL for + a block helper function. +*/ +tree +build_helper_func_decl (tree ident, tree type) +{ + tree func_decl = build_decl (FUNCTION_DECL, ident, type); + DECL_EXTERNAL (func_decl) = 0; + TREE_PUBLIC (func_decl) = 0; + TREE_USED (func_decl) = 1; + TREE_NOTHROW (func_decl) = 0; + retrofit_lang_decl (func_decl); + return func_decl; +} + +/** + declare_block_prologue_local_vars - utility routine to do the actual + declaration and initialization for each referecned block variable. +*/ +static void +declare_block_prologue_local_vars (tree self_parm, tree component, + tree stmt) +{ + tree decl, block_component; + tree_stmt_iterator i; + tree decl_stmt; + + decl = component; + component = lookup_member (TREE_TYPE (TREE_TYPE (self_parm)), + DECL_NAME (component), 0, 0); + block_component = build_component_ref (build_indirect_ref (self_parm, "->"), + component); + gcc_assert (block_component); + DECL_EXTERNAL (decl) = 0; + TREE_STATIC (decl) = 0; + TREE_USED (decl) = 1; + DECL_CONTEXT (decl) = current_function_decl; + DECL_ARTIFICIAL (decl) = 1; + DECL_INITIAL (decl) = block_component; + /* Prepend a DECL_EXPR statement to the statement list. */ + i = tsi_start (stmt); + decl_stmt = build_stmt (DECL_EXPR, decl); + SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl)); + tsi_link_before (&i, decl_stmt, TSI_SAME_STMT); +} + +/** + block_build_prologue + - This routine builds the declarations for the + variables referenced in the block; as in: + int *y = _self->y; + int x = _self->x; + + The decl_expr declaration for each initialization is enterred at the + beginning of the helper function's statement-list which is passed + in block_impl->block_body. +*/ +void +block_build_prologue (struct block_sema_info *block_impl) +{ + tree chain; + tree self_parm = lookup_name (get_identifier ("_self")); + gcc_assert (self_parm); + + for (chain = block_impl->block_ref_decl_list; chain; + chain = TREE_CHAIN (chain)) + declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain), + block_impl->block_body); + + for (chain = block_impl->block_byref_decl_list; chain; + chain = TREE_CHAIN (chain)) + declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain), + block_impl->block_body); +} +/* APPLE LOCAL end blocks 6040305 (ch) */ /* OpenMP 2.5 parsing routines. */ @@ -21748,12 +22915,8 @@ /* Bad parse errors. Just forget about it. */ if (! global_bindings_p () || current_class_type || decl_namespace_list) return; - /* LLVM LOCAL begin */ - if (pch_file) { + if (pch_file) c_common_write_pch (); - return; - } - /* LLVM LOCAL end */ /* APPLE LOCAL end radar 4874613 */ } Modified: llvm-gcc-4.2/trunk/gcc/cp/semantics.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/semantics.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/semantics.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/semantics.c Tue Jul 29 23:41:34 2008 @@ -2455,6 +2455,28 @@ return build_baselink (cl, cl, fns, /*optype=*/NULL_TREE); } +/* APPLE LOCAL begin blocks 6040305 */ +static bool +block_var_ok_for_context (tree context) +{ + /* FIXME - local classes inside blocks, templates, etc */ + struct block_sema_info *b = cur_block; + tree decl = current_function_decl; + + /* If in a block helper, only variables from the context of the helper + are ok. */ + while (b && b->helper_func_decl == decl) + { + if (context == DECL_CONTEXT (decl)) + return true; + decl = DECL_CONTEXT (decl); + b = b->prev_block_info; + } + + return false; +} +/* APPLE LOCAL end blocks 6040305 */ + /* ID_EXPRESSION is a representation of parsed, but unprocessed, id-expression. (See cp_parser_id_expression for details.) SCOPE, if non-NULL, is the type or namespace used to explicitly qualify @@ -2566,7 +2588,10 @@ { tree context = decl_function_context (decl); if (context != NULL_TREE && context != current_function_decl - && ! TREE_STATIC (decl)) + /* APPLE LOCAL begin blocks 6040305 */ + && ! TREE_STATIC (decl) + && !block_var_ok_for_context (context)) + /* APPLE LOCAL end blocks 6040305 */ { error (TREE_CODE (decl) == VAR_DECL ? "use of % variable from containing function" @@ -2898,9 +2923,72 @@ } } + /* APPLE LOCAL begin blocks 6040305 (ci) */ + if (cur_block + && (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL) + && !lookup_name_in_block (id_expression, &decl)) + { + bool gdecl; + /* We are referencing a variable inside a block whose + declaration is outside. */ + gcc_assert (decl && + (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL)); + gdecl = (TREE_CODE (decl) == VAR_DECL && + (DECL_EXTERNAL (decl) + || (TREE_STATIC (decl) + && (!DECL_CONTEXT (decl) + || DECL_NAMESPACE_SCOPE_P (decl))))); + /* Treat all 'global' variables as 'byref' by default. */ + if (gdecl) + { + /* byref globals are directly accessed. */ + if (!gdecl) + /* build a decl for the byref variable. */ + decl = build_block_byref_decl (id_expression, decl, decl); + else + add_block_global_byref_list (decl); + } + else + { + /* 'byref' globals are never copied-in. So, do not add + them to the copied-in list. */ + if (!in_block_global_byref_list (decl)) + /* build a new decl node. set its type to 'const' type + of the old decl. */ + decl = build_block_ref_decl (id_expression, decl); + } + } + /* APPLE LOCAL end blocks 6040305 (ci) */ + if (TREE_DEPRECATED (decl)) warn_deprecated_use (decl); + /* APPLE LOCAL begin blocks 6040305 (cd) */ + if (TREE_CODE (decl) == VAR_DECL) + { + if (BLOCK_DECL_BYREF (decl)) + { + tree orig_decl = decl; + decl = build_indirect_ref (decl, "unary *"); + if (COPYABLE_BYREF_LOCAL_VAR (orig_decl)) + { + /* What we have is an expression which is of type + struct __Block_byref_X. Must get to the value of the variable + embedded in this structure. It is at: + __Block_byref_X.forwarding->x */ + decl = build_byref_local_var_access (decl, + DECL_NAME (orig_decl)); + } + } + else + if (COPYABLE_BYREF_LOCAL_VAR (decl)) + decl = build_byref_local_var_access (decl, + DECL_NAME (decl)); + } + /* APPLE LOCAL end blocks 6040305 (cd) */ + return decl; } @@ -3971,6 +4059,32 @@ return OMP_CLAUSE_DEFAULT_UNSPECIFIED; } + +/* APPLE LOCAL begin blocks 6040305 (ch) */ +tree +begin_block (void) +{ + struct block_sema_info *csi; + tree block; + /* push_scope (); */ + block = do_pushlevel (sk_block); + csi = (struct block_sema_info*)xcalloc (1, sizeof (struct block_sema_info)); + csi->prev_block_info = cur_block; + cur_block = csi; + return block; +} + +struct block_sema_info * +finish_block (tree block) +{ + struct block_sema_info *csi = cur_block; + cur_block = cur_block->prev_block_info; + /* pop_scope (); */ + do_poplevel (block); + return csi; +} +/* APPLE LOCAL end blocks 6040305 (ch) */ + void init_cp_semantics (void) Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Tue Jul 29 23:41:34 2008 @@ -406,7 +406,8 @@ tree attributes; /* Determine the types pointed to by T1 and T2. */ - if (TREE_CODE (t1) == POINTER_TYPE) + /* APPLE LOCAL blocks 6040305 */ + if (TREE_CODE (t1) == POINTER_TYPE || TREE_CODE (t1) == BLOCK_POINTER_TYPE) { pointee1 = TREE_TYPE (t1); pointee2 = TREE_TYPE (t2); @@ -1040,7 +1041,22 @@ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; break; - + + /* APPLE LOCAL begin blocks 6040305 */ + case BLOCK_POINTER_TYPE: + if (TREE_CODE (t2) == BLOCK_POINTER_TYPE) + { + tree pt1 = TREE_TYPE (t1); + tree pt2 = TREE_TYPE (t2); + if (!same_type_ignoring_top_level_qualifiers_p ( + TREE_TYPE (pt1), TREE_TYPE (pt2))) + return false; + if (!compparms (TYPE_ARG_TYPES (pt1), TYPE_ARG_TYPES (pt2))) + return false; + break; + } + /* APPLE LOCAL end blocks 6040305 */ + case POINTER_TYPE: case REFERENCE_TYPE: if (TYPE_MODE (t1) != TYPE_MODE (t2) @@ -1048,7 +1064,7 @@ || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; break; - + case METHOD_TYPE: case FUNCTION_TYPE: if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) @@ -2784,7 +2800,8 @@ is_method = (TREE_CODE (fntype) == POINTER_TYPE && TREE_CODE (TREE_TYPE (fntype)) == METHOD_TYPE); - if (!((TREE_CODE (fntype) == POINTER_TYPE + /* APPLE LOCAL blocks 6040305 */ + if (!(((TREE_CODE (fntype) == POINTER_TYPE || TREE_CODE (fntype) == BLOCK_POINTER_TYPE) && TREE_CODE (TREE_TYPE (fntype)) == FUNCTION_TYPE) || is_method || TREE_CODE (function) == TEMPLATE_ID_EXPR)) @@ -3367,7 +3384,8 @@ if ((TREE_CODE (orig_op0) == STRING_CST && !integer_zerop (op1)) || (TREE_CODE (orig_op1) == STRING_CST && !integer_zerop (op0))) warning (OPT_Waddress, - "comparison with string literal results in unspecified behaviour"); + /* APPLE LOCAL spelling 5808469 */ + "comparison with string literal results in unspecified behavior"); build_type = boolean_type_node; if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE @@ -3379,18 +3397,27 @@ || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1))) result_type = composite_pointer_type (type0, type1, op0, op1, "comparison"); - else if ((code0 == POINTER_TYPE || TYPE_PTRMEM_P (type0)) + /* APPLE LOCAL begin blocks 6040305 */ + else if (code0 == BLOCK_POINTER_TYPE && code1 == BLOCK_POINTER_TYPE) + result_type = composite_pointer_type (type0, type1, op0, op1, + "comparison"); + /* APPLE LOCAL end blocks 6040305 */ + /* APPLE LOCAL blocks 6040305 (cl) */ + else if ((code0 == POINTER_TYPE || code0 == BLOCK_POINTER_TYPE || TYPE_PTRMEM_P (type0)) && null_ptr_cst_p (op1)) result_type = type0; - else if ((code1 == POINTER_TYPE || TYPE_PTRMEM_P (type1)) + /* APPLE LOCAL blocks 6040305 (cl) */ + else if ((code1 == POINTER_TYPE || code1 == BLOCK_POINTER_TYPE || TYPE_PTRMEM_P (type1)) && null_ptr_cst_p (op0)) result_type = type1; - else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) + /* APPLE LOCAL blocks 6040305 (cl) */ + else if ((code0 == POINTER_TYPE || code0 == BLOCK_POINTER_TYPE) && code1 == INTEGER_TYPE) { result_type = type0; error ("ISO C++ forbids comparison between pointer and integer"); } - else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE) + /* APPLE LOCAL blocks 6040305 (cl) */ + else if (code0 == INTEGER_TYPE && (code1 == POINTER_TYPE || code1 == BLOCK_POINTER_TYPE)) { result_type = type1; error ("ISO C++ forbids comparison between pointer and integer"); @@ -5362,6 +5389,30 @@ else if (TYPE_PTR_P (type) && INTEGRAL_OR_ENUMERATION_TYPE_P (intype)) /* OK */ ; + /* APPLE LOCAL begin blocks 6040305 (ck) */ + else if (TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (intype) == BLOCK_POINTER_TYPE) + { + if (TYPE_PRECISION (type) < TYPE_PRECISION (intype)) + pedwarn ("cast from %qT to %qT loses precision", + intype, type); + } + else if (TREE_CODE (type) == BLOCK_POINTER_TYPE && TREE_CODE (intype) == INTEGER_TYPE) + /* OK */ + ; + else if (TREE_CODE (type) == BLOCK_POINTER_TYPE && TREE_CODE (intype) == BLOCK_POINTER_TYPE) + /* OK */ + ; + else if (TREE_CODE (intype) == BLOCK_POINTER_TYPE + && (objc_is_id (type) + || (TREE_CODE (type) == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (type))))) + /* OK */ + ; + else if (TREE_CODE (type) == BLOCK_POINTER_TYPE + && TREE_CODE (intype) == POINTER_TYPE + && (objc_is_id (intype) || VOID_TYPE_P (TREE_TYPE (intype)))) + /* OK */ + ; + /* APPLE LOCAL end blocks 6040305 (ck) */ else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype)) || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype))) return fold_if_not_in_template (build_nop (type, expr)); @@ -6787,6 +6838,10 @@ if (TREE_CODE (valtype) == REFERENCE_TYPE) warning (0, "reference to local variable %q+D returned", whats_returned); + /* APPLE LOCAL begin blocks 6040305 (cn) */ + else if (TREE_CODE (valtype) == BLOCK_POINTER_TYPE) + error ("returning block that lives on the local stack"); + /* APPLE LOCAL end blocks 6040305 (cn) */ else warning (0, "address of local variable %q+D returned", whats_returned); @@ -6794,6 +6849,50 @@ } } +/* APPLE LOCAL begin blocks 6040305 (cm) */ +static bool +types_are_block_compatible (tree t1, tree t2) +{ + return comptypes (t1, t2, COMPARE_STRICT); +} + +#if 0 +/** + build_block_call - Routine to build a block call; as in: + ((double(*)(struct invok_impl *, int))(BLOCK_PTR_VAR->FuncPtr))(I, 42); + FNTYPE is the original function type derived from the syntax. + FUNCTION is the4 block pointer variable. + PARAMS is the parameter list. +*/ +static tree +build_block_call (tree fntype, tree function, tree params) +{ + tree block_ptr_exp; + tree function_ptr_exp; + tree typelist; + + /* (struct invok_impl *)BLOCK_PTR_VAR */ + /* First convert it to 'void *'. */ + block_ptr_exp = convert (ptr_type_node, function); + gcc_assert (invoke_impl_ptr_type); + block_ptr_exp = convert (invoke_impl_ptr_type, block_ptr_exp); + params = tree_cons (NULL_TREE, block_ptr_exp, params); + /* BLOCK_PTR_VAR->FuncPtr */ + function_ptr_exp = + build_component_ref (build_indirect_ref (block_ptr_exp, "->"), + get_identifier ("FuncPtr")); + + /* Build: result_type(*)(struct invok_impl *, function-arg-type-list) */ + typelist = TYPE_ARG_TYPES (fntype); + typelist = tree_cons (NULL_TREE, invoke_impl_ptr_type, typelist); + fntype = build_function_type (TREE_TYPE (fntype), typelist); + function_ptr_exp = convert (build_pointer_type (fntype), function_ptr_exp); + return fold_build3 (CALL_EXPR, TREE_TYPE (fntype), + function_ptr_exp, params, NULL_TREE); +} +#endif +/* APPLE LOCAL end blocks 6040305 (cm) */ + /* Check that returning RETVAL from the current function is valid. Return an expression explicitly showing all conversions required to change RETVAL into the function return type, and to assign it to @@ -6843,6 +6942,50 @@ return retval; } + /* APPLE LOCAL begin blocks 6040305 (cm) */ + if (cur_block) + { + if (cur_block->return_type == NULL_TREE) + { + if (retval) + cur_block->return_type = TYPE_MAIN_VARIANT (TREE_TYPE (retval)); + else + cur_block->return_type = void_type_node; + /* FIXME - is this copy ctor safe? */ + return retval; + } + + /* Otherwise, verify that this result type matches the previous one. We are + pickier with blocks than for normal functions because this is a new + feature and we set the rules. */ + if (TREE_CODE (cur_block->return_type) == VOID_TYPE) + { + if (retval) + { + error ("void block should not return a value"); + retval = NULL_TREE; + } + return retval; + } + + if (!retval) + { + error ("non-void block should return a value"); + return retval; + } + + /* We have a non-void block with an expression, continue checking. */ + valtype = TREE_TYPE (retval); + + /* For now, restrict multiple return statements in a block to have + strict compatible types only. */ + if (!types_are_block_compatible (cur_block->return_type, valtype)) + error ("incompatible type returning %qT, expected %qT", + valtype, cur_block->return_type); + return retval; + } + /* APPLE LOCAL end blocks 6040305 (cm) */ + /* When no explicit return-value is given in a function with a named return value, the named return value is used. */ result = DECL_RESULT (current_function_decl); Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Tue Jul 29 23:41:34 2008 @@ -8418,6 +8418,8 @@ case ERROR_MARK: return error_mark_node; + /* APPLE LOCAL radar 5732232 - blocks */ + case BLOCK_POINTER_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: return type_main_variant (root_type (TREE_TYPE (type))); @@ -8450,6 +8452,8 @@ case ENUMERAL_TYPE: case FUNCTION_TYPE: case METHOD_TYPE: + /* APPLE LOCAL radar 5732232 - blocks */ + case BLOCK_POINTER_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: @@ -8637,7 +8641,8 @@ mod_type_die = new_die (DW_TAG_volatile_type, comp_unit_die, type); sub_die = modified_type_die (type, 0, 0, context_die); } - else if (code == POINTER_TYPE) + /* APPLE LOCAL radar 5732232 - blocks */ + else if (code == POINTER_TYPE || code == BLOCK_POINTER_TYPE) { mod_type_die = new_die (DW_TAG_pointer_type, comp_unit_die, type); add_AT_unsigned (mod_type_die, DW_AT_byte_size, @@ -12986,6 +12991,8 @@ case ERROR_MARK: break; + /* APPLE LOCAL radar 5732232 - blocks */ + case BLOCK_POINTER_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: /* We must set TREE_ASM_WRITTEN in case this is a recursive type. This Modified: llvm-gcc-4.2/trunk/gcc/expr.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/expr.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/expr.c (original) +++ llvm-gcc-4.2/trunk/gcc/expr.c Tue Jul 29 23:41:34 2008 @@ -160,6 +160,8 @@ static void do_tablejump (rtx, enum machine_mode, rtx, rtx, rtx); static rtx const_vector_from_tree (tree); static void write_complex_part (rtx, rtx, bool); +/* APPLE LOCAL bswap uxtb16 support */ +static rtx look_for_bytemanip (tree, rtx); /* Record for each mode whether we can move a register directly to or from an object of that mode in memory. If we can't, we won't try @@ -4811,6 +4813,8 @@ case ENUMERAL_TYPE: case BOOLEAN_TYPE: case POINTER_TYPE: + /* APPLE LOCAL radar 5732232 - blocks */ + case BLOCK_POINTER_TYPE: case OFFSET_TYPE: case REFERENCE_TYPE: return 1; @@ -6771,7 +6775,7 @@ rtx expand_expr_real (tree exp, rtx target, enum machine_mode tmode, - enum expand_modifier modifier, rtx *alt_rtl) + enum expand_modifier modifier, rtx *alt_rtl) { int rn = -1; rtx ret, last = NULL; @@ -7857,6 +7861,26 @@ return REDUCE_BIT_FIELD (op0); } +/* APPLE LOCAL begin ARM improve (int) (longlong >> 32) */ +#ifdef TARGET_ARM + /* Look for (int) (longlong >> 32). This is just subreg:SI (longlong). + This is not a great place to do this. Signedness of shift does not + matter. */ + if (mode == SImode + && TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == DImode + && TREE_CODE (TREE_OPERAND (exp, 0)) == RSHIFT_EXPR + && TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 1)) == INTEGER_CST + && TREE_INT_CST_HIGH (TREE_OPERAND (TREE_OPERAND (exp, 0), 1)) == 0 + && TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (exp, 0), 1)) == 32) + { + op0 = expand_expr (TREE_OPERAND (TREE_OPERAND (exp, 0), 0), NULL_RTX, + DImode, 0); + op0 = simplify_gen_subreg (SImode, op0, DImode, 4); + } + else +#endif +/* APPLE LOCAL end ARM improve (int) (longlong >> 32) */ + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier); if (GET_MODE (op0) == mode) @@ -8496,12 +8520,23 @@ case TRUTH_AND_EXPR: code = BIT_AND_EXPR; +/* APPLE LOCAL begin bswap uxtb16 support */ + goto binop; + case BIT_AND_EXPR: + temp = look_for_bytemanip (exp, subtarget); + if (temp) + return REDUCE_BIT_FIELD (temp); goto binop; case TRUTH_OR_EXPR: code = BIT_IOR_EXPR; + goto binop; + case BIT_IOR_EXPR: + temp = look_for_bytemanip (exp, subtarget); + if (temp) + return REDUCE_BIT_FIELD (temp); goto binop; case TRUTH_XOR_EXPR: @@ -8511,6 +8546,11 @@ case LSHIFT_EXPR: case RSHIFT_EXPR: + temp = look_for_bytemanip (exp, subtarget); + if (temp) + return REDUCE_BIT_FIELD (temp); + /* fall through */ +/* APPLE LOCAL end bswap uxtb16 support */ case LROTATE_EXPR: case RROTATE_EXPR: if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) @@ -9588,4 +9628,391 @@ return gen_rtx_CONST_VECTOR (mode, v); } + +/* APPLE LOCAL begin bswap uxtb16 support */ + +/* This struct represents one shift-and-and sequence that moves one + or more bytes from input to output. + Shift may be 0, and mask may be all 1 bits. + In these cases the parent operator may be missing as well. */ + +#if defined (HAVE_bswapsi2) || defined (HAVE_bswapdi2) || defined (HAVE_uxtb16) +struct bytemanip +{ + int shiftcount; /* negative left, positive right, 0 none, + 666 ending sentinel */ + HOST_WIDE_INT andmask_high; /* both ffffffff if none */ + HOST_WIDE_INT andmask_low; /* both ffffffff if none */ + int bitmask; /* insn dependent, see below */ +}; +#endif + +#ifdef HAVE_bswapsi2 +/* Tables for bswapsi2. Bitmask values: + 1 = 0x00000000 000000ff used + 2 = 0x00000000 0000ff00 used + 4 = 0x00000000 00ff0000 used + 8 = 0x00000000 ff000000 used */ + +/* This table is for when the shift is done before the mask: + (x >> shift) & mask */ + +static struct bytemanip bswap32_shift_first[] = + { + { -24, 0x00000000, 0xff000000, 8 }, + { -8, 0x00000000, 0x00ff0000, 4 }, + { 8, 0x00000000, 0x0000ff00, 2 }, + { 24, 0x00000000, 0x000000ff, 1 }, + { -24, 0xffffffff, 0xffffffff, 8 }, + { 24, 0xffffffff, 0xffffffff, 1 }, + { 666, 0, 0, 0 } + }; + +/* This table is for when the shift is done after the mask: + (x & mask) >> shift */ + +static struct bytemanip bswap32_and_first[] = + { + { -24, 0x00000000, 0x000000ff, 8 }, + { -8, 0x00000000, 0x0000ff00, 4 }, + { 8, 0x00000000, 0x00ff0000, 2 }, + { 24, 0x00000000, 0xff000000, 1 }, + { 666, 0, 0, 0 } + }; +#endif /* HAVE_bswapsi2 */ + +#ifdef HAVE_bswapdi2 +/* Tables for bswapdi2, analogous to the above. Bitmask values: + 1 = 0x00000000 000000ff used + 2 = 0x00000000 0000ff00 used + 4 = 0x00000000 00ff0000 used + 8 = 0x00000000 ff000000 used + 16 = 0x000000ff 00000000 used + 32 = 0x0000ff00 00000000 used + 64 = 0x00ff0000 00000000 used + 128 = 0xff000000 00000000 used */ + +static struct bytemanip bswap64_shift_first[] = + { + { -56, 0xff000000, 0x00000000, 128 }, + { -40, 0x00ff0000, 0x00000000, 64 }, + { -24, 0x0000ff00, 0x00000000, 32 }, + { -8, 0x000000ff, 0x00000000, 16 }, + { 8, 0x00000000, 0xff000000, 8 }, + { 24, 0x00000000, 0x00ff0000, 4 }, + { 40, 0x00000000, 0x0000ff00, 2 }, + { 56, 0x00000000, 0x000000ff, 1 }, + { -56, 0xffffffff, 0xffffffff, 128 }, + { 56, 0xffffffff, 0xffffffff, 1 }, + { 666, 0, 0, 0 } + }; + +static struct bytemanip bswap64_and_first[] = + { + { -56, 0x00000000, 0x000000ff, 128 }, + { -40, 0x00000000, 0x0000ff00, 64 }, + { -24, 0x00000000, 0x00ff0000, 32 }, + { -8, 0x00000000, 0xff000000, 16 }, + { 8, 0x000000ff, 0x00000000, 8 }, + { 24, 0x0000ff00, 0x00000000, 4 }, + { 40, 0x00ff0000, 0x00000000, 2 }, + { 56, 0xff000000, 0x00000000, 1 }, + { 666, 0, 0, 0 } + }; +#endif /* HAVE_bswapdi2 */ + +#ifdef HAVE_uxtb16 +/* A uxtb16 instruction is currently only supported on the ARM + architecture. It zero-extends two selected bytes, at 16-bit + offsets from each other, into the two halfwords of the + destination register. */ +/* Tables for uxtb16, analogous to the above. Bitmask values: + 1 = 000000ff used ROR 0 + 2 = 00ff0000 used ROR 0 + 4 = 000000ff used ROR 8 + 8 = 00ff0000 used ROR 8 + 16 = 000000ff used ROR 16 + 32 = 00ff0000 used ROR 16 + 64 = 000000ff used ROR 24 + 128 = 00ff0000 used ROR 24 + Note that some of the table entries represent a 2-byte operation. */ + +static struct bytemanip uxtb16_shift_first[] = + { + { 0, 0x00000000, 0x00ff00ff, 3 }, + { 8, 0x00000000, 0x000000ff, 4 }, + { 8, 0x00000000, 0x00ff0000, 8 }, + { 8, 0x00000000, 0x00ff00ff, 12 }, + { 16, 0x00000000, 0x000000ff, 16 }, + { -16, 0x00000000, 0x00ff0000, 32 }, + { 24, 0x00000000, 0x000000ff, 64 }, + { -8, 0x00000000, 0x00ff0000, 128 }, + { 24, 0xffffffff, 0xffffffff, 64 }, + { 666, 0, 0, 0 } + }; + +static struct bytemanip uxtb16_and_first[] = + { + { 8, 0x00000000, 0x0000FF00, 4 }, + { 8, 0x00000000, 0xFF000000, 8 }, + { 8, 0x00000000, 0xFF00FF00, 12 }, + { 16, 0x00000000, 0x00FF0000, 16 }, + { -16, 0x00000000, 0x000000FF, 32 }, + { 24, 0x00000000, 0xFF000000, 64 }, + { -8, 0x00000000, 0x0000FF00, 128 }, + { 666, 0, 0, 0 } + }; +#endif /* HAVE_uxtb16 */ + +#if defined (HAVE_bswapsi2) || defined (HAVE_bswapdi2) || defined (HAVE_uxtb16) +/* Examine one operand (expected to handle 1 or more bytes of the whole) + to see if the shift count and mask match one of the valid pairs. A table + to look in is provided. */ + +static bool +find_and_record_values (tree lhs, HOST_WIDE_INT shiftcount, + HOST_WIDE_INT andmask_low, HOST_WIDE_INT andmask_high, + struct bytemanip *table, tree *operand, int *bitmask) +{ + int i; + /* All lhs's must be the same (pointer equality). Function calls, ++, etc. are not shared, + so won't match. */ + if (*operand != NULL_TREE && *operand != lhs) + return false; + *operand = lhs; + + for (i = 0; table[i].shiftcount != 666; i++) + { + if (shiftcount == table[i].shiftcount + && andmask_low == table[i].andmask_low + && andmask_high == table[i].andmask_high) + { + if ((*bitmask) & table[i].bitmask) + return false; + *bitmask |= table[i].bitmask; + return true; + } + } + return false; +} + +/* For ORs, just recurse to analyzing the operands. + For ANDs, look for ((x shift const) and const), + also for just (x and const) + For shifts, look for ((x & const) shift const), + also for just (x shift const) +*/ + +static bool +analyze_leg (tree t, int *bitmask, tree *operand, enum machine_mode mode, + struct bytemanip *shift_first, + struct bytemanip *and_first) +{ + HOST_WIDE_INT count; + bool m64_p; + + gcc_assert (HOST_BITS_PER_WIDE_INT == 32 || HOST_BITS_PER_WIDE_INT == 64); + m64_p = (HOST_BITS_PER_WIDE_INT == 64); + + if (!TYPE_UNSIGNED (TREE_TYPE (t)) || TYPE_MODE (TREE_TYPE (t)) != mode) + return false; + if (TREE_CODE (t) == BIT_IOR_EXPR) + { + if (!analyze_leg (TREE_OPERAND (t, 0), bitmask, operand, mode, + shift_first, and_first) + || !analyze_leg (TREE_OPERAND (t, 1), bitmask, operand, mode, + shift_first, and_first)) + return false; + } + else if (TREE_CODE (t) == BIT_AND_EXPR) + { + if (TREE_CODE (TREE_OPERAND (t, 1)) != INTEGER_CST) + return false; + if (TREE_CODE (TREE_OPERAND (t, 0)) == LSHIFT_EXPR + || TREE_CODE (TREE_OPERAND (t, 0)) == RSHIFT_EXPR) + { + if (TREE_CODE (TREE_OPERAND (TREE_OPERAND (t, 0), 1)) != INTEGER_CST) + return false; + if (!TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t, 0))) + || TYPE_MODE (TREE_TYPE (TREE_OPERAND (t, 0))) != mode) + return false; + count = TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (t, 0), 1)); + if (TREE_CODE (TREE_OPERAND (t, 0)) == LSHIFT_EXPR) + count = -count; + if (!find_and_record_values ( + TREE_OPERAND (TREE_OPERAND (t, 0), 0), + count, + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (t, 1)) & 0xffffffff + : TREE_INT_CST_LOW (TREE_OPERAND (t, 1)), + /* I'd really like ">> 32" here, but that generates a warning + when HOST_BITS_PER_WIDE_INT == 32 */ + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (t, 1)) / 0x100000000ll + : (unsigned HOST_WIDE_INT) + TREE_INT_CST_HIGH (TREE_OPERAND (t, 1)), + shift_first, + operand, + bitmask)) + return false; + } + else + if (!find_and_record_values ( + TREE_OPERAND (t, 0), + (HOST_WIDE_INT)0, + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (t, 1)) & 0xffffffff + : TREE_INT_CST_LOW (TREE_OPERAND (t, 1)), + /* I'd really like ">> 32" here, but that generates a warning + when HOST_BITS_PER_WIDE_INT == 32 */ + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (t, 1)) / 0x100000000ll + : (unsigned HOST_WIDE_INT) + TREE_INT_CST_HIGH (TREE_OPERAND (t, 1)), + shift_first, + operand, + bitmask)) + return false; + } + else if (TREE_CODE (t) == RSHIFT_EXPR + || TREE_CODE (t) == LSHIFT_EXPR) + { + if (TREE_CODE (TREE_OPERAND (t, 1)) != INTEGER_CST) + return false; + count = TREE_INT_CST_LOW (TREE_OPERAND (t, 1)); + if (TREE_CODE (t) == LSHIFT_EXPR) + count = -count; + if (TREE_CODE (TREE_OPERAND (t, 0)) == BIT_AND_EXPR + && TREE_CODE (TREE_OPERAND (TREE_OPERAND (t, 0), 1)) == INTEGER_CST) + { + if (!TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t, 0))) + || TYPE_MODE (TREE_TYPE (TREE_OPERAND (t, 0))) != mode) + return false; + if (!find_and_record_values ( + TREE_OPERAND (TREE_OPERAND (t, 0), 0), + count, + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (t, 0), 1)) & 0xffffffff + : TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (t, 0), 1)), + /* I'd really like ">> 32" here, but that generates a warning + when HOST_BITS_PER_WIDE_INT == 32 */ + m64_p ? TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (t, 0), 1)) / 0x100000000ll + : (unsigned HOST_WIDE_INT) + TREE_INT_CST_HIGH (TREE_OPERAND (TREE_OPERAND (t, 0), 1)), + and_first, + operand, + bitmask)) + return false; + } + else + if (!find_and_record_values ( + TREE_OPERAND (t, 0), + count, + (HOST_WIDE_INT) 0xffffffff, + (HOST_WIDE_INT) 0xffffffff, + shift_first, + operand, + bitmask)) + return false; + } + else + return false; + + return true; +} +#endif /* defined (HAVE_bswapsi2) || defined (HAVE_bswapdi2) || defined (HAVE_uxtb16) */ + +/* This is called for OR, AND, and SHIFT trees. + We look for the trees used to represent various byte manipulation + operations for which we have insn patterns on the target architecture. + Currently, these include: + 32-bit bswap: + (x<<24) | ((x & 0x0000ff00) << 8) + | ((x & 0x00ff0000) >> 8) | (x >> 24) + or alternatively + ((x <<24) & 0xff000000) | ((x << 8) & 0x00ff0000)) + | ((x >> 8) & 0x0000ff00) >> 8) | ((x >> 24) & 0x000000ff) + etc. + 64 bit bswap + uxtb16 + The table-driven code here is intended to handle arbitrary combinations + of byte movements like the above, provided all the bytes involved + are handled exactly once each. + If a match is found, the result is returned in a register. */ + +static rtx +look_for_bytemanip (tree t, rtx subtarget ATTRIBUTE_UNUSED) +{ + enum machine_mode mode; + + gcc_assert (TREE_CODE (t) == BIT_IOR_EXPR + || TREE_CODE (t) == BIT_AND_EXPR + || TREE_CODE (t) == LSHIFT_EXPR + || TREE_CODE (t) == RSHIFT_EXPR); + + if (!TYPE_UNSIGNED (TREE_TYPE (t))) + return NULL_RTX; + mode = TYPE_MODE (TREE_TYPE (t)); + if (mode != SImode && mode != DImode) + return NULL_RTX; + +#ifdef HAVE_bswapsi2 + if (HAVE_bswapsi2) + { + int bitmask = 0; + tree operand = NULL_TREE; + if (mode == SImode + && analyze_leg (t, &bitmask, &operand, mode, + bswap32_shift_first, bswap32_and_first) + && bitmask == 0xf) + { + /* This expression matches. Now generate RTL. */ + rtx x = expand_expr (operand, subtarget, VOIDmode, 0); + return expand_simple_unop (mode, BSWAP, x, NULL_RTX, 1); + } + } +#endif + +#ifdef HAVE_bswapdi2 + if (HAVE_bswapdi2) + { + int bitmask = 0; + tree operand = NULL_TREE; + if (mode == DImode + && analyze_leg (t, &bitmask, &operand, mode, + bswap64_shift_first, bswap64_and_first) + && bitmask == 0xff) + { + /* This expression matches. Now generate RTL. */ + rtx x = expand_expr (operand, subtarget, VOIDmode, 0); + return expand_simple_unop (mode, BSWAP, x, NULL_RTX, 1); + } + } +#endif + +#ifdef HAVE_uxtb16 + if (HAVE_uxtb16) + { + int bitmask = 0; + tree operand = NULL_TREE; + if (mode == SImode + && analyze_leg (t, &bitmask, &operand, mode, + uxtb16_shift_first, uxtb16_and_first) + && (bitmask == 0x3 || bitmask == 0xc || bitmask == 0x30 || bitmask == 0xc0)) + { + /* This expression matches. Now generate RTL. */ + rtx x = expand_expr (operand, subtarget, VOIDmode, 0); + x = force_reg (SImode, x); + x = gen_rtx_UNSPEC (SImode, + gen_rtvec (2, x, bitmask == 0x3 ? const0_rtx : + bitmask == 0xc ? gen_rtx_CONST_INT (SImode, 8) : + bitmask == 0x30 ? gen_rtx_CONST_INT (SImode, 16) : + /*bitmask == 0xc0*/ gen_rtx_CONST_INT (SImode, 24)), + UNSPEC_UXTB16); + x = force_reg (SImode, x); + return x; + } + } +#endif /* HAVE_uxtb16 */ + + /* Not an instruction we recognize. */ + return NULL_RTX; +} +/* APPLE LOCAL end bswap uxtb16 support */ + #include "gt-expr.h" Modified: llvm-gcc-4.2/trunk/gcc/function.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/function.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/function.c (original) +++ llvm-gcc-4.2/trunk/gcc/function.c Tue Jul 29 23:41:34 2008 @@ -114,6 +114,10 @@ post-instantiation libcalls. */ int virtuals_instantiated; +/* APPLE LOCAL begin radar 5732232 - blocks */ +struct block_sema_info *cur_block; +/* APPLE LOCAL end radar 5732232 - blocks */ + /* Assign unique numbers to labels generated for profiling, debugging, etc. */ static GTY(()) int funcdef_no; @@ -3869,17 +3873,23 @@ DECL_STRUCT_FUNCTION (fndecl) = cfun; cfun->decl = fndecl; - result = DECL_RESULT (fndecl); - if (aggregate_value_p (result, fndecl)) + /* APPLE LOCAL begin radar 5732232 - blocks */ + /* We cannot support blocks which return aggregates because at this + point we do not have info on the return type. */ + if (!cur_block) + { + result = DECL_RESULT (fndecl); + if (aggregate_value_p (result, fndecl)) { #ifdef PCC_STATIC_STRUCT_RETURN current_function_returns_pcc_struct = 1; #endif current_function_returns_struct = 1; } - - current_function_returns_pointer = POINTER_TYPE_P (TREE_TYPE (result)); - + /* This code is not used anywhere ! */ + current_function_returns_pointer = POINTER_TYPE_P (TREE_TYPE (result)); + } + /* APPLE LOCAL end radar 5732232 - blocks */ current_function_stdarg = (fntype && TYPE_ARG_TYPES (fntype) != 0 Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Tue Jul 29 23:41:34 2008 @@ -76,9 +76,11 @@ #include "langhooks-def.h" /* APPLE LOCAL optimization pragmas 3124235/3420242 */ #include "opts.h" +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM #include "llvm.h" /* for reset_initializer_llvm */ #endif +/* LLVM LOCAL end */ #define OBJC_VOID_AT_END void_list_node @@ -482,6 +484,8 @@ static const char *default_constant_string_class_name; /* APPLE LOCAL radar 4666559 */ static const struct gcc_debug_hooks *save_default_debug_hooks; +/* APPLE LOCAL radar 5932809 - copyable byref blocks */ +static int donot_warn_missing_methods; /* Runtime metadata flags. */ #define CLS_FACTORY 0x0001L @@ -1841,7 +1845,7 @@ and in accordance with C99 rules we generate: type temp; (temp = rhs, [lhs Setter:temp], temp) */ /* APPLE LOCAL begin radar 5279122 */ - rhs = default_conversion(rhs); + rhs = default_conversion (rhs); temp = objc_create_named_tmp_var (TREE_TYPE (rhs), "prop"); /* APPLE LOCAL end radar 5279122 */ bind = build3 (BIND_EXPR, void_type_node, temp, NULL, NULL); @@ -1855,7 +1859,7 @@ { comma_exp = objc_setter_func_call (receiver, prop_ident, rhs); /* APPLE LOCAL radar 5279122 */ - rhs = default_conversion(rhs); + rhs = default_conversion (rhs); /* APPLE LOCAL radar 5140757 */ temp = save_expr (rhs); /* APPLE LOCAL begin radar 4727191 */ @@ -4005,7 +4009,6 @@ var = build_decl (VAR_DECL, get_identifier (name), type); /* LLVM LOCAL end */ objc_set_global_decl_fields (var); - return var; } @@ -5011,6 +5014,7 @@ build_int_cst (long_integer_type_node, 0)); /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */ + if (flag_next_runtime || ! sel_ref_chain) /* APPLE LOCAL LLVM - begin NUL pointer */ initlist = tree_cons (NULL_TREE, @@ -5905,6 +5909,7 @@ sprintf (buf, "_OBJC_CLASS_REFERENCES_%d", class_reference_idx++); decl = start_var_decl (objc_class_type, buf); + return decl; } @@ -6198,13 +6203,13 @@ decl = build_objc_string_decl (section); type = build_array_type - (char_type_node, - build_index_type - (build_int_cst (NULL_TREE, - IDENTIFIER_LENGTH (ident)))); + (char_type_node, + build_index_type + (build_int_cst (NULL_TREE, + IDENTIFIER_LENGTH (ident)))); decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1, - IDENTIFIER_POINTER (ident)); + IDENTIFIER_POINTER (ident)); finish_var_decl (decl, string_expr); /* LLVM LOCAL begin */ @@ -6247,6 +6252,7 @@ else if (section == prop_names_attr) sprintf (buf, "_OBJC_PROP_NAME_ATTR_%d", property_name_attr_idx++); /* APPLE LOCAL end C* property metadata (Radar 4498373) */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM { @@ -6262,7 +6268,6 @@ #endif /* LLVM LOCAL end */ - decl = build_decl (VAR_DECL, ident, build_array_type (char_type_node, 0)); DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 0; @@ -6566,6 +6571,7 @@ /* APPLE LOCAL end radar 4982951 */ /* LLVM LOCAL - begin pointer arithmetic */ +#ifdef ENABLE_LLVM /* llvm-gcc intentionally preserves array notation &array[i] and avoids pointer arithmetic. @@ -6585,6 +6591,7 @@ base = TREE_OPERAND(expr, 0); return base && TREE_CODE(TREE_TYPE(base)) == ARRAY_TYPE; } +#endif /* LLVM LOCAL - end pointer arithmetic */ static tree @@ -6602,7 +6609,15 @@ newexpr), DECL_NAME (TREE_OPERAND (expr, 1))); /* LLVM LOCAL - begin pointer arithmetic */ +#ifndef ENABLE_LLVM + case ARRAY_REF: + return build_array_ref (objc_substitute_decl (TREE_OPERAND (expr, 0), + oldexpr, + newexpr), + TREE_OPERAND (expr, 1)); +#else /* Moved ARRAY_REF to "default" case */ +#endif /* LLVM LOCAL - end pointer arithmetic */ case INDIRECT_REF: /* APPLE LOCAL begin radar 4982951 */ @@ -6618,13 +6633,14 @@ newexpr), "->"); default: /* LLVM LOCAL - begin pointer arithmetic */ +#ifdef ENABLE_LLVM if (objc_is_really_array_ref(expr)) return build_array_ref (objc_substitute_decl (TREE_OPERAND (expr, 0), oldexpr, newexpr), TREE_OPERAND (expr, 1)); +#endif /* LLVM LOCAL - end pointer arithmetic */ - return expr; } } @@ -6906,7 +6922,11 @@ /* Zero in on the variable/parameter being assigned to. */ /* LLVM LOCAL - begin pointer arithmetic */ +#ifdef ENABLE_LLVM while (TREE_CODE (expr) == COMPONENT_REF || objc_is_really_array_ref(expr)) +#else + while (TREE_CODE (expr) == COMPONENT_REF || TREE_CODE (expr) == ARRAY_REF) +#endif /* LLVM LOCAL - end pointer arithmetic */ expr = TREE_OPERAND (expr, 0); @@ -6959,8 +6979,13 @@ static int objc_is_ivar_reference_p (tree expr) { - /* LLVM LOCAL pointer arithmetic */ + /* LLVM LOCAL - begin pointer arithmetic */ +#ifdef ENABLE_LLVM return (objc_is_really_array_ref(expr) == 1 +#else + return (TREE_CODE (expr) == ARRAY_REF +#endif + /* LLVM LOCAL - end pointer arithmetic */ ? objc_is_ivar_reference_p (TREE_OPERAND (expr, 0)) : TREE_CODE (expr) == COMPONENT_REF ? TREE_CODE (TREE_OPERAND (expr, 1)) == FIELD_DECL @@ -7033,8 +7058,13 @@ /* APPLE LOCAL end radar 4591756 */ while (outer && (TREE_CODE (outer) == COMPONENT_REF - /* LLVM LOCAL pointer arithmetic */ + /* LLVM LOCAL - begin pointer arithmetic */ +#ifdef ENABLE_LLVM || objc_is_really_array_ref(outer))) +#else + || TREE_CODE (outer) == ARRAY_REF)) +#endif + /* LLVM LOCAL - end pointer arithmetic */ outer = TREE_OPERAND (outer, 0); /* APPLE LOCAL objc2 */ @@ -7107,9 +7137,11 @@ return NULL_TREE; /* APPLE LOCAL end radar 4426814 */ - /* LLVM LOCAL 5541393 */ + /* LLVM LOCAL - begin 5541393 */ +#ifdef ENABLE_LLVM if (TREE_CODE(TREE_TYPE(lhs)) != POINTER_TYPE) return NULL_TREE; - +#endif + /* LLVM LOCAL - end 5541393 */ /* APPLE LOCAL begin ObjC GC */ /* Use the strong-cast write barrier as a last resort. */ if (warn_assign_intercept) @@ -7819,8 +7851,13 @@ /* APPPLE LOCAL radar 5023725 */ OBJC_FLAG_ZEROCOST_EXCEPTIONS; /* LLVM local begin */ +#ifdef ENABLE_LLVM llvm_eh_personality_libfunc = llvm_init_one_libfunc ("__objc_personality_v0"); +#else + eh_personality_libfunc + = init_one_libfunc ("__objc_personality_v0"); +#endif /* LLVM local end */ default_init_unwind_resume_libfunc (); using_eh_for_cleanups (); @@ -7834,10 +7871,17 @@ { c_eh_initialized_p = true; /* LLVM local begin */ +#ifdef ENABLE_LLVM llvm_eh_personality_libfunc = llvm_init_one_libfunc (USING_SJLJ_EXCEPTIONS ? "__gnu_objc_personality_sj0" : "__gnu_objc_personality_v0"); +#else + eh_personality_libfunc + = init_one_libfunc (USING_SJLJ_EXCEPTIONS + ? "__gnu_objc_personality_sj0" + : "__gnu_objc_personality_v0"); +#endif /* LLVM local end */ default_init_unwind_resume_libfunc (); using_eh_for_cleanups (); @@ -9394,9 +9438,9 @@ /* APPLE LOCAL LLVM - begin NUL pointer */ if (refs_decl) - refs_expr = - convert (build_pointer_type (build_pointer_type (objc_protocol_template)), - build_unary_op (ADDR_EXPR, refs_decl, 0)); + refs_expr = convert (build_pointer_type (build_pointer_type + (objc_protocol_template)), + build_unary_op (ADDR_EXPR, refs_decl, 0)); else refs_expr = convert (build_pointer_type (build_pointer_type (objc_protocol_template)), @@ -9451,7 +9495,11 @@ /* Force 4 byte alignment for protocols */ DECL_ALIGN(decl) = 32; DECL_USER_ALIGN(decl) = 1; +#endif + finish_var_decl (decl, initlist); + +#ifdef ENABLE_LLVM /* At -O0, we may have emitted references to the decl earlier. */ if (!optimize) reset_initializer_llvm(decl); @@ -9474,8 +9522,10 @@ /* APPLE LOCAL begin radar 4533974 - ObjC newprotocol - radar 4695109 */ /* APPLE LOCAL LLVM - begin NUL pointer */ if (newabi) - /* 'isa' is NULL in the new ObjC abi */ - expr = convert (objc_object_type, build_int_cst (NULL_TREE, 0)); + { + /* 'isa' is NULL in the new ObjC abi */ + expr = convert (objc_object_type, build_int_cst (NULL_TREE, 0)); + } /* APPLE LOCAL end radar 4533974 - ObjC newprotocol - radar 4695109 */ /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */ /* "isa" field now points to struct _objc_protocol_extension * */ @@ -9491,9 +9541,8 @@ build_int_cst (NULL_TREE, 0)); } else - expr = convert (build_pointer_type (objc_protocol_extension_template), - build_unary_op (ADDR_EXPR, - objc_protocol_or_opt_ins_meth, 0)); + expr = convert (build_pointer_type (objc_protocol_extension_template), + build_unary_op (ADDR_EXPR, objc_protocol_or_opt_ins_meth, 0)); } /* APPLE LOCAL LLVM - end NUL pointer */ /* APPLE LOCAL end radar 4585769 - Objective-C 1.0 extensions */ @@ -9544,24 +9593,24 @@ initlist); /* APPLE LOCAL LLVM - end NUL pointer */ else - { - expr = convert (objc_method_proto_list_ptr, - build_unary_op (ADDR_EXPR, objc_protocol_or_opt_ins_meth, 0)); - initlist = tree_cons (NULL_TREE, expr, initlist); - } + { + expr = convert (objc_method_proto_list_ptr, + build_unary_op (ADDR_EXPR, objc_protocol_or_opt_ins_meth, 0)); + initlist = tree_cons (NULL_TREE, expr, initlist); + } if (!opt_cls_meth) /* APPLE LOCAL LLVM - begin NUL pointer */ initlist = tree_cons (NULL_TREE, convert (objc_method_proto_list_ptr, build_int_cst (NULL_TREE, 0)), initlist); - /* APPLE LOCAL LLVM - end NUL pointer */ + /* APPLE LOCAL LLVM - end NUL pointer */ else - { - expr = convert (objc_method_proto_list_ptr, - build_unary_op (ADDR_EXPR, opt_cls_meth, 0)); - initlist = tree_cons (NULL_TREE, expr, initlist); - } + { + expr = convert (objc_method_proto_list_ptr, + build_unary_op (ADDR_EXPR, opt_cls_meth, 0)); + initlist = tree_cons (NULL_TREE, expr, initlist); + } /* APPLE LOCAL end radar 4695109 */ if (!property_list) /* APPLE LOCAL LLVM - begin NUL pointer */ @@ -9571,11 +9620,11 @@ initlist); /* APPLE LOCAL LLVM - end NUL pointer */ else - { - expr = convert (objc_prop_list_ptr, - build_unary_op (ADDR_EXPR, property_list, 0)); - initlist = tree_cons (NULL_TREE, expr, initlist); - } + { + expr = convert (objc_prop_list_ptr, + build_unary_op (ADDR_EXPR, property_list, 0)); + initlist = tree_cons (NULL_TREE, expr, initlist); + } /* APPLE LOCAL begin radar 5192466 */ /* const uint32_t size; = sizeof(struct protocol_t) */ expr = build_int_cst ( @@ -10578,11 +10627,8 @@ /* Unnamed bitfields are ignored. */ if (!DECL_NAME (field_decl)) { - /* LLVM LOCAL begin make sizes add up right */ - do { + do field_decl = TREE_CHAIN (field_decl); - } - /* LLVM LOCAL end */ while (field_decl && TREE_CODE (field_decl) != FIELD_DECL); continue; } @@ -10616,7 +10662,7 @@ obstack_free (&util_obstack, util_firstobj); /* Set alignment */ - /* APPLE LOCAL radar 5724385 */ + /* APPLE LOCAL begin radar 5724385 */ val = TYPE_ALIGN_UNIT ( DECL_BIT_FIELD_TYPE (field_decl) ? DECL_BIT_FIELD_TYPE (field_decl) : TREE_TYPE (field_decl)); @@ -10683,10 +10729,10 @@ obstack_free (&util_obstack, util_firstobj); /* Set offset. */ -/* LLVM LOCAL begin make initializer size match type size */ +/* LLVM LOCAL - begin make initializer size match type size */ ivar = tree_cons (NULL_TREE, convert (integer_type_node, byte_position (field_decl)), ivar); -/* LLVM LOCAL end */ +/* LLVM LOCAL - end */ initlist = tree_cons (NULL_TREE, objc_build_constructor (type, nreverse (ivar)), initlist); @@ -10972,7 +11018,7 @@ decl = start_var_decl (type, synth_id_with_class_suffix (name, objc_implementation_context)); - /* LLVM LOCAL begin make initializer size match type size */ + /* LLVM LOCAL - begin make initializer size match type size */ /* APPLE LOCAL ObjC new abi */ #ifdef OBJCPLUS initlist = build_tree_list (NULL_TREE, @@ -10982,7 +11028,7 @@ build_int_cst (newabi ? NULL_TREE : ptr_type_node, init_val)); #endif - /* LLVM LOCAL end */ + /* LLVM LOCAL - end make initializer size match type size */ initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, size), initlist); initlist = tree_cons (NULL_TREE, list, initlist); @@ -11930,7 +11976,7 @@ else { expr = convert (objc_v2_ivar_list_ptr, - build_unary_op (ADDR_EXPR, ivars, 0)); + build_unary_op (ADDR_EXPR, ivars, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -11959,7 +12005,7 @@ else { expr = convert (objc_prop_list_ptr, - build_unary_op (ADDR_EXPR, property_list, 0)); + build_unary_op (ADDR_EXPR, property_list, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } /* APPLE LOCAL end C* property metadata (Radar 4498373) */ @@ -12030,6 +12076,7 @@ gcc_assert (TREE_CODE (expr) == PROTOCOL_INTERFACE_TYPE); /* APPLE LOCAL begin radar 4695109 */ /* APPLE LOCAL begin - LLVM radar 5476262 */ +#ifdef ENABLE_LLVM /* LLVM LOCAL - add 'L' prefix */ sprintf (string, "L_OBJC_PROTOCOL_$_%s", IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); @@ -12037,6 +12084,11 @@ if (expr == NULL_TREE) /* LLVM LOCAL - &string[1] because of 'L' prefix */ expr = start_var_decl (objc_v2_protocol_template, &string[1]); +#else + sprintf (string, "_OBJC_PROTOCOL_$_%s", + IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + expr = start_var_decl (objc_v2_protocol_template, string); +#endif /* APPLE LOCAL end - LLVM radar 5476262 */ /* APPLE LOCAL end radar 4695109 */ expr = convert (objc_protocol_type, build_fold_addr_expr (expr)); @@ -13311,12 +13363,13 @@ /* If we are messaging an 'id' or 'Class' object and made it here, then we have failed to find _any_ instance or class method, respectively. */ - else + /* APPLE LOCAL radar 5932809 - copyable byref blocks */ + else if (!donot_warn_missing_methods) warning (0, "no %<%c%s%> method found", (class_tree ? '+' : '-'), IDENTIFIER_POINTER (sel_name)); - - if (!warn_missing_methods) + /* APPLE LOCAL radar 5932809 - copyable byref blocks */ + if (!warn_missing_methods && !donot_warn_missing_methods) { warning (0, "(Messages without a matching method signature"); warning (0, "will be assumed to return % and accept"); @@ -13352,8 +13405,19 @@ && TREE_TYPE (receiver) == objc_class_type)) check_for_nil = false; - /* LLVM LOCAL pr 1654 */ + /* LLVM LOCAL - begin PR1654 */ +#ifdef ENABLE_LLVM if (aggregate_value_p (ret_type, 0)) +#else + if (!targetm.calls.struct_value_rtx (0, 0) + && (TREE_CODE (ret_type) == RECORD_TYPE + || TREE_CODE (ret_type) == UNION_TYPE) + /* APPLE LOCAL begin radar 5080710 */ + && (TREE_ADDRESSABLE (ret_type) + || targetm.calls.return_in_memory (ret_type, 0))) + /* APPLE LOCAL end radar 5080710 */ +#endif + /* LLVM LOCAL - end PR1654 */ { if (super) message_func_decl = umsg_id_super2_stret_fixup_decl; @@ -13633,7 +13697,11 @@ proto_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL_$", p); decl = start_var_decl (objc_v2_protocol_template, proto_name); PROTOCOL_V2_FORWARD_DECL (p) = decl; + /* APPLE LOCAL begin - LLVM radar 5476262 */ +#ifdef ENABLE_LLVM pushdecl_top_level(decl); +#endif + /* APPLE LOCAL end - LLVM radar 5476262 */ } /* APPLE LOCAL end radar 4695109 */ @@ -13780,11 +13848,12 @@ proto_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL", p); decl = start_var_decl (objc_protocol_template, proto_name); /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Force 4 byte alignment for protocols */ DECL_ALIGN(decl) = 32; DECL_USER_ALIGN(decl) = 1; +#endif /* LLVM LOCAL end */ - PROTOCOL_FORWARD_DECL (p) = decl; } @@ -13974,7 +14043,8 @@ base = build_indirect_ref (self_decl, "->"); if ((ivar = objc_v2_build_ivar_ref (base, id))) return ivar; - return objc_build_component_ref (base, id); + else + return objc_build_component_ref (base, id); /* APPLE LOCAL end ObjC new abi */ } @@ -18482,7 +18552,6 @@ DECL_PRESERVE_P (decl) = 1; #endif /* LLVM LOCAL end */ - pushdecl (decl); rest_of_decl_compilation (decl, 0, 0); @@ -19487,6 +19556,7 @@ /* APPLE LOCAL end radar 4985544 - 5195402 */ /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* APPLE LOCAL begin radar 2996215 */ /* Objc wrapper to call libcpp's conversion routine. */ static bool @@ -19532,6 +19602,7 @@ finish_var_decl (decl, init); return decl; } +#endif /* APPLE LOCAL end radar 2996215 */ /* APPLE LOCAL begin radar 5202926 */ @@ -19599,5 +19670,64 @@ return; } /* APPLE LOCAL end radar 5376125 */ +/* APPLE LOCAL begin radar 5782740 - blocks */ +tree retain_block_component (tree exp) +{ + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + /* We do not want to warn on [id retain] message because we know what we + are doing. */ + tree ret_exp; + donot_warn_missing_methods = 1; + ret_exp = objc_finish_message_expr (exp, get_identifier ("retain"), NULL_TREE); + donot_warn_missing_methods = 0; + return ret_exp; + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ +} + +tree release_block_component (tree exp) +{ + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + /* We do not want to warn on [id release] message because we know what we + are doing. */ + tree ret_exp; + donot_warn_missing_methods = 1; + ret_exp = objc_finish_message_expr (exp, get_identifier ("release"), NULL_TREE); + donot_warn_missing_methods = 0; + return ret_exp; + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ +} + +/** copy_in_object - This routine for objective-c object pointers, returns + [ [EXP retain] autorelease ] expression which is used in initialization + of copied in variable used to set up a block literal struct. +*/ +tree copy_in_object (tree exp) +{ +/* APPLE LOCAL begin radar 5808305 */ + return exp; +#if 0 + tree msg_exp; + tree type = TREE_TYPE (exp); + if (!objc_is_object_ptr (type)) + return exp; + msg_exp = retain_block_component (exp); + msg_exp = objc_finish_message_expr (msg_exp, get_identifier ("autorelease"), NULL_TREE); + return msg_exp; +#endif +/* APPLE LOCAL end radar 5808305 */ +} +bool block_requires_copying (tree exp) +{ + return TREE_CODE (TREE_TYPE (exp)) == BLOCK_POINTER_TYPE || + objc_is_object_ptr (TREE_TYPE (exp)); +} +/* APPLE LOCAL end radar 5782740 - blocks */ +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +tree cast_to_pointer_to_id (tree exp) +{ + tree type = build_pointer_type (objc_object_type); + return build_c_cast (type, exp); +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ #include "gt-objc-objc-act.h" Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=54196&r1=54195&r2=54196&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Tue Jul 29 23:41:34 2008 @@ -3780,6 +3780,8 @@ extern void fixup_unsigned_type (tree); extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool); extern tree build_pointer_type (tree); +/* APPLE LOCAL radar 5732232 - blocks */ +extern tree build_block_pointer_type (tree); extern tree build_reference_type_for_mode (tree, enum machine_mode, bool); extern tree build_reference_type (tree); extern tree build_vector_type_for_mode (tree, enum machine_mode); From bruno.cardoso at gmail.com Wed Jul 30 11:59:00 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 30 Jul 2008 16:59:00 -0000 Subject: [llvm-commits] [llvm] r54212 - /llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Message-ID: <200807301659.m6UGx00T030608@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 30 11:58:59 2008 New Revision: 54212 URL: http://llvm.org/viewvc/llvm-project?rev=54212&view=rev Log: Instruction definition cleanup Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=54212&r1=54211&r2=54212&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Wed Jul 30 11:58:59 2008 @@ -100,11 +100,6 @@ return (uint64_t)N->getValue() == (unsigned short)N->getValue(); }], LO16>; -// Node immediate fits as 32-bit zero extended on target immediate. -//def immZExt32 : PatLeaf<(imm), [{ -// return (uint64_t)N->getValue() == (uint32_t)N->getValue(); -//}], LO16>; - // shamt field must fit in 5 bits. def immZExt5 : PatLeaf<(imm), [{ return N->getValue() == ((N->getValue()) & 0x1f) ; @@ -398,29 +393,29 @@ // MipsI Instructions //===----------------------------------------------------------------------===// -// Arithmetic - -// ADDiu just accept 16-bit immediates but we handle this on Pat's. -// immZExt32 is used here so it can match GlobalAddress immediates. -// MUL is a assembly macro in the current used ISAs. +/// Arithmetic Instructions (ALU Immediate) def ADDiu : ArithI<0x09, "addiu", add, uimm16, immZExt16>; def ADDi : ArithI<0x08, "addi", add, simm16, immSExt16>; -//def MUL : ArithR<0x1c, 0x02, "mul", mul, IIImul>; +def SLTi : SetCC_I<0x0a, "slti", setlt, simm16, immSExt16>; +def SLTiu : SetCC_I<0x0b, "sltiu", setult, uimm16, immZExt16>; +def ANDi : LogicI<0x0c, "andi", and>; +def ORi : LogicI<0x0d, "ori", or>; +def XORi : LogicI<0x0e, "xori", xor>; +def LUi : LoadUpper<0x0f, "lui">; + +/// Arithmetic Instructions (3-Operand, R-Type) def ADDu : ArithR<0x00, 0x21, "addu", add, IIAlu>; def SUBu : ArithR<0x00, 0x23, "subu", sub, IIAlu>; def ADD : ArithOverflowR<0x00, 0x20, "add">; def SUB : ArithOverflowR<0x00, 0x22, "sub">; - -// Logical +def SLT : SetCC_R<0x00, 0x2a, "slt", setlt>; +def SLTu : SetCC_R<0x00, 0x2b, "sltu", setult>; def AND : LogicR<0x24, "and", and>; def OR : LogicR<0x25, "or", or>; def XOR : LogicR<0x26, "xor", xor>; -def ANDi : LogicI<0x0c, "andi", and>; -def ORi : LogicI<0x0d, "ori", or>; -def XORi : LogicI<0x0e, "xori", xor>; def NOR : LogicNOR<0x00, 0x27, "nor">; -// Shifts +/// Shift Instructions def SLL : LogicR_shift_imm<0x00, "sll", shl>; def SRL : LogicR_shift_imm<0x02, "srl", srl>; def SRA : LogicR_shift_imm<0x03, "sra", sra>; @@ -428,10 +423,7 @@ def SRLV : LogicR_shift_reg<0x06, "srlv", srl>; def SRAV : LogicR_shift_reg<0x07, "srav", sra>; -// Load Upper Immediate -def LUi : LoadUpper<0x0f, "lui">; - -// Load/Store +/// Load and Store Instructions def LB : LoadM<0x20, "lb", sextloadi8>; def LBu : LoadM<0x24, "lbu", zextloadi8>; def LH : LoadM<0x21, "lh", sextloadi16>; @@ -441,62 +433,54 @@ def SH : StoreM<0x29, "sh", truncstorei16>; def SW : StoreM<0x2b, "sw", store>; -// Conditional Branch +/// Jump and Branch Instructions +def J : JumpFJ<0x02, "j">; +def JR : JumpFR<0x00, 0x08, "jr">; +def JAL : JumpLink<0x03, "jal">; +def JALR : JumpLinkReg<0x00, 0x09, "jalr">; def BEQ : CBranch<0x04, "beq", seteq>; def BNE : CBranch<0x05, "bne", setne>; let rt=1 in -def BGEZ : CBranchZero<0x01, "bgez", setge>; + def BGEZ : CBranchZero<0x01, "bgez", setge>; let rt=0 in { -def BGTZ : CBranchZero<0x07, "bgtz", setgt>; -def BLEZ : CBranchZero<0x07, "blez", setle>; -def BLTZ : CBranchZero<0x01, "bltz", setlt>; + def BGTZ : CBranchZero<0x07, "bgtz", setgt>; + def BLEZ : CBranchZero<0x07, "blez", setle>; + def BLTZ : CBranchZero<0x01, "bltz", setlt>; } -// Set Condition Code -def SLT : SetCC_R<0x00, 0x2a, "slt", setlt>; -def SLTu : SetCC_R<0x00, 0x2b, "sltu", setult>; -def SLTi : SetCC_I<0x0a, "slti", setlt, simm16, immSExt16>; -def SLTiu : SetCC_I<0x0b, "sltiu", setult, uimm16, immZExt16>; - -// Unconditional jump -def J : JumpFJ<0x02, "j">; -def JR : JumpFR<0x00, 0x08, "jr">; - -// Jump and Link (Call) -def JAL : JumpLink<0x03, "jal">; -def JALR : JumpLinkReg<0x00, 0x09, "jalr">; def BGEZAL : BranchLink<"bgezal">; def BLTZAL : BranchLink<"bltzal">; -// MulDiv and Move From Hi/Lo operations, have -// their correpondent SDNodes created on ISelDAG. -// Special Mul, Div operations +let isReturn=1, isTerminator=1, hasDelaySlot=1, + isBarrier=1, hasCtrlDep=1, rs=0, rt=0, shamt=0 in + def RET : FR <0x00, 0x02, (outs), (ins CPURegs:$target), + "jr\t$target", [(MipsRet CPURegs:$target)], IIBranch>; + +/// Multiply and Divide Instructions. def MULT : MulDiv<0x18, "mult", IIImul>; def MULTu : MulDiv<0x19, "multu", IIImul>; def DIV : MulDiv<0x1a, "div", IIIdiv>; def DIVu : MulDiv<0x1b, "divu", IIIdiv>; - -// Move From Hi/Lo def MFHI : MoveFromTo<0x10, "mfhi">; def MFLO : MoveFromTo<0x12, "mflo">; def MTHI : MoveFromTo<0x11, "mthi">; def MTLO : MoveFromTo<0x13, "mtlo">; -// No operation -let addr=0 in -def NOP : FJ<0, (outs), (ins), "nop", [], IIAlu>; +/// Sign Ext In Register Instructions. +let Predicates = [HasSEInReg] in { + let shamt = 0x10, rs = 0 in + def SEB : SignExtInReg<0x21, "seb", i8>; -// Ret instruction - as mips does not have "ret" a -// jr $ra must be generated. -let isReturn=1, isTerminator=1, hasDelaySlot=1, - isBarrier=1, hasCtrlDep=1, rs=0, rt=0, shamt=0 in -{ - def RET : FR <0x00, 0x02, (outs), (ins CPURegs:$target), - "jr\t$target", [(MipsRet CPURegs:$target)], IIBranch>; + let shamt = 0x18, rs = 0 in + def SEH : SignExtInReg<0x20, "seh", i16>; } +/// No operation +let addr=0 in + def NOP : FJ<0, (outs), (ins), "nop", [], IIAlu>; + // FrameIndexes are legalized when they are operands from load/store // instructions. The same not happens for stack address copies, so an // add op with mem ComplexPattern is used and the stack address copy @@ -516,13 +500,9 @@ //def MSUB : MArithR<0x04, "msub">; //def MSUBU : MArithR<0x05, "msubu">; -let Predicates = [HasSEInReg] in { - let shamt = 0x10, rs = 0 in - def SEB : SignExtInReg<0x21, "seb", i8>; - - let shamt = 0x18, rs = 0 in - def SEH : SignExtInReg<0x20, "seh", i16>; -} +// MUL is a assembly macro in the current used ISAs. In recent ISA's +// it is a real instruction. +//def MUL : ArithR<0x1c, 0x02, "mul", mul, IIImul>; //===----------------------------------------------------------------------===// // Arbitrary patterns that map to one or more instructions @@ -625,8 +605,8 @@ def : Pat<(brcond CPURegs:$cond, bb:$dst), (BNE CPURegs:$cond, ZERO, bb:$dst)>; -/// setcc patterns, only matched when there -/// is no brcond following a setcc operation +// setcc patterns, only matched when there +// is no brcond following a setcc operation def : Pat<(setle CPURegs:$lhs, CPURegs:$rhs), (XORi (SLT CPURegs:$rhs, CPURegs:$lhs), 1)>; def : Pat<(setule CPURegs:$lhs, CPURegs:$rhs), From bruno.cardoso at gmail.com Wed Jul 30 12:01:06 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 30 Jul 2008 17:01:06 -0000 Subject: [llvm-commits] [llvm] r54213 - in /llvm/trunk/lib/Target/Mips: Mips.td MipsSubtarget.cpp MipsSubtarget.h Message-ID: <200807301701.m6UH16AI030699@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 30 12:01:06 2008 New Revision: 54213 URL: http://llvm.org/viewvc/llvm-project?rev=54213&view=rev Log: Added new features to represent specific instructions groups Modified: llvm/trunk/lib/Target/Mips/Mips.td llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp llvm/trunk/lib/Target/Mips/MipsSubtarget.h Modified: llvm/trunk/lib/Target/Mips/Mips.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips.td?rev=54213&r1=54212&r2=54213&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/Mips.td (original) +++ llvm/trunk/lib/Target/Mips/Mips.td Wed Jul 30 12:01:06 2008 @@ -49,6 +49,16 @@ "true", "Enable vector FPU instructions.">; def FeatureSEInReg : SubtargetFeature<"seinreg", "HasSEInReg", "true", "Enable 'signext in register' instructions.">; +def FeatureCondMov : SubtargetFeature<"condmov", "HasCondMov", "true", + "Enable 'conditional move' instructions.">; +def FeatureMulDivAdd : SubtargetFeature<"muldivadd", "HasMulDivAdd", "true", + "Enable 'multiply add/sub' instructions.">; +def FeatureMinMax : SubtargetFeature<"minmax", "HasMinMax", "true", + "Enable 'min/max' instructions.">; +def FeatureSwap : SubtargetFeature<"swap", "HasSwap", "true", + "Enable 'byte/half swap' instructions.">; +def FeatureBitCount : SubtargetFeature<"bitcount", "HasBitCount", "true", + "Enable 'count leading bits' instructions.">; //===----------------------------------------------------------------------===// // Mips processors supported. @@ -65,9 +75,11 @@ def : Proc<"r6000", [FeatureMips2]>; // Allegrex is a 32bit subset of r4000, both for interger and fp registers, -// but much more similar to Mips2 than Mips3. +// but much more similar to Mips2 than Mips3. It also contains some of +// Mips32/Mips32r2 instructions and a custom vector fpu processor. def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI, - FeatureSEInReg, FeatureVFPU]>; + FeatureVFPU, FeatureSEInReg, FeatureCondMov, FeatureMulDivAdd, + FeatureMinMax, FeatureSwap, FeatureBitCount]>; def Mips : Target { let InstructionSet = MipsInstrInfo; Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp?rev=54213&r1=54212&r2=54213&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp Wed Jul 30 12:01:06 2008 @@ -29,8 +29,9 @@ MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, const std::string &FS, bool little) : MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), - IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false), - HasABICall(true), HasAbsoluteCall(false), IsLinux(true) + IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasABICall(true), + HasAbsoluteCall(false), IsLinux(true), HasSEInReg(false), HasCondMov(false), + HasMulDivAdd(false), HasMinMax(false), HasSwap(false), HasBitCount(false) { std::string CPU = "mips1"; Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.h?rev=54213&r1=54212&r2=54213&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsSubtarget.h (original) +++ llvm/trunk/lib/Target/Mips/MipsSubtarget.h Wed Jul 30 12:01:06 2008 @@ -58,9 +58,6 @@ // HasVFPU - Processor has a vector floating point unit. bool HasVFPU; - // HasSEInReg - Target has SEB and SEH (signext in register) instructions. - bool HasSEInReg; - // IsABICall - Enable SRV4 code for SVR4-style dynamic objects bool HasABICall; @@ -75,6 +72,27 @@ // bytes into the small data or bss section. The default is 8. unsigned SSectionThreshold; + /// Features related to the presence of specific instructions. + + // HasSEInReg - SEB and SEH (signext in register) instructions. + bool HasSEInReg; + + // HasCondMov - Conditional mov (MOVZ, MOVN) instructions. + bool HasCondMov; + + // HasMulDivAdd - Multiply add and sub (MADD, MADDu, MSUB, MSUBu) + // instructions. + bool HasMulDivAdd; + + // HasMinMax - MIN and MAX instructions. + bool HasMinMax; + + // HasSwap - Byte and half swap instructions. + bool HasSwap; + + // HasBitCount - Count leading '1' and '0' bits. + bool HasBitCount; + InstrItineraryData InstrItins; public: @@ -102,12 +120,18 @@ bool isSingleFloat() const { return IsSingleFloat; }; bool isNotSingleFloat() const { return !IsSingleFloat; }; bool hasVFPU() const { return HasVFPU; }; - bool hasSEInReg() const { return HasSEInReg; }; bool hasABICall() const { return HasABICall; }; bool hasAbsoluteCall() const { return HasAbsoluteCall; }; bool isLinux() const { return IsLinux; }; unsigned getSSectionThreshold() const { return SSectionThreshold; } + /// Features related to the presence of specific instructions. + bool hasSEInReg() const { return HasSEInReg; }; + bool hasCondMov() const { return HasCondMov; }; + bool hasMulDivAdd() const { return HasMulDivAdd; }; + bool hasMinMax() const { return HasMinMax; }; + bool hasSwap() const { return HasSwap; }; + bool hasBitCount() const { return HasBitCount; }; }; } // End llvm namespace From bruno.cardoso at gmail.com Wed Jul 30 12:04:04 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 30 Jul 2008 17:04:04 -0000 Subject: [llvm-commits] [llvm] r54214 - in /llvm/trunk/lib/Target/Mips: MipsTargetAsmInfo.cpp MipsTargetAsmInfo.h Message-ID: <200807301704.m6UH44iN030804@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 30 12:04:04 2008 New Revision: 54214 URL: http://llvm.org/viewvc/llvm-project?rev=54214&view=rev Log: Removed small section flag for mips, the assembler doesnt support this flag Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=54214&r1=54213&r2=54214&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Wed Jul 30 12:04:04 2008 @@ -45,8 +45,16 @@ } -SectionKind::Kind -MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { +unsigned MipsTargetAsmInfo:: +SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const { + unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name); + // Mask out Small Section flag bit, Mips doesnt support 's' section symbol + // for its small sections. + return (Flags & (~SectionFlags::Small)); +} + +SectionKind::Kind MipsTargetAsmInfo:: +SectionKindForGlobal(const GlobalValue *GV) const { SectionKind::Kind K = ELFTargetAsmInfo::SectionKindForGlobal(GV); if (Subtarget->hasABICall()) @@ -72,8 +80,8 @@ return K; } -const Section* -MipsTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { +const Section* MipsTargetAsmInfo:: +SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind K = SectionKindForGlobal(GV); const GlobalVariable *GVA = dyn_cast(GV); Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h?rev=54214&r1=54213&r2=54214&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Wed Jul 30 12:04:04 2008 @@ -34,6 +34,12 @@ virtual SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const; + /// SectionFlagsForGlobal - This hook allows the target to select proper + /// section flags either for given global or for section. + virtual unsigned + SectionFlagsForGlobal(const GlobalValue *GV = NULL, + const char* name = NULL) const; + virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; private: From isanbard at gmail.com Wed Jul 30 02:50:14 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 07:50:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54207 - in /llvm-gcc-4.2/trunk/gcc: c-opts.c c-typeck.c calls.c cppdefault.c except.c gimplify.c stor-layout.c Message-ID: <200807300750.m6U7oEq4003937@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 02:50:13 2008 New Revision: 54207 URL: http://llvm.org/viewvc/llvm-project?rev=54207&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c llvm-gcc-4.2/trunk/gcc/c-typeck.c llvm-gcc-4.2/trunk/gcc/calls.c llvm-gcc-4.2/trunk/gcc/cppdefault.c llvm-gcc-4.2/trunk/gcc/except.c llvm-gcc-4.2/trunk/gcc/gimplify.c llvm-gcc-4.2/trunk/gcc/stor-layout.c Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 02:50:13 2008 @@ -168,6 +168,8 @@ case OPT_isysroot: case OPT_isystem: case OPT_iquote: + /* APPLE LOCAL ARM iwithsysroot 4917039 */ + case OPT_iwithsysroot: error ("missing path after %qs", opt); break; @@ -918,6 +920,15 @@ sysroot = arg; break; + /* APPLE LOCAL begin ARM iwithsysroot 4917039 */ + case OPT_iwithsysroot: + if (arg[0] != '/' || !sysroot) + add_path (xstrdup (arg), SYSTEM, 0, true); + else + add_path (concat (sysroot, arg, NULL), SYSTEM, 0, true); + break; + /* APPLE LOCAL end ARM iwithsysroot 4917039 */ + case OPT_isystem: add_path (xstrdup (arg), SYSTEM, 0, true); break; @@ -1103,6 +1114,13 @@ if (flag_inline_functions) flag_inline_trees = 2; + /* APPLE LOCAL begin radar 5811887 - radar 6084601 */ + /* In all flavors of c99, except for ObjC/ObjC++, blocks are off by default + unless requested via -fblocks. */ + if (flag_blocks == -1 && flag_iso && !c_dialect_objc()) + flag_blocks = 0; + /* APPLE LOCAL end radar 5811887 - radar 6084601 */ + /* APPLE LOCAL begin mainline */ /* By default we use C99 inline semantics in GNU99 or C99 mode. C99 inline semantics are not supported in GNU89 or C89 mode. */ Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Wed Jul 30 02:50:13 2008 @@ -853,6 +853,13 @@ switch (TREE_CODE (t1)) { + /* APPLE LOCAL begin radar 5795493 */ + case BLOCK_POINTER_TYPE: + val = (TREE_CODE (t2) == BLOCK_POINTER_TYPE) && + types_are_block_compatible (TREE_TYPE (t1), TREE_TYPE (t2)); + break; + + /* APPLE LOCAL end radar 5795493 */ case POINTER_TYPE: /* Do not remove mode or aliasing information. */ if (TYPE_MODE (t1) != TYPE_MODE (t2) @@ -8749,8 +8756,12 @@ case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: if ((code0 == INTEGER_TYPE || code0 == POINTER_TYPE + /* APPLE LOCAL radar 5928316 */ + || code0 == BLOCK_POINTER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE) && (code1 == INTEGER_TYPE || code1 == POINTER_TYPE + /* APPLE LOCAL radar 5928316 */ + || code1 == BLOCK_POINTER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE)) { /* Result of these operations is always an int, Modified: llvm-gcc-4.2/trunk/gcc/calls.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/calls.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/calls.c (original) +++ llvm-gcc-4.2/trunk/gcc/calls.c Wed Jul 30 02:50:13 2008 @@ -2117,7 +2117,8 @@ /* Operand 0 is a pointer-to-function; get the type of the function. */ funtype = TREE_TYPE (addr); - gcc_assert (POINTER_TYPE_P (funtype)); + /* APPLE LOCAL blocks */ + gcc_assert (POINTER_TYPE_P (funtype) || TREE_CODE (funtype) == BLOCK_POINTER_TYPE); funtype = TREE_TYPE (funtype); /* APPLE LOCAL begin objc stret methods */ Modified: llvm-gcc-4.2/trunk/gcc/cppdefault.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cppdefault.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cppdefault.c (original) +++ llvm-gcc-4.2/trunk/gcc/cppdefault.c Wed Jul 30 02:50:13 2008 @@ -46,11 +46,6 @@ /* APPLE LOCAL begin SDK 3886137. */ /* Allow -isysroot to override ALL include patchs. This is done by setting add_sysroot for all default inclue paths. */ -#ifdef CONFIG_DARWIN_H -#define ADD_SYSROOT 1 -#else -#define ADD_SYSROOT 0 -#endif const struct default_include cpp_include_defaults[] #ifdef INCLUDE_DEFAULTS = INCLUDE_DEFAULTS; @@ -58,34 +53,34 @@ = { #ifdef GPLUSPLUS_INCLUDE_DIR /* Pick up GNU C++ generic include files. */ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 0 }, + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, #endif #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR /* Pick up GNU C++ target-dependent include files. */ - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 1 }, + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 }, #endif #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR /* Pick up GNU C++ backward and deprecated include files. */ - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 0 }, + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, #endif #ifdef LOCAL_INCLUDE_DIR /* /usr/local/include comes before the fixincluded header files. */ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, #endif #ifdef PREFIX_INCLUDE_DIR - { PREFIX_INCLUDE_DIR, 0, 0, 1, ADD_SYSROOT, 0 }, + { PREFIX_INCLUDE_DIR, 0, 0, 1, 1, 0 }, #endif #ifdef GCC_INCLUDE_DIR /* This is the dir for fixincludes and for gcc's private headers. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0, ADD_SYSROOT, 0 }, + { GCC_INCLUDE_DIR, "GCC", 0, 0, 1, 0 }, #endif #ifdef CROSS_INCLUDE_DIR /* One place the target system's headers might be. */ - { CROSS_INCLUDE_DIR, "GCC", 0, 0, ADD_SYSROOT, 0 }, + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 1, 0 }, #endif #ifdef TOOL_INCLUDE_DIR /* Another place the target system's headers might be. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, ADD_SYSROOT, 0 }, + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 1, 0 }, #endif #ifdef SYSTEM_INCLUDE_DIR /* Some systems have an extra dir of include files. */ @@ -99,7 +94,6 @@ }; #endif /* no INCLUDE_DEFAULTS */ -#undef ADD_SYSROOT /* APPLE LOCAL end SDK 3886137. */ #ifdef GCC_INCLUDE_DIR Modified: llvm-gcc-4.2/trunk/gcc/except.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/except.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/except.c (original) +++ llvm-gcc-4.2/trunk/gcc/except.c Wed Jul 30 02:50:13 2008 @@ -96,8 +96,10 @@ tree (*lang_eh_runtime_type) (tree); /* LLVM local begin */ +#ifdef ENABLE_LLVM /* Return a type that catches all others */ tree (*lang_eh_catch_all) (void); +#endif /* LLVM local end */ /* A hash table of label to region number. */ @@ -260,8 +262,11 @@ static int t2r_eq (const void *, const void *); static hashval_t t2r_hash (const void *); static void add_type_for_runtime (tree); -/* LLVM local */ -/* static tree lookup_type_for_runtime (tree); */ +/* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static tree lookup_type_for_runtime (tree); +#endif +/* LLVM LOCAL end */ static void remove_unreachable_regions (rtx); @@ -571,7 +576,8 @@ region->tree_label = lab; } -/* LLVM local begin */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM int classify_eh_handler (struct eh_region *region) { @@ -624,7 +630,8 @@ gcc_unreachable(); } } -/* LLVM local end */ +#endif +/* LLVM LOCAL end */ void @@ -1221,8 +1228,12 @@ } } -/* LLVM local */ +/* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif tree +/* LLVM LOCAL end */ lookup_type_for_runtime (tree type) { tree *slot; @@ -2650,21 +2661,21 @@ inline a subroutine that contains handlers, and that will change the value of saw_any_handlers. */ -/* LLVM local begin */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM if ((info && info->saw_any_handlers) || !cfun->after_inlining) { #endif -/* LLVM local end */ +/* LLVM LOCAL end */ add_reachable_handler (info, region, region); return RNL_CAUGHT; -/* LLVM local begin */ +/* LLVM LOCAL begin */ #ifndef ENABLE_LLVM } else return RNL_BLOCKED; #endif -/* LLVM local end */ +/* LLVM LOCAL end */ case ERT_THROW: case ERT_UNKNOWN: @@ -2716,12 +2727,12 @@ processing any more of them. Each cleanup will have an edge to the next outer cleanup region, so the flow graph will be accurate. */ -/* LLVM local */ +/* LLVM LOCAL */ #ifndef ENABLE_LLVM if (region->type == ERT_CLEANUP) region = region->u.cleanup.prev_try; else -/* LLVM local */ +/* LLVM LOCAL */ #endif region = region->outer; } @@ -4060,7 +4071,8 @@ default_init_unwind_resume_libfunc (void) { /* The default c++ routines aren't actually c++ specific, so use those. */ - /* LLVM local begin */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM llvm_unwind_resume_libfunc = llvm_init_one_libfunc ( USING_SJLJ_EXCEPTIONS ? "_Unwind_SjLj_Resume" #ifdef LLVM_STACKSENSITIVE_UNWIND_RESUME @@ -4068,7 +4080,12 @@ #else : "_Unwind_Resume"); #endif - /* LLVM local end */ +#else + unwind_resume_libfunc = + init_one_libfunc ( USING_SJLJ_EXCEPTIONS ? "_Unwind_SjLj_Resume" + : "_Unwind_Resume"); +#endif + /* LLVM LOCAL end */ } Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gimplify.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/gimplify.c Wed Jul 30 02:50:13 2008 @@ -1775,8 +1775,11 @@ gimplified. */ /* LLVM LOCAL begin */ /* Handle the LLVM extension that allows: (ARRAY_REF ptr, idx) */ - if (!TREE_OPERAND (t, 2) && - TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE) + if (!TREE_OPERAND (t, 2) +#ifdef ENABLE_LLVM + && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE +#endif + ) /* LLVM LOCAL end */ { tree low = unshare_expr (array_ref_low_bound (t)); @@ -1791,8 +1794,11 @@ /* LLVM LOCAL begin */ /* Handle the LLVM extension that allows: (ARRAY_REF ptr, idx) */ - if (!TREE_OPERAND (t, 3) && - TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE) + if (!TREE_OPERAND (t, 3) +#ifdef ENABLE_LLVM + && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE +#endif + ) /* LLVM LOCAL end */ { tree elmt_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0))); Modified: llvm-gcc-4.2/trunk/gcc/stor-layout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stor-layout.c?rev=54207&r1=54206&r2=54207&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stor-layout.c (original) +++ llvm-gcc-4.2/trunk/gcc/stor-layout.c Wed Jul 30 02:50:13 2008 @@ -533,6 +533,10 @@ start_record_layout (tree t) { record_layout_info rli = xmalloc (sizeof (struct record_layout_info_s)); + /* APPLE LOCAL begin 5946347 ms_struct support */ + unsigned biggest_alignment = targetm.ms_bitfield_layout_p (t) ? + BIGGEST_MS_STRUCT_ALIGNMENT + : BIGGEST_ALIGNMENT; rli->t = t; @@ -541,7 +545,8 @@ one-byte alignment. */ rli->record_align = MAX (BITS_PER_UNIT, TYPE_ALIGN (t)); rli->unpacked_align = rli->record_align; - rli->offset_align = MAX (rli->record_align, BIGGEST_ALIGNMENT); + rli->offset_align = MAX (rli->record_align, biggest_alignment); + /* APPLE LOCAL end 5946347 ms_struct support */ #ifdef STRUCTURE_SIZE_BOUNDARY /* APPLE LOCAL begin ARM Macintosh alignment */ @@ -729,7 +734,8 @@ && DECL_BIT_FIELD_TYPE (rli->prev_field) && ! integer_zerop (DECL_SIZE (rli->prev_field))))) { - unsigned int type_align = TYPE_ALIGN (type); + /* APPLE LOCAL 5946347 ms_struct support */ + unsigned int type_align = TARGET_FIELD_MS_STRUCT_ALIGN (field); type_align = MAX (type_align, desired_align); if (maximum_field_alignment != 0) type_align = MIN (type_align, maximum_field_alignment); @@ -1267,7 +1273,8 @@ } /* Now align (conventionally) for the new type. */ - type_align = TYPE_ALIGN (TREE_TYPE (field)); + /* APPLE LOCAL 5946347 ms_struct support */ + type_align = TARGET_FIELD_MS_STRUCT_ALIGN (field); if (maximum_field_alignment != 0) type_align = MIN (type_align, maximum_field_alignment); @@ -1879,6 +1886,8 @@ case POINTER_TYPE: case REFERENCE_TYPE: + /* APPLE LOCAL blocks */ + case BLOCK_POINTER_TYPE: { enum machine_mode mode = ((TREE_CODE (type) == REFERENCE_TYPE From isanbard at gmail.com Wed Jul 30 02:39:52 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 07:39:52 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54206 - in /llvm-gcc-4.2/trunk/gcc: c-pch.c c-pretty-print.c cp/parser.c crtstuff.c local-alloc.c objc/objc-act.c print-tree.c Message-ID: <200807300739.m6U7drfk031809@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 02:39:52 2008 New Revision: 54206 URL: http://llvm.org/viewvc/llvm-project?rev=54206&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/c-pch.c llvm-gcc-4.2/trunk/gcc/c-pretty-print.c llvm-gcc-4.2/trunk/gcc/cp/parser.c llvm-gcc-4.2/trunk/gcc/crtstuff.c llvm-gcc-4.2/trunk/gcc/local-alloc.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/print-tree.c Modified: llvm-gcc-4.2/trunk/gcc/c-pch.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-pch.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-pch.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-pch.c Wed Jul 30 02:39:52 2008 @@ -35,7 +35,10 @@ #include "hosthooks.h" #include "target.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif +/* LLVM LOCAL end */ /* This is a list of flag variables that must match exactly, and their names for the error message. The possible values for *flag_var must @@ -425,7 +428,6 @@ cpp_errno (pfile, CPP_DL_ERROR, "seeking"); } - cpp_prepare_state (pfile, &smd); gt_pch_restore (f); Modified: llvm-gcc-4.2/trunk/gcc/c-pretty-print.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-pretty-print.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-pretty-print.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-pretty-print.c Wed Jul 30 02:39:52 2008 @@ -137,6 +137,15 @@ pp_base (pp)->padding = pp_none; } +/* APPLE LOCAL begin blocks */ +void +pp_c_caret (c_pretty_printer *pp) +{ + pp_carret (pp); + pp_base (pp)->padding = pp_none; +} +/* APPLE LOCAL end blocks */ + void pp_c_arrow (c_pretty_printer *pp) { @@ -260,7 +269,13 @@ pp_c_ampersand (pp); pp_c_type_qualifier_list (pp, t); break; - + /* APPLE LOCAL begin blocks */ + case BLOCK_POINTER_TYPE: + pp_c_caret (pp); + pp_c_type_qualifier_list (pp, t); + break; + /* APPLE LOCAL end blocks */ + /* ??? This node is now in GENERIC and so shouldn't be here. But we'll fix that later. */ case DECL_EXPR: @@ -405,6 +420,8 @@ { case REFERENCE_TYPE: case POINTER_TYPE: + /* APPLE LOCAL blocks */ + case BLOCK_POINTER_TYPE: { /* Get the types-specifier of this type. */ tree pointee = strip_pointer_operator (TREE_TYPE (t)); @@ -487,7 +504,10 @@ static void pp_c_abstract_declarator (c_pretty_printer *pp, tree t) { - if (TREE_CODE (t) == POINTER_TYPE) + /* APPLE LOCAL begin blocks */ + if (TREE_CODE (t) == POINTER_TYPE || + TREE_CODE (t) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL end blocks */ { if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) @@ -510,6 +530,8 @@ switch (TREE_CODE (t)) { case POINTER_TYPE: + /* APPLE LOCAL blocks */ + case BLOCK_POINTER_TYPE: pp_abstract_declarator (pp, t); break; @@ -635,6 +657,8 @@ case ARRAY_TYPE: case POINTER_TYPE: + /* APPLE LOCAL blocks */ + case BLOCK_POINTER_TYPE: pp_abstract_declarator (pp, TREE_TYPE (t)); break; Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Wed Jul 30 02:39:52 2008 @@ -7122,6 +7122,22 @@ static void cp_parser_statement_seq_opt (cp_parser* parser, tree in_statement_expr) { + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + tree class_type = DECL_CONTEXT (current_function_decl); + + bool determine_destructor_triviality = + DECL_DESTRUCTOR_P (current_function_decl) && class_type != NULL_TREE + && !CLASSTYPE_DESTRUCTOR_TRIVIALITY_FINAL (class_type); + + /* Assume that the destructor is trivial at first, and mark nontrivial if + any statement is parsed. */ + if (determine_destructor_triviality) + { + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (class_type) = 0; + CLASSTYPE_DESTRUCTOR_TRIVIALITY_FINAL (class_type) = 1; + } + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + /* Scan statements until there aren't any more. */ while (true) { @@ -7140,6 +7156,11 @@ /* APPLE LOCAL end ObjC++ 4185810 */ break; + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + if (determine_destructor_triviality) + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (class_type) = 1; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + /* Parse the statement. */ cp_parser_statement (parser, in_statement_expr, true); @@ -19632,6 +19653,10 @@ token->type == CPP_OPEN_BRACE ? "{" : "}"); } /* APPLE LOCAL end 4093475 */ + /* APPLE LOCAL begin radar 5976344 */ + else if (token->keyword == RID_TEMPLATE) + cp_parser_declaration (parser); + /* APPLE LOCAL end radar 5976344 */ /* Finally, try to parse a block-declaration, or a function-definition. */ else cp_parser_block_declaration (parser, /*statement_p=*/false); Modified: llvm-gcc-4.2/trunk/gcc/crtstuff.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/crtstuff.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/crtstuff.c (original) +++ llvm-gcc-4.2/trunk/gcc/crtstuff.c Wed Jul 30 02:39:52 2008 @@ -639,4 +639,3 @@ #else /* ! CRT_BEGIN && ! CRT_END */ #error "One of CRT_BEGIN or CRT_END must be defined." #endif - Modified: llvm-gcc-4.2/trunk/gcc/local-alloc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/local-alloc.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/local-alloc.c (original) +++ llvm-gcc-4.2/trunk/gcc/local-alloc.c Wed Jul 30 02:39:52 2008 @@ -1698,6 +1698,18 @@ First try the register class that is cheapest for this qty, if there is more than one class. */ +/* APPLE LOCAL begin ARM conditionally disable local RA */ +/* At -O0 GRA is not run, so turning off LRA as well is a bad idea. (Appears + to be needed for correctness as well; non-local goto's load FP, then SP, + from saved locations in memory; if the memory address has to be reloaded + from [FP+offset] in between this doesn't work, see gcc.c-torture/execute/ + 920428-2.c and others. I'm not entirely sure running LRA is enough to + guarantee this will work anyway, but it works on the dejagnu cases, and + this isn't an important enough issue to dig into just now....if a fix + is needed probably we need a special pattern to represent both loads + at once.) */ +if (flag_local_alloc || !optimize) +/* APPLE LOCAL end ARM conditionally disable local RA */ for (i = 0; i < next_qty; i++) { q = qty_order[i]; @@ -2349,6 +2361,12 @@ #else int regno = i; #endif +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER + if (mode == DImode) + regno = dimode_reg_alloc_order[i]; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ if (! TEST_HARD_REG_BIT (first_used, regno) && HARD_REGNO_MODE_OK (regno, mode) && (qty[qtyno].n_calls_crossed == 0 Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 02:39:52 2008 @@ -1675,16 +1675,48 @@ prop_type = getter ? TREE_VALUE (TREE_TYPE (getter)) : integer_type_node; } /* APPLE LOCAL end radar 5277239 */ - + /* APPLE LOCAL begin radar 5893391 */ + else if (!prop && objc_is_id (rtype)) + { + tree rprotos = (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype)) + ? TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype)) + : NULL_TREE); + if (rprotos) { + tree getter = lookup_method_in_protocol_list (rprotos, component, 0); + prop_type = getter ? TREE_VALUE (TREE_TYPE (getter)) : integer_type_node; + } + } + /* APPLE LOCAL end radar 5893391 */ + /* APPLE LOCAL begin objc2 5512183 */ if (prop) { - if (prop_type - && comptypes (prop_type, TREE_TYPE (prop)) != 1) + /* APPLE LOCAL begin radar 6029577 */ + tree property_type = TREE_TYPE (prop); + bool comparison_result = false; + if (prop_type) + { +#ifdef OBJCPLUS + if (TREE_CODE (property_type) == REFERENCE_TYPE + || TREE_CODE (prop_type) == REFERENCE_TYPE) + { + if (TREE_CODE (property_type) == REFERENCE_TYPE) + property_type = TREE_TYPE (property_type); + if (TREE_CODE (prop_type) == REFERENCE_TYPE) + prop_type = TREE_TYPE (prop_type); + comparison_result = + !objcp_reference_related_p (prop_type, property_type); + } + else +#endif + comparison_result = comptypes (prop_type, property_type) != 1; + } + if (prop_type && comparison_result) error ("type of accessor does not match the type of property %qs", IDENTIFIER_POINTER (PROPERTY_NAME (prop))); else - prop_type = TREE_TYPE (prop); + prop_type = property_type; + /* APPLE LOCAL end radar 6029577 */ } /* APPLE LOCAL end objc2 5512183 */ @@ -1747,6 +1779,30 @@ getter = receiver; /* recover */ } } + /* APPLE LOCAL begin radar 5893391 */ + else if (objc_is_id (rtype)) + { + tree rprotos = (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype)) + ? TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype)) + : NULL_TREE); + if (rprotos) { + getter = lookup_method_in_protocol_list (rprotos, component, 0); + if (getter) +#ifdef OBJCPLUS + getter = objc_build_message_expr ( + build_tree_list (receiver, build_tree_list (component, NULL_TREE))); +#else + getter = objc_build_message_expr (build_tree_list (receiver, component)); +#endif + else + { + error ("accessing unknown %qs getter method", + IDENTIFIER_POINTER (component)); + getter = receiver; /* recover */ + } + } + } + /* APPLE LOCAL end radar 5893391 */ return getter; } /* APPLE LOCAL end radar 5285911 */ @@ -2439,6 +2495,7 @@ bool hasUnion, bytesSkipped; int num_nibbles = 0; bool first_nibble = true; + /* APPLE LOCAL radar 6003871 */ tree retval; if (!flag_objc_gc || !implementation_template) @@ -2616,13 +2673,15 @@ } OUTPUT_LAYOUT_BYTE (0); /* null terminate string */ string = obstack_finish (&util_obstack); + /* APPLE LOCAL begin radar 6003871 */ /* if ivar_layout bitmap is all 1 bits (nothing skipped) then use NULL as final layout. */ - retval = (strong_ivar_layout && !bytesSkipped) - ? NULL_TREE - : add_objc_string (get_identifier (string), class_names); + retval = (strong_ivar_layout && !bytesSkipped) + ? NULL_TREE + : add_objc_string (get_identifier (string), class_names); obstack_free (&util_obstack, util_firstobj); return retval; + /* APPLE LOCAL end radar 6003871 */ } /** @@ -3577,14 +3636,21 @@ only seen a @class declaration; for purposes of type comparison, treat it as a stand-alone (root) class. */ + /* APPLE LOCAL begin radar 6061276 */ if (lcls && TREE_CODE (lcls) == IDENTIFIER_NODE) - lcls = NULL_TREE; + /* A previously declared @class may have its @interface declared at + this point. Find it. */ + lcls = lookup_interface (lcls); if (rcls && TREE_CODE (rcls) == IDENTIFIER_NODE) - rcls = NULL_TREE; + /* A previously declared @class may have its @interface declared at + this point. Find it. */ + rcls = lookup_interface (rcls); + /* APPLE LOCAL end radar 6061276 */ /* If either type is an unqualified 'id', we're done. */ - if ((!lproto && objc_is_object_id (ltyp)) + /* APPLE LOCAL radar 5218071 */ + if ((argno != -6 && !lproto && objc_is_object_id (ltyp)) || (!rproto && objc_is_object_id (rtyp))) return true; @@ -3604,9 +3670,10 @@ { if (!pointers_compatible) pointers_compatible - = (objc_is_object_id (ltyp) || objc_is_object_id (rtyp)); - - if (!pointers_compatible) + /* APPLE LOCAL radar 5218071 */ + = ((argno != -6 && objc_is_object_id (ltyp)) || objc_is_object_id (rtyp)); + /* APPLE LOCAL radar 5218071 */ + if (!pointers_compatible && argno != -6) pointers_compatible = DERIVED_FROM_P (ltyp, rtyp); /* APPLE LOCAL 4175534 */ @@ -3638,6 +3705,8 @@ switch (argno) { /* APPLE LOCAL begin 4175534 */ + /* APPLE LOCAL radar 5218071 */ + case -6: case -5: case -4: return false; @@ -4773,6 +4842,14 @@ struct string_descriptor *desc, key; void **loc; + /* APPLE LOCAL begin radar 5887355 */ +#ifdef OBJCPLUS + if (processing_template_decl) + /* Must wait until template instantiation time. */ + return build_min_nt (OBJC_STRING_REFERENCE, string); +#endif + /* APPLE LOCAL end radar 5887355 */ + /* Prep the string argument. */ string = fix_string_type (string); TREE_SET_CODE (string, STRING_CST); @@ -6565,6 +6642,18 @@ strong = (objc_is_strong_p (TREE_TYPE (type)) >= 0 ? 1 : -1); break; } + /* APPLE LOCAL begin radar 5882266, 5832193 */ + /* Block pointer types are GC-able, unless they were tagged with + '__weak' */ + if (TREE_CODE (type) == BLOCK_POINTER_TYPE) + { + type = TREE_TYPE (TREE_TYPE (type)); + while (POINTER_TYPE_P (type)) + type = TREE_TYPE (type); + strong = (objc_is_strong_p (type) >= 0 ? 1 : -1); + break; + } + /* APPLE LOCAL end radar 5882266, 5832193 */ /* APPLE LOCAL end objc gc 5547128 */ type = TREE_TYPE (type); @@ -7066,8 +7155,12 @@ /* APPLE LOCAL begin objc gc 5547128 */ /* Only pointers need barriers. We can get here when __strong float *p; p[0] = 3.14; */ + /* APPLE LOCAL begin radar 5832193 */ if (TREE_CODE (lhs_type) != POINTER_TYPE - && TREE_CODE (TREE_TYPE (rhs)) != POINTER_TYPE) + && TREE_CODE (TREE_TYPE (rhs)) != POINTER_TYPE + && TREE_CODE (lhs_type) != BLOCK_POINTER_TYPE + && TREE_CODE (TREE_TYPE (rhs)) != BLOCK_POINTER_TYPE) + /* APPLE LOCAL end radar 5832193 */ return NULL_TREE; /* APPLE LOCAL end objc gc 5547128 */ @@ -13166,6 +13259,10 @@ if (receiver == error_mark_node || TREE_TYPE (receiver) == error_mark_node) return receiver; /* APPLE LOCAL end radar 4180592 */ + /* APPLE LOCAL begin radar 5809099 */ + if (TREE_CODE (TREE_TYPE (receiver)) == BLOCK_POINTER_TYPE) + receiver = convert (objc_object_type, receiver); + /* APPLE LOCAL end radar 5809099 */ /* Extract the receiver of the message, as well as its type (where the latter may take the form of a cast or be inferred from the implementation context). */ @@ -14065,6 +14162,8 @@ static tree build_ivar_reference (tree id) { + /* APPLE LOCAL radar 5811191 - blocks */ + tree decl; /* APPLE LOCAL ObjC new abi */ tree ivar, base; if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL) @@ -14084,7 +14183,28 @@ } /* APPLE LOCAL begin ObjC new abi */ - base = build_indirect_ref (self_decl, "->"); + /* APPLE LOCAL begin radar 5811191 - blocks */ + decl = self_decl; +#ifndef OBJCPLUS + if (cur_block) + { + /* Find a 'self' declaration in this block. If not found, + add a 'const' copy in current block. */ + if (lookup_name_in_block (DECL_NAME (decl), &decl)) + decl = lookup_name (DECL_NAME (decl)); + else { + if (building_block_byref_decl) { + warning (0, "ivar %qs may not be declared inside the 'byref' block - ignored", + IDENTIFIER_POINTER (id)); + return error_mark_node; + } + decl = build_block_ref_decl (DECL_NAME (decl), decl); + } + gcc_assert (decl); + } +#endif + base = build_indirect_ref (decl, "->"); + /* APPLE LOCAL end radar 5811191 - blocks */ if ((ivar = objc_v2_build_ivar_ref (base, id))) return ivar; else @@ -14911,8 +15031,14 @@ (TREE_CODE (objc_interface_context) == CLASS_INTERFACE_TYPE || TREE_CODE (objc_interface_context) == CATEGORY_INTERFACE_TYPE)) { - tree curtype = TYPE_MAIN_VARIANT (CLASS_STATIC_TEMPLATE - (objc_interface_context)); + /* APPLE LOCAL begin radar 5471096 */ + tree class = + TREE_CODE (objc_interface_context) == CLASS_INTERFACE_TYPE + ? objc_interface_context + : lookup_interface (CLASS_NAME (objc_interface_context)); + tree curtype = + TYPE_MAIN_VARIANT (CLASS_STATIC_TEMPLATE (class)); + /* APPLE LOCAL end radar 5471096 */ if (basetype == curtype || DERIVED_FROM_P (basetype, curtype)) { @@ -15248,7 +15374,8 @@ start_class (enum tree_code code, tree class_name, tree super_name, tree protocol_list) { - tree class, decl; + /* APPLE LOCAL radar 5835805 */ + tree class, decl, aliased_class_name; #ifdef OBJCPLUS if (current_namespace != global_namespace) { @@ -15290,14 +15417,19 @@ } /* APPLE LOCAL end radar 4548636 */ } - + /* APPLE LOCAL begin radar 5835805 */ + aliased_class_name = objc_is_class_name (class_name); + if (aliased_class_name) + class_name = aliased_class_name; + /* APPLE LOCAL end radar 5835805 */ CLASS_NAME (class) = class_name; CLASS_SUPER_NAME (class) = super_name; CLASS_CLS_METHODS (class) = NULL_TREE; /* APPLE LOCAL radar 4695109 */ /* PROTOCOL_IMPLEMENTATION_TYPE removed */ - if (! objc_is_class_name (class_name) + /* APPLE LOCAL radar 5835805 */ + if (!aliased_class_name && (decl = lookup_name (class_name))) { error ("%qs redeclared as different kind of symbol", @@ -15347,9 +15479,12 @@ tree previous_name = CLASS_SUPER_NAME (implementation_template); const char *const name = previous_name ? IDENTIFIER_POINTER (previous_name) : ""; - error ("conflicting super class name %qs", - IDENTIFIER_POINTER (super_name)); - error ("previous declaration of %qs", name); + /* APPLE LOCAL begin radar 5835805 */ + error ("conflicting super class name %qs in interface %qs and its implementation", + IDENTIFIER_POINTER (super_name), IDENTIFIER_POINTER (class_name)); + if (previous_name) + error ("previous declaration of %qs", name); + /* APPLE LOCAL end radar 5835805 */ } else if (! super_name) @@ -15362,12 +15497,10 @@ else if (code == CLASS_INTERFACE_TYPE) { if (lookup_interface (class_name)) -#ifdef OBJCPLUS + /* APPLE LOCAL begin radar 5835805 */ error ("duplicate interface declaration for class %qs", -#else - warning (0, "duplicate interface declaration for class %qs", -#endif - IDENTIFIER_POINTER (class_name)); + IDENTIFIER_POINTER (class_name)); + /* APPLE LOCAL end radar 5835805 */ else add_class (class, class_name); @@ -15514,7 +15647,8 @@ - NAME property name. */ static void -diagnose_property_mismatch (tree cl_prop, tree property, const char *mess, tree name) +/* APPLE LOCAL radar 5218071 */ +diagnose_property_mismatch (tree cl_prop, bool super, tree property, const char *mess, tree name) { /* Check that attributes and types match for protocol and its conforming class. */ /* APPLE LOCAL begin radar 4815061 */ @@ -15540,10 +15674,20 @@ warning (0, "property %qs 'getter' attribute does not match %s %qs property", IDENTIFIER_POINTER (PROPERTY_NAME (cl_prop)), mess, IDENTIFIER_POINTER (name)); - if (comptypes (TREE_TYPE (cl_prop), TREE_TYPE (property)) != 1) - warning (0, "property %qs type does not match %s %qs property type", - IDENTIFIER_POINTER (PROPERTY_NAME (cl_prop)), mess, - IDENTIFIER_POINTER (name)); + /* APPLE LOCAL begin radar 5218071 */ + if (comptypes (TREE_TYPE (cl_prop), TREE_TYPE (property)) != 1) { + if (super && + PROPERTY_READONLY (cl_prop) == boolean_true_node && + PROPERTY_READONLY (property) == boolean_true_node && + objc_compare_types (TREE_TYPE (cl_prop), TREE_TYPE (property), + -6, NULL_TREE)) + ; + else + warning (0, "property %qs type does not match %s %qs property type", + IDENTIFIER_POINTER (PROPERTY_NAME (cl_prop)), mess, + IDENTIFIER_POINTER (name)); + } + /* APPLE LOCAL end radar 5218071 */ if (flag_objc_gc && objc_is_gcable_type (TREE_TYPE (cl_prop)) != objc_is_gcable_type (TREE_TYPE (property))) warning (0, "property %qs storage type does not match %s %qs property storage type", @@ -15574,7 +15718,8 @@ for (property = CLASS_PROPERTY_DECL (super); property; property = TREE_CHAIN (property)) if ((cl_prop = lookup_property_in_list (class, DECL_NAME (property)))) - diagnose_property_mismatch (cl_prop, property, "super class", CLASS_NAME (super)); + /* APPLE LOCAL radar 5218071 */ + diagnose_property_mismatch (cl_prop, true, property, "super class", CLASS_NAME (super)); } /* APPLE LOCAL end objc new property */ @@ -15605,8 +15750,9 @@ IMPL_PROPERTY_DECL (class) = x; } /* APPLE LOCAL begin objc new property */ - else - diagnose_property_mismatch (cl_prop, property, "protocol", PROTOCOL_NAME (p)); + else + /* APPLE LOCAL radar 5218071 */ + diagnose_property_mismatch (cl_prop, false, property, "protocol", PROTOCOL_NAME (p)); /* APPLE LOCAL end objc new property */ /* Search in nested protocols also. */ objc_merge_proto_properties_in_class (class, PROTOCOL_LIST (p)); @@ -16130,17 +16276,24 @@ else { tree ivar_type; - tree rhs = lookup_name (get_identifier ("_value")); - /* APPLE LOCAL begin radar 5376125 */ + /* APPLE LOCAL begin radar 5852190 */ + tree rhs = NULL_TREE; int save_warn_direct_ivar_access = warn_direct_ivar_access; + + if (current_function_decl && DECL_ARGUMENTS (current_function_decl)) + rhs = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (current_function_decl))); + /* APPLE LOCAL begin radar 5376125 */ warn_direct_ivar_access = 0; lhs = build_ivar_reference (PROPERTY_IVAR_NAME (property)); warn_direct_ivar_access = save_warn_direct_ivar_access; /* APPLE LOCAL end radar 5376125 */ /* Recover when method does not have '_value' argument. This is because user provided its own accessor and for which an error is already issued. */ - if (!rhs) + if (!rhs) { + fatal_error ("Failed to synthesize the setter - possibly due to earlier error"); rhs = lhs; + } + /* APPLE LOCAL end radar 5852190 */ /* APPLE LOCAL begin radar 5232840 */ else TREE_USED (rhs) = 1; @@ -16492,7 +16645,8 @@ else { tree x; - if (TREE_CODE (class) == CLASS_INTERFACE_TYPE) + /* APPLE LOCAL radar 5962694 */ + if (TREE_CODE (class) == CLASS_INTERFACE_TYPE || TREE_CODE (class) == CATEGORY_INTERFACE_TYPE) { objc_compare_properties_with_super (class); objc_merge_proto_properties_in_class (class, CLASS_PROTOCOL_LIST (class)); @@ -16998,7 +17152,8 @@ /* We have a type that does not get special treatment. */ /* NeXT extension */ - obstack_1grow (&util_obstack, '^'); + /* APPLE LOCAL radar 5849129 */ + obstack_1grow (&util_obstack, TREE_CODE (type) == BLOCK_POINTER_TYPE ? '@' : '^'); encode_type (pointer_to, curtype, format); } @@ -17197,6 +17352,8 @@ c = TYPE_UNSIGNED (type) ? 'I' : 'i'; break; case 64: c = TYPE_UNSIGNED (type) ? 'Q' : 'q'; break; + /* APPLE LOCAL radar 5996271 */ + case 128: c = TYPE_UNSIGNED (type) ? 'T' : 't'; break; default: abort (); } obstack_1grow (&util_obstack, c); @@ -17552,7 +17709,10 @@ return 1; /* Strip away indirections. */ - while ((TREE_CODE (type1) == ARRAY_TYPE || TREE_CODE (type1) == POINTER_TYPE) + /* APPLE LOCAL begin radar 5795493 - blocks */ + while ((TREE_CODE (type1) == ARRAY_TYPE || TREE_CODE (type1) == POINTER_TYPE || + TREE_CODE (type1) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL end radar 5795493 - blocks */ && (TREE_CODE (type1) == TREE_CODE (type2))) type1 = TREE_TYPE (type1), type2 = TREE_TYPE (type2); if (TYPE_MAIN_VARIANT (type1) != TYPE_MAIN_VARIANT (type2)) @@ -18875,7 +19035,15 @@ /* If we are not inside of an ObjC method, ivar lookup makes no sense. */ if (!objc_method_context) return other; - + + /* APPLE LOCAL begin radar 5796058 - blocks */ + /* Make a quick exit if variable is for a previously declared copied-in + or byref variable used for an 'ivar' access. */ + if (other && TREE_CODE (other) == VAR_DECL && + (BLOCK_DECL_BYREF (other) || BLOCK_DECL_COPIED (other))) + return other; + /* APPLE LOCAL end radar 5796058 - blocks */ + if (!strcmp (IDENTIFIER_POINTER (id), "super")) /* We have a message to super. */ return get_super_receiver (); @@ -19167,6 +19335,11 @@ bool objc_type_valid_for_messaging (tree typ) { + /* APPLE LOCAL begin radar 5831920 */ + if (TREE_CODE (typ) == BLOCK_POINTER_TYPE) + return true; + /* APPLE LOCAL end radar 5831920 */ + if (!POINTER_TYPE_P (typ)) return false; @@ -19625,7 +19798,7 @@ } if (flag_objc_gc) { - int strong = objc_is_gcable_type (TREE_TYPE (property_decl)); + int strong = objc_is_gcable_type (property_type); if (strong) { /* APPLE LOCAL radar 5389292 */ Modified: llvm-gcc-4.2/trunk/gcc/print-tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/print-tree.c?rev=54206&r1=54205&r2=54206&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/print-tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/print-tree.c Wed Jul 30 02:39:52 2008 @@ -30,7 +30,9 @@ #include "langhooks.h" #include "tree-iterator.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif /* LLVM LOCAL end */ /* Define the hash table of nodes already seen. From isanbard at gmail.com Wed Jul 30 03:02:53 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 08:02:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54208 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.c cse.c dwarf2out.c global.c ifcvt.c recog.c Message-ID: <200807300802.m6U82rAh011521@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 03:02:52 2008 New Revision: 54208 URL: http://llvm.org/viewvc/llvm-project?rev=54208&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/cse.c llvm-gcc-4.2/trunk/gcc/dwarf2out.c llvm-gcc-4.2/trunk/gcc/global.c llvm-gcc-4.2/trunk/gcc/ifcvt.c llvm-gcc-4.2/trunk/gcc/recog.c Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Wed Jul 30 03:02:52 2008 @@ -1134,8 +1134,12 @@ int x86_prefetch_sse; /* ix86_regparm_string as a number */ -/* LLVM local */ +/* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif int ix86_regparm; +/* LLVM LOCAL end */ /* APPLE LOCAL begin 5612787 mainline sse4 */ /* True if SSE population count insn supported. */ @@ -1241,8 +1245,11 @@ static bool ix86_function_ok_for_sibcall (tree, tree); static tree ix86_handle_cconv_attribute (tree *, tree, tree, int, bool *); static int ix86_value_regno (enum machine_mode, tree, tree); -/* LLVM LOCAL make global */ -/*static bool contains_128bit_aligned_vector_p (tree);*/ +/* LLVM LOCAL - begin make global */ +#ifndef ENABLE_LLVM +static bool contains_128bit_aligned_vector_p (tree); +#endif +/* LLVM LOCAL - end make global */ static rtx ix86_struct_value_rtx (tree, int); static bool ix86_ms_bitfield_layout_p (tree); static tree ix86_handle_struct_attribute (tree *, tree, tree, int, bool *); @@ -4109,8 +4116,12 @@ /* Return true when TYPE should be 128bit aligned for 32bit argument passing ABI. Only called if TARGET_SSE. */ -/* LLVM LOCAL make global */ +/* LLVM LOCAL - begin make global */ +#ifndef ENABLE_LLVM +static +#endif bool +/* LLVM LOCAL - end make global */ contains_128bit_aligned_vector_p (tree type) { enum machine_mode mode = TYPE_MODE (type); Modified: llvm-gcc-4.2/trunk/gcc/cse.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cse.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cse.c (original) +++ llvm-gcc-4.2/trunk/gcc/cse.c Wed Jul 30 03:02:52 2008 @@ -1533,6 +1533,16 @@ elt->mode = mode; elt->is_const = (CONSTANT_P (x) || fixed_base_plus_p (x)); +/* APPLE LOCAL begin ARM propagate stack addresses better */ +#ifdef TARGET_ARM + /* Adjust cost of SP+const addresses lower; generally, we want to propagate the addition + rather than use a register if these are equally cheap. This attempts to compensate + for forcing the cost of a reg to 0. */ + if (fixed_base_plus_p (x)) + elt->cost -= 2 * COSTS_N_INSNS (1); +#endif +/* APPLE LOCAL end ARM propagate stack addresses better */ + if (table[hash]) table[hash]->prev_same_hash = elt; table[hash] = elt; @@ -2927,6 +2937,8 @@ int best_addr_cost = address_cost (*loc, mode); int best_rtx_cost = (elt->cost + 1) >> 1; int exp_cost; + /* APPLE LOCAL ARM propagate stack addresses better */ + bool best_fixed_base_plus_p = fixed_base_plus_p (elt->exp); struct table_elt *best_elt = elt; found_better = 0; @@ -2937,11 +2949,25 @@ || exp_equiv_p (p->exp, p->exp, 1, false)) && ((exp_cost = address_cost (p->exp, mode)) < best_addr_cost || (exp_cost == best_addr_cost - && ((p->cost + 1) >> 1) > best_rtx_cost))) +/* APPLE LOCAL begin ARM propagate stack addresses better */ +#ifdef TARGET_ARM + /* Prefer a stack address if possible. Thus, prefer a new + stack address to an old non-stack address, and do not replace + an old stack address with a new non-stack address. */ + && ((!best_fixed_base_plus_p && fixed_base_plus_p (p->exp)) + || (!(best_fixed_base_plus_p && !fixed_base_plus_p (p->exp)) + && ((p->cost + 1) >> 1) > best_rtx_cost)) +#else + && ((p->cost + 1) >> 1) > best_rtx_cost +#endif + ))) +/* APPLE LOCAL end ARM propagate stack addresses better */ { found_better = 1; best_addr_cost = exp_cost; best_rtx_cost = (p->cost + 1) >> 1; + /* APPLE LOCAL ARM propagate stack addresses better */ + best_fixed_base_plus_p = fixed_base_plus_p (p->exp); best_elt = p; } } Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Wed Jul 30 03:02:52 2008 @@ -69,6 +69,9 @@ #include "hashtab.h" #include "cgraph.h" #include "input.h" +/* APPLE LOCAL radar 5811943 - Fix type of pointers to Blocks */ +/* APPLE LOCAL Radar 5741731, typedefs used in '@try' blocks */ +#include "c-common.h" #ifdef DWARF2_DEBUGGING_INFO static void dwarf2out_source_line (unsigned int, const char *); @@ -418,6 +421,13 @@ #ifndef DWARF_FRAME_REGNUM #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG) #endif + +/* APPLE LOCAL begin differentiate between arm & thumb. */ +#define DW_ISA_UNKNOWN 0 +#define DW_ISA_ARM_thumb 1 +#define DW_ISA_ARM_arm 2 +#define DW_ISA_USE_STMT_LIST -1 +/* APPLE LOCAL end differentiate between arm & thumb. */ /* Hook used by __throw. */ @@ -4026,6 +4036,11 @@ within the current function. */ static HOST_WIDE_INT frame_pointer_fb_offset; +/* APPLE LOCAL begin ARM prefer SP to FP */ +/* Which register was used to calculate the frame_pointer_fb_offset. */ +static rtx frame_pointer_fb_offset_from; +/* APPLE LOCAL end ARM prefer SP to FP */ + /* Forward declarations for functions defined in this file. */ static int is_pseudo_reg (rtx); @@ -4776,7 +4791,15 @@ case DW_AT_APPLE_optimized: return "DW_AT_APPLE_optimized"; /* APPLE LOCAL end radar 2338865 optimization notification */ - + /* APPLE LOCAL begin differentiate between arm & thumb. */ + case DW_AT_APPLE_isa: + return "DW_AT_APPLE_isa"; + /* APPLE LOCAL end differentiate between arm & thumb. */ + + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ + case DW_AT_APPLE_block: + return "DW_AT_APPLE_block"; + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ default: return "DW_AT_"; } @@ -8590,6 +8613,17 @@ if (code == ERROR_MARK) return NULL; + /* APPLE LOCAL begin Radar 5741731, typedefs used in '@try' blocks */ + if (is_volatile_type + && c_dialect_objc () + && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type))) + { + is_volatile_type = 0; + if (TYPE_NAME (type) && TREE_TYPE (TYPE_NAME (type))) + type = TREE_TYPE (TYPE_NAME (type)); + } + /* APPLE LOCAL end Radar 5741731, typedefs used in '@try' blocks */ + /* See if we already have the appropriately qualified variant of this type. */ qualified_type @@ -8955,8 +8989,10 @@ offset += INTVAL (XEXP (elim, 1)); elim = XEXP (elim, 0); } - gcc_assert (elim == (frame_pointer_needed ? hard_frame_pointer_rtx - : stack_pointer_rtx)); + /* APPLE LOCAL begin ARM prefer SP to FP */ + /* Make sure we are using the same base register. */ + gcc_assert (elim == frame_pointer_fb_offset_from); + /* APPLE LOCAL end ARM prefer SP to FP */ offset += frame_pointer_fb_offset; return new_loc_descr (DW_OP_fbreg, offset, 0); @@ -10846,9 +10882,10 @@ offset += INTVAL (XEXP (elim, 1)); elim = XEXP (elim, 0); } - gcc_assert (elim == (frame_pointer_needed ? hard_frame_pointer_rtx - : stack_pointer_rtx)); + /* APPLE LOCAL begin ARM prefer SP to FP */ + frame_pointer_fb_offset_from = elim; + /* APPLE LOCAL end ARM prefer SP to FP */ frame_pointer_fb_offset = -offset; } @@ -11145,8 +11182,12 @@ static inline void add_prototyped_attribute (dw_die_ref die, tree func_type) { - if (get_AT_unsigned (comp_unit_die, DW_AT_language) == DW_LANG_C89 + /* APPLE LOCAL begin radar 5344182 */ + unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language); + + if ((lang == DW_LANG_C89 || lang == DW_LANG_ObjC) && TYPE_ARG_TYPES (func_type) != NULL) + /* APPLE LOCAL end radar 5344182 */ add_AT_flag (die, DW_AT_prototyped, 1); } @@ -11430,6 +11471,15 @@ enum tree_code code = TREE_CODE (type); dw_die_ref type_die = NULL; + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks */ + if (code == BLOCK_POINTER_TYPE) + { + gcc_assert (invoke_impl_ptr_type); + type = invoke_impl_ptr_type; + code = TREE_CODE (type); + } + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ + /* ??? If this type is an unnamed subrange type of an integral or floating-point type, use the inner type. This is because we have no support for unnamed types in base_type_die. This can happen if this is @@ -12318,13 +12368,394 @@ if (optimize > 0) add_AT_flag (subr_die, DW_AT_APPLE_optimized, 1); /* APPLE LOCAL end radar 2338865 optimization notification */ + /* APPLE LOCAL begin differentiate between arm & thumb. */ +#ifdef TARGET_ARM + if (TARGET_THUMB) + add_AT_int (subr_die, DW_AT_APPLE_isa, DW_ISA_ARM_thumb); + else if (TARGET_ARM) + add_AT_int (subr_die, DW_AT_APPLE_isa, DW_ISA_ARM_arm); +#endif + /* APPLE LOCAL end differentiate between arm & thumb. */ + /* APPLE LOCAL confused diff */ +} +/* APPLE LOCAL begin radar 6048397 handle block byref variables */ + +/* Byref variables, in blocks, are declared by the programmer as + "SomeType VarName;", but the compiler creates a + __Block_byref_x_VarName struct, and gives the variable VarName + either the struct, or a pointer to the struct, as its type. This + is necessary for various behind-the-scenes things the compiler + needs to do with by-reference variables in blocks. + + However, as far as the original *programmer* is concerned, the + variable should still have type 'SomeType', as originally declared. + + The following function dives into the __Block_byref_x_VarName + struct to find the original type of the variable. This will be + passed back to the code generating the type for the Debug + Information Entry for the variable 'VarName'. 'VarName' will then + have the original type 'SomeType' in its debug information. + + The original type 'SomeType' will be the type of the field named + 'VarName' inside the __Block_byref_x_VarName struct. + + NOTE: In order for this to not completely fail on the debugger + side, the Debug Information Entry for the variable VarName needs to + have a DW_AT_location that tells the debugger how to unwind through + the pointers and __Block_byref_x_VarName struct to find the actual + value of the variable. The function + add_block_byref_var_location_attribute does this. */ + +static tree +find_block_byref_var_real_type (tree decl) +{ + tree block_struct = TREE_TYPE (decl); + const char *var_name ; + tree var_field; + bool found = false; + tree ret_type = NULL_TREE; + + + if ((! (DECL_NAME (decl))) + || (! IDENTIFIER_POINTER (DECL_NAME (decl)))) + return ret_type; + + if (!block_struct) + return ret_type; + + /* Get the name of the variable whose real type we are trying to find. */ + + var_name = IDENTIFIER_POINTER (DECL_NAME (decl)); + + /* If the type for the variable was pointer to __Block_byref_etc, then + dereference the pointer type to get the structure __Block_byref_etc. */ + + if (TREE_CODE (block_struct) == POINTER_TYPE) + block_struct = TREE_TYPE (block_struct); + + /* If block_struct is NOT a __Block_byref_etc record, then something is + wrong, so we should bail out here. */ + + if (TREE_CODE (block_struct) != RECORD_TYPE) + return ret_type; + + if ((! TYPE_NAME (block_struct)) + || (! IDENTIFIER_POINTER (TYPE_NAME (block_struct))) + || (strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), + "__Block_byref_", 14) != 0)) + return ret_type; + + /* We've got the record for a __Byref_block_etc; go through the fields + looking for one with the same name as the var_decl. */ + + var_field = TYPE_FIELDS (block_struct); + + while (var_field && !found) + { + if (TREE_CODE (var_field) != FIELD_DECL) + return ret_type; + if (DECL_NAME (var_field) + && IDENTIFIER_POINTER (DECL_NAME (var_field)) + && strcmp (IDENTIFIER_POINTER (DECL_NAME (var_field)), var_name) == 0) + { + /* We've found the right field. Return its type. */ + ret_type = TREE_TYPE (var_field); + found = 1; + } + else + var_field = TREE_CHAIN (var_field); + } + + return ret_type; +} + +/* This function is a helper function for the function below, + add_block_byref_var_location_attribute. See comments there + for full description. */ + +static void +build_byref_var_location_expression (dw_loc_descr_ref *main_descr, + bool is_pointer, + int forwarding_field_offset, + int var_field_offset) +{ + dw_loc_descr_ref temp_descr; + + /* If we started with a pointer to the __Block_byref... struct, then + the first thing we need to do is dereference the pointer + (DW_OP_deref). */ + + if (is_pointer) + { + temp_descr = new_loc_descr (DW_OP_deref, 0, 0); + add_loc_descr (main_descr, temp_descr); + } + + /* Next add the offset for the 'forwarding' field: + DW_OP_plus_uconst forwarding_field_offset + Note, there's no point in adding it if the offset is 0. */ + + if (forwarding_field_offset != 0) + { + temp_descr = new_loc_descr (DW_OP_plus_uconst, forwarding_field_offset, + 0); + add_loc_descr (main_descr, temp_descr); + } + + /* Follow that pointer to find the *real* __Block_byref struct: + DW_OP_deref */ + + temp_descr = new_loc_descr (DW_OP_deref, 0, 0); + add_loc_descr (main_descr, temp_descr); + + /* Now we've got the real __Block_byref struct, add the offset for + the variable's field to get the location of the actual variable: + DW_OP_plus_uconst var_field_offset + Again, there's no point in adding the offset if it is 0. */ + + if (var_field_offset != 0) + { + temp_descr = new_loc_descr (DW_OP_plus_uconst, var_field_offset, 0); + add_loc_descr (main_descr, temp_descr); + } } +/* Byref variables, in blocks, are declared by the programmer as + "SomeType VarName;", but the compiler creates a + __Block_byref_x_VarName struct, and gives the variable VarName + either the struct, or a pointer to the struct, as its type. This + is necessary for various behind-the-scenes things the compiler + needs to do with by-reference variables in blocks. + + However, as far as the original *programmer* is concerned, the + variable should still have type 'SomeType', as originally declared. + + The function find_block_byref_var_real_type dives into the + __Block_byref_x_VarName struct to find the original type of the + variable, which is then assigned to the variable's Debug + Information Entry as its real type. So far, so good. However now + the debugger will expect the variable VarName to have the type + SomeType. So we need the location attribute for the variable to be + an expression that explains to the debugger how to navigate through + the pointers and struct to find the actual variable of type + SomeType. + + The following function does just that. We start by getting + the "normal" location for the variable. This will be the location + of either the struct __Block_byref_x_VarName or the pointer to the + struct __Block_byref_x_VarName. + + The struct will look something like: + + struct __Block_byref_x_VarName { + struct __Block_byref_x_VarName *forwarding; + ... + SomeType VarName; + }; + + If we are given the struct directly (as our starting point) we + need to tell the debugger to: + + 1). Add the offset of the forwarding field (do NOT assume the field + will always be as position 0). + + 2). Follow that pointer to get the the real __Block_byref_x_VarName + struct to use (the real one may have been copied onto the heap). + + 3). Add the offset for the field VarName, to find the actual variable. + + If we started with a pointer to the struct, then we need to + derefernce (follow) that pointer first, before the other steps. + Translating this into DWARF ops, we will need to append the following + to the current location description for the variable: + + DW_OP_deref -- optional, if we start with a pointer + DW_OP_plus_uconst + DW_OP_deref + DW_OP_plus_uconst + + This function returns a boolean indicating whether or not it was + able to successfully create and add the location description. */ + +static bool +add_block_byref_var_location_attribute (dw_die_ref var_die, tree decl) +{ + tree block_struct = TREE_TYPE (decl); + const char *var_name = IDENTIFIER_POINTER (DECL_NAME (decl)); + tree var_field = NULL; + tree forwarding_field = NULL; + tree temp_field; + unsigned int forwarding_field_offset = 0; + unsigned int var_field_offset = 0; + bool is_pointer = false; + dw_loc_descr_ref descr; + var_loc_list *loc_list; + + if (!block_struct) + return false; + + if ((! DECL_NAME (decl)) + || (! IDENTIFIER_POINTER (DECL_NAME (decl)))) + return false; + + /* Get the name of the variable whose location we are decoding. */ + + var_name = IDENTIFIER_POINTER (DECL_NAME (decl)); + + if (TREE_CODE (block_struct) == POINTER_TYPE) + block_struct = TREE_TYPE (block_struct); + + /* Verify that we have a record that is a __Block_byref_... */ + + if (TREE_CODE (block_struct) != RECORD_TYPE) + return false; + + if ((! TYPE_NAME (block_struct)) + || (! IDENTIFIER_POINTER (TYPE_NAME (block_struct))) + || strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), + "__Block_byref_", 14) != 0) + return false; + + /* Find the forwarding field and the variable field within + the struct. */ + + temp_field = TYPE_FIELDS (block_struct); + + while (temp_field + && (!var_field || !forwarding_field)) + { + if (TREE_CODE (temp_field) != FIELD_DECL) + return false; + if (DECL_NAME (temp_field) + && IDENTIFIER_POINTER (DECL_NAME (temp_field))) + { + if (strcmp (IDENTIFIER_POINTER (DECL_NAME (temp_field)), + var_name) == 0) + var_field = temp_field; + else if (strcmp (IDENTIFIER_POINTER (DECL_NAME (temp_field)), + "forwarding") == 0) + forwarding_field = temp_field; + } + + temp_field = TREE_CHAIN (temp_field); + } + + /* If we didn't find both fields, we can't continue. */ + + if (!var_field || !forwarding_field) + return false; + + /* Get the offsets of the fields within the struct. */ + + if (var_field) + var_field_offset = field_byte_offset (var_field); + if (forwarding_field) + forwarding_field_offset = field_byte_offset (forwarding_field); + + /* Check to see if we start with a pointer we need to dereference, + or not. */ + + if (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE) + is_pointer = true; + + /* See if we possible have multiple locations for this variable. */ + loc_list = lookup_decl_loc (decl); + + /* If it truly has multiple locations, the first and last node will + differ. */ + if (loc_list && loc_list->first != loc_list->last) + { + struct var_loc_node *node; + rtx varloc; + dw_loc_list_ref list; + const char *endname, *secname; + + /* Build the first entry for the location list. */ + + node = loc_list->first; + varloc = NOTE_VAR_LOCATION (node->var_loc_note); + secname = secname_for_decl (decl); + + descr = loc_descriptor (varloc, STATUS_INITIALIZED); + build_byref_var_location_expression (&descr, is_pointer, + forwarding_field_offset, + var_field_offset); + list = new_loc_list (descr, node->label, node->next->label, secname, 1); + node = node->next; + + for (; node->next; node = node->next) + + /* Build the other entries for the location list, except the last. */ + + if (NOTE_VAR_LOCATION_LOC (node->var_loc_note) != NULL_RTX) + { + varloc = NOTE_VAR_LOCATION (node->var_loc_note); + descr = loc_descriptor (varloc, STATUS_INITIALIZED); + build_byref_var_location_expression (&descr, is_pointer, + forwarding_field_offset, + var_field_offset); + add_loc_descr_to_loc_list (&list, descr, node->label, + node->next->label, secname); + } + if (NOTE_VAR_LOCATION_LOC (node->var_loc_note) != NULL_RTX) + { + char label_id[MAX_ARTIFICIAL_LABEL_BYTES]; + + /* Build the last entry for the location list. */ + + varloc = NOTE_VAR_LOCATION (node->var_loc_note); + if (!current_function_decl) + endname = text_end_label; + else + { + ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_END_LABEL, + current_function_funcdef_no); + endname = ggc_strdup (label_id); + } + descr = loc_descriptor (varloc, STATUS_INITIALIZED); + build_byref_var_location_expression (&descr, is_pointer, + forwarding_field_offset, + var_field_offset); + add_loc_descr_to_loc_list (&list, descr, node->label, endname, + secname); + } + add_AT_loc_list (var_die, DW_AT_location, list); + } + else + { + /* We are not dealing with a location list so... */ + + /* 'descr' starts with the base location of the __Block_byref_... struct, + or the pointer to the __Block_byref_... struct. */ + + descr = loc_descriptor_from_tree (decl); + if (!descr) + return false; + + build_byref_var_location_expression (&descr, is_pointer, + forwarding_field_offset, + var_field_offset); + + /* Finally, now that we've built up the location description to find the + actual value of the variable, add the location description to the + variable's die. */ + + add_AT_location_description (var_die, DW_AT_location, descr); + } + + return true; +} +/* APPLE LOCAL end radar 6048397 handle block byref variables */ + /* Generate a DIE to represent a declared data object. */ static void gen_variable_die (tree decl, dw_die_ref context_die) { + /* APPLE LOCAL begin radar 6048397 handle block byref variables */ + bool is_block_byref_var = false; + tree decl_type = TREE_TYPE (decl); + /* APPLE LOCAL end radar 6048397 handle block byref variables */ tree origin = decl_ultimate_origin (decl); dw_die_ref var_die = new_die (DW_TAG_variable, context_die, decl); @@ -12351,6 +12782,24 @@ && DECL_COMDAT (decl) && !TREE_ASM_WRITTEN (decl)) || class_or_namespace_scope_p (context_die)); + /* APPLE LOCAL begin radar 6048397 handle block byref variables */ + /* Check to see if this variable is for a block passed-by-refernce + variable, in which case we need to do some special stuff for its + type and location. */ + if (decl_type) + { + if (TREE_CODE (decl_type) == POINTER_TYPE) + decl_type = TREE_TYPE (decl_type); + if (decl_type + && TREE_CODE (decl_type) == RECORD_TYPE + && TYPE_NAME (decl_type) + && TREE_CODE (TYPE_NAME (decl_type)) == IDENTIFIER_NODE + && IDENTIFIER_POINTER (TYPE_NAME (decl_type)) + && (strncmp (IDENTIFIER_POINTER (TYPE_NAME (decl_type)), + "__Block_byref_", 14) == 0)) + is_block_byref_var = true; + } + /* APPLE LOCAL end radar 6048397 handle block byref variables */ if (origin != NULL) add_abstract_origin_attribute (var_die, origin); @@ -12388,8 +12837,24 @@ else { add_name_and_src_coords_attributes (var_die, decl); - add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl), - TREE_THIS_VOLATILE (decl), context_die); + /* APPLE LOCAL begin radar 6048397 handle block byref variables */ + if (is_block_byref_var) + { + /* Try to find the real type for the variable; if we can't find + it, fall back on the old behavior. */ + tree real_type = NULL_TREE; + real_type = find_block_byref_var_real_type (decl); + if (real_type) + add_type_attribute (var_die, real_type, TREE_READONLY (decl), + TREE_THIS_VOLATILE (decl), context_die); + else + add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl), + TREE_THIS_VOLATILE (decl), context_die); + } + else + add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl), + TREE_THIS_VOLATILE (decl), context_die); + /* APPLE LOCAL end radar 6048397 handle block byref variables */ if (TREE_PUBLIC (decl)) add_AT_flag (var_die, DW_AT_external, 1); @@ -12411,7 +12876,16 @@ if (! declaration && ! DECL_ABSTRACT (decl)) { - add_location_or_const_value_attribute (var_die, decl, DW_AT_location); + /* APPLE LOCAL begin radar 6048397 handle block byref variables */ + /* Try to build and add the location info for navigating through + a __Block_byref_... struct to find the real variable. If that + fails, fall back on the old behavior. */ + bool loc_added = false; + if (is_block_byref_var) + loc_added = add_block_byref_var_location_attribute (var_die, decl); + if (!loc_added) + add_location_or_const_value_attribute (var_die, decl, DW_AT_location); + /* APPLE LOCAL end radar 6048397 handle block byref variables */ add_pubname (decl, var_die); } else @@ -12827,6 +13301,11 @@ add_AT_specification (type_die, old_die); else add_name_attribute (type_die, type_tag (type)); + + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ + if (TYPE_BLOCK_IMPL_STRUCT (type)) + add_AT_flag (type_die, DW_AT_APPLE_block, 1); + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ } else remove_AT (type_die, DW_AT_declaration); @@ -13799,6 +14278,8 @@ a plain function, this will be fixed up in decls_for_scope. If we're a method, it will be ignored, since we already have a DIE. */ if (decl_function_context (decl) + /* APPLE LOCAL blocks 5811952 */ + && (! BLOCK_HELPER_FUNC (decl)) /* But if we're in terse mode, we don't care about scope. */ && debug_info_level > DINFO_LEVEL_TERSE) context_die = NULL; Modified: llvm-gcc-4.2/trunk/gcc/global.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/global.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/global.c (original) +++ llvm-gcc-4.2/trunk/gcc/global.c Wed Jul 30 03:02:52 2008 @@ -51,6 +51,11 @@ #define REWRITE_WEIGHT_COMPUTATION #endif /* APPLE LOCAL end rewrite weight computation */ +/* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying*/ +#ifndef TIE_PSEUDOS +#define TIE_PSEUDOS 0 +#endif +/* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying*/ /* This pass of the compiler performs global register allocation. It assigns hard register numbers to all the pseudo registers @@ -308,6 +313,13 @@ static int local_reg_n_refs[FIRST_PSEUDO_REGISTER]; +/* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying*/ +/* Set with no registers. This is not declared const to avoid a warning at the point + of use; but it is const. */ + +static HARD_REG_SET empty_reg_set; +/* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying*/ + /* APPLE LOCAL begin rewrite weight computation */ #ifdef REWRITE_WEIGHT_COMPUTATION /* Overall weight of each hard reg, as used by local alloc. @@ -1538,6 +1550,12 @@ #else int regno = i; #endif +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER + if (mode == DImode) + regno = dimode_reg_alloc_order[i]; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ if (! TEST_HARD_REG_BIT (used, regno) && HARD_REGNO_MODE_OK (regno, mode) && (allocno[num].calls_crossed == 0 @@ -1837,8 +1855,24 @@ }); /* APPLE LOCAL begin 4321079 */ + /* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying*/ { int k, l; + /* If this reg is not live over calls, remove any ties to pseudo-regs + that are live over calls; they cannot use this reg. */ + if (call_used_regs[best_reg]) + { + EXECUTE_IF_SET_IN_ALLOCNO_SET ( + pseudo_preferences + num * allocno_row_words, k, + { + if (allocno[k].calls_crossed != 0) + { + CLEAR_PSEUDO_PREF (num, k); + CLEAR_PSEUDO_PREF (k, num); + } + }); + } + /* Mark tied pseudo-regs that have not yet been assigned a reg and do not already have a hard reg preference and do not conflict as preferring this reg. Mark pseudo-regs @@ -1848,9 +1882,19 @@ pseudo_preferences + num * allocno_row_words, k, { if (!CONFLICTP (num, k) && reg_renumber[allocno[k].reg] < 0) - SET_REGBIT (hard_reg_copy_preferences, k, best_reg); + { + /* go-if-equal is not exactly what we want, ugh */ + GO_IF_HARD_REG_EQUAL (allocno[k].hard_reg_copy_preferences, + empty_reg_set, none_yet); + goto skip; + none_yet:; + SET_REGBIT (hard_reg_copy_preferences, k, best_reg); + skip:; + } - if (num != k && !CONFLICTP (num, k)) + if (num != k && !CONFLICTP (num, k) && + (reg_renumber[allocno[k].reg] < 0 || + reg_renumber[allocno[k].reg] == best_reg)) EXECUTE_IF_SET_IN_ALLOCNO_SET ( conflicts + k * allocno_row_words, l, { @@ -1858,21 +1902,28 @@ SET_REGBIT (regs_someone_prefers, l, best_reg); }); }); - /* Mark pseudo-regs tied to conflicting regs and not yet assigned a - reg as not preferring this reg. */ + /* Mark pseudo-regs tied to {conflicting allocnos which have either + not yet been assigned a reg, or assigned best_reg}, but are not + tied to this allocno, and not yet assigned a reg, as not preferring + this reg, provided they are not already marked as preferring + this reg. Got that? */ EXECUTE_IF_SET_IN_ALLOCNO_SET ( conflicts + num * allocno_row_words, k, { - if (num != k) + if (num != k + && (reg_renumber[allocno[k].reg] < 0 + || reg_renumber[allocno[k].reg] == best_reg)) EXECUTE_IF_SET_IN_ALLOCNO_SET ( pseudo_preferences + k * allocno_row_words, l, { - if (k != l && !CONFLICTP (k, l) + if (k != l && !CONFLICTP (k, l) && !TEST_PSEUDO_PREF (l, num) + && !TEST_HARD_REG_BIT(allocno[l].hard_reg_preferences, best_reg) && reg_renumber[allocno[l].reg] < 0) SET_REGBIT (regs_someone_prefers, l, best_reg); }); }); } + /* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying*/ /* APPLE LOCAL end 4321079 */ } } @@ -2191,11 +2242,19 @@ int copy = 1; /* APPLE LOCAL begin 4321079 */ - /* Look under SUBREG for vectors; vector-to-vector SUBREGs are NOPs. */ + /* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying*/ + /* Look under SUBREG for vectors; vector-to-vector SUBREGs are NOPs. + This code formerly did less testing, which was OK on PPC and x86 + as vector-to-nonvector SUBREGs did not occur; but they do on ARM. */ if (GET_RTX_FORMAT (GET_CODE (src))[0] == 'e' - && ! (GET_CODE (src) == SUBREG && VECTOR_MODE_P (GET_MODE (dest)))) + && ! (GET_CODE (src) == SUBREG + && REG_P (SUBREG_REG (src)) + && VECTOR_MODE_P (GET_MODE (src)) + && VECTOR_MODE_P (GET_MODE (SUBREG_REG (src))) + && VECTOR_MODE_P (GET_MODE (dest)))) src = XEXP (src, 0), copy = 0; + /* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying*/ /* APPLE LOCAL end 4321079 */ /* Get the reg number for both SRC and DEST. @@ -2305,11 +2364,13 @@ marked as tied here; the data is only used for pseudos that do not conflict. */ + /* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying*/ if (src_regno >= FIRST_PSEUDO_REGISTER && reg_allocno[src_regno] >= 0 - && VECTOR_MODE_P (GET_MODE (src_reg)) + && (VECTOR_MODE_P (GET_MODE (src_reg)) || TIE_PSEUDOS) && dest_regno >= FIRST_PSEUDO_REGISTER && reg_allocno[dest_regno] >= 0 - && VECTOR_MODE_P (GET_MODE (dest_reg)) + && (VECTOR_MODE_P (GET_MODE (dest_reg)) || TIE_PSEUDOS) && copy) + /* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying*/ { src_regno += offset; SET_PSEUDO_PREF (reg_allocno[dest_regno], reg_allocno[src_regno]); Modified: llvm-gcc-4.2/trunk/gcc/ifcvt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ifcvt.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ifcvt.c (original) +++ llvm-gcc-4.2/trunk/gcc/ifcvt.c Wed Jul 30 03:02:52 2008 @@ -284,6 +284,22 @@ goto insn_done; } + /* APPLE LOCAL begin ARM enhance conditional insn generation */ +#ifdef TARGET_ARM + /* If we've got a comparison in the block, we can continue to merge + provided all following insns are COND_EXEC with a condition identical + to TEST. The existing instruction is just fine in this case, no + modifications needed. Misleading name of "must_be_last" retained to + minimize changes. */ + /* This probably won't work on some other targets. */ + + if (must_be_last + && GET_CODE (PATTERN (insn)) == COND_EXEC + && rtx_equal_p (COND_EXEC_TEST (PATTERN (insn)), test)) + goto insn_done; +#endif + /* APPLE LOCAL end ARM enhance conditional insn generation */ + /* Last insn wasn't last? */ if (must_be_last) return FALSE; @@ -295,6 +311,13 @@ must_be_last = TRUE; } + /* APPLE LOCAL begin 5831528 make calls predicable */ + /* Calls with NORETURN notes cannot easily be conditionally executed, + since all insns following such calls have been removed as dead. */ + if (CALL_P (insn) && find_reg_note (insn, REG_NORETURN, NULL_RTX)) + return FALSE; + /* APPLE LOCAL end 5831528 make calls predicable */ + /* Now build the conditional form of the instruction. */ pattern = PATTERN (insn); xtest = copy_rtx (test); @@ -366,9 +389,33 @@ return cond; } +/* APPLE LOCAL begin ARM enhance conditional insn generation */ +/* Test whether two conditional branches have the same destination. We've + checked elsewhere that the conditions are compatible; if one is + reversed, so must the other be. */ +static bool +cond_exec_branch_targets_equiv (rtx insn1, rtx insn2) +{ + rtx cond1, cond2; + if (!any_condjump_p (insn1) || !any_condjump_p (insn2)) + return false; + cond1 = SET_SRC (pc_set (insn1)); + cond2 = SET_SRC (pc_set (insn2)); + if (rtx_equal_p (XEXP (cond1, 1), XEXP (cond2, 1)) + && rtx_equal_p (XEXP (cond1, 2), XEXP (cond2, 2))) + return true; + return false; +} + /* Given a simple IF-THEN or IF-THEN-ELSE block, attempt to convert it to conditional execution. Return TRUE if we were successful at converting the block. */ +/* In addition to the above, we're locally handling the case where multiple + && or || blocks precede the THEN, but we cannot convert the THEN block + for some reason (e.g. it has multiple successors, or THEN and ELSE do + not join.) We can still convert and merge the && or || blocks. + This case is indicated by ce_info->then_bb==NULL. Heavy modifications + in this routine. */ static int cond_exec_process_if_block (ce_if_block_t * ce_info, @@ -378,8 +425,8 @@ basic_block then_bb = ce_info->then_bb; /* THEN */ basic_block else_bb = ce_info->else_bb; /* ELSE or NULL */ rtx test_expr; /* expression in IF_THEN_ELSE that is tested */ - rtx then_start; /* first insn in THEN block */ - rtx then_end; /* last insn + 1 in THEN block */ + rtx then_start = NULL_RTX; /* first insn in THEN block */ + rtx then_end = NULL_RTX; /* last insn + 1 in THEN block */ rtx else_start = NULL_RTX; /* first insn in ELSE block or NULL */ rtx else_end = NULL_RTX; /* last insn + 1 in ELSE block */ int max; /* max # of insns to convert. */ @@ -388,7 +435,7 @@ rtx false_expr; /* test for then block insns */ rtx true_prob_val; /* probability of else block */ rtx false_prob_val; /* probability of then block */ - int n_insns; + int n_insns = 0; enum rtx_code false_code; /* If test is comprised of && or || elements, and we've failed at handling @@ -419,21 +466,24 @@ /* Collect the bounds of where we're to search, skipping any labels, jumps and notes at the beginning and end of the block. Then count the total number of insns and see if it is small enough to convert. */ - then_start = first_active_insn (then_bb); - then_end = last_active_insn (then_bb, TRUE); - n_insns = ce_info->num_then_insns = count_bb_insns (then_bb); - max = MAX_CONDITIONAL_EXECUTE; - - if (else_bb) + if (then_bb) { - max *= 2; - else_start = first_active_insn (else_bb); - else_end = last_active_insn (else_bb, TRUE); - n_insns += ce_info->num_else_insns = count_bb_insns (else_bb); - } + then_start = first_active_insn (then_bb); + then_end = last_active_insn (then_bb, TRUE); + n_insns = ce_info->num_then_insns = count_bb_insns (then_bb); + max = MAX_CONDITIONAL_EXECUTE; - if (n_insns > max) - return FALSE; + if (else_bb) + { + max *= 2; + else_start = first_active_insn (else_bb); + else_end = last_active_insn (else_bb, TRUE); + n_insns += ce_info->num_else_insns = count_bb_insns (else_bb); + } + + if (n_insns > max) + return FALSE; + } /* Map test_expr/test_jump into the appropriate MD tests to use on the conditionally executed code. */ @@ -472,6 +522,7 @@ { basic_block bb = test_bb; basic_block last_test_bb = ce_info->last_test_bb; + int mod_ok = 0; if (! false_expr) goto fail; @@ -485,9 +536,19 @@ bb = block_fallthru (bb); start = first_active_insn (bb); end = last_active_insn (bb, TRUE); + + /* If the condition at the next block is same as this one, and they + share a target, we can conditionally redefine CC within the block. + This should work on targets with a single CC register and conditional + compares. */ + t = cond_exec_get_condition (BB_END (bb)); + if (t && rtx_equal_p (t, true_expr) + && cond_exec_branch_targets_equiv (BB_END (bb), BB_END (test_bb))) + mod_ok = 1; + if (start && ! cond_exec_process_insns (ce_info, start, end, false_expr, - false_prob_val, FALSE)) + false_prob_val, mod_ok)) goto fail; /* If the conditional jump is more than just a conditional jump, then @@ -505,15 +566,44 @@ goto fail; f = gen_rtx_fmt_ee (f_code, GET_MODE (t), XEXP (t, 0), XEXP (t, 1)); + /* The conditions in the following code are corrected from + mainline. The true_expr is the condition that means the + 'then' block is executed, i.e. the branch is taken. Voila + some simple diagrams for && and || blocks -- in these all + control flows downward (and outward) and when control + splits, the right angle/horizontal line is the 'then' + clause (i.e., true) and the vertical line is the 'else' + clause (i.e., false). + + and_and: or_or: + +-----+ +-----+ + | BB1 | | BB1 | + +-----+ +-----+ + | | + +---------+ +------+ + false_expr| | | |false_expr + +-----+ | | +-----+ + | BB2 | | | | BB2 | + +-----+ | | +-----+ + | | | | + +-------+ | +---+ +-------+ + |f t| |true_expr true_expr| |f |t + +-----+ +-----+ +-----+ +-----+ + | BB3 | | BB4 | | BB3 | | BB4 | + +-----+ +-----+ +-----+ +-----+ + + We're calculating 'f', which is the condition necessary to + reach BB3 in the above diagrams, and 't' which is the + condition necessary to reach BB4. */ if (ce_info->and_and_p) { - t = gen_rtx_AND (GET_MODE (t), true_expr, t); - f = gen_rtx_IOR (GET_MODE (t), false_expr, f); + t = gen_rtx_IOR (GET_MODE (t), true_expr, t); + f = gen_rtx_AND (GET_MODE (t), false_expr, f); } else { - t = gen_rtx_IOR (GET_MODE (t), true_expr, t); - f = gen_rtx_AND (GET_MODE (t), false_expr, f); + f = gen_rtx_IOR (GET_MODE (t), true_expr, f); + t = gen_rtx_AND (GET_MODE (t), false_expr, t); } /* If the machine description needs to modify the tests, such as @@ -531,6 +621,13 @@ false_expr = f; } while (bb != last_test_bb); + /* If tests from several blocks were merged, change the last branch to use the + merged tests, which may of course be invalid. We need do this only in the + &&-only case, as the branch will be removed if we have a then block. */ + if (!then_bb && !rtx_equal_p (true_expr, test_expr)) + if (any_condjump_p (BB_END (bb))) + validate_change (BB_END (bb), &XEXP (SET_SRC (pc_set (BB_END (bb))), 0), + true_expr, 1); } /* For IF-THEN-ELSE blocks, we don't allow modifications of the test @@ -540,7 +637,7 @@ /* Go through the THEN and ELSE blocks converting the insns if possible to conditional execution. */ - if (then_end + if (then_bb && then_end && (! false_expr || ! cond_exec_process_insns (ce_info, then_start, then_end, false_expr, false_prob_val, @@ -587,6 +684,7 @@ cancel_changes (0); return FALSE; } +/* APPLE LOCAL end ARM enhance conditional insn generation */ /* Used by noce_process_if_block to communicate with its subroutines. @@ -2661,7 +2759,10 @@ if (cond_exec_process_if_block (ce_info, TRUE)) return TRUE; - if (ce_info->num_multiple_test_blocks) + /* APPLE LOCAL begin ARM enhance conditional insn generation */ + /* The &&-only case can't do anything useful here, so don't try. */ + if (ce_info->num_multiple_test_blocks && ce_info->then_bb) + /* APPLE LOCAL end ARM enhance conditional insn generation */ { cancel_changes (0); @@ -3009,22 +3110,23 @@ } } + /* APPLE LOCAL begin ARM enhance conditional insn generation */ /* The THEN block of an IF-THEN combo must have exactly one predecessor, other than any || blocks which jump to the THEN block. */ if ((EDGE_COUNT (then_bb->preds) - ce_info->num_or_or_blocks) != 1) - return FALSE; + goto combine_and_and_only; /* The edges of the THEN and ELSE blocks cannot have complex edges. */ FOR_EACH_EDGE (cur_edge, ei, then_bb->preds) { if (cur_edge->flags & EDGE_COMPLEX) - return FALSE; + goto combine_and_and_only; } FOR_EACH_EDGE (cur_edge, ei, else_bb->preds) { if (cur_edge->flags & EDGE_COMPLEX) - return FALSE; + goto combine_and_and_only; } /* The THEN block of an IF-THEN combo must have zero or one successors. */ @@ -3032,7 +3134,7 @@ && (!single_succ_p (then_bb) || (single_succ_edge (then_bb)->flags & EDGE_COMPLEX) || (flow2_completed && tablejump_p (BB_END (then_bb), NULL, NULL)))) - return FALSE; + goto combine_and_and_only; /* If the THEN block has no successors, conditional execution can still make a conditional call. Don't do this unless the ELSE block has @@ -3054,13 +3156,13 @@ if (last_insn && JUMP_P (last_insn) && ! simplejump_p (last_insn)) - return FALSE; + goto combine_and_and_only; join_bb = else_bb; else_bb = NULL_BLOCK; } else - return FALSE; + goto combine_and_and_only; } /* If the THEN block's successor is the other edge out of the TEST block, @@ -3081,30 +3183,51 @@ && ! (flow2_completed && tablejump_p (BB_END (else_bb), NULL, NULL))) join_bb = single_succ (else_bb); - /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ + /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ + else + goto combine_and_and_only; + + /* Fallthrough means one of the recognized cases above matched. */ + goto if_block_found; + + /* This is not a recognizable if-then-else for some reason. If we have multiple + && blocks, we can still try to combine them. This case is indicated by marking + everything else null. */ +combine_and_and_only:; + if (ce_info->num_and_and_blocks || ce_info->num_or_or_blocks) + { + join_bb = else_bb = NULL_BLOCK; + then_bb = ce_info->then_bb = NULL_BLOCK; + } else return FALSE; +if_block_found:; num_possible_if_blocks++; if (dump_file) { fprintf (dump_file, - "\nIF-THEN%s block found, pass %d, start block %d " - "[insn %d], then %d [%d]", + "\nIF%s%s block found, pass %d, start block %d " + "[insn %d]", + (then_bb) ? "-THEN" : "", (else_bb) ? "-ELSE" : "", ce_info->pass, test_bb->index, - BB_HEAD (test_bb) ? (int)INSN_UID (BB_HEAD (test_bb)) : -1, - then_bb->index, - BB_HEAD (then_bb) ? (int)INSN_UID (BB_HEAD (then_bb)) : -1); + BB_HEAD (test_bb) ? (int)INSN_UID (BB_HEAD (test_bb)) : -1); + + if (then_bb) + fprintf (dump_file, ", then %d [%d]", + then_bb->index, + BB_HEAD (then_bb) ? (int)INSN_UID (BB_HEAD (then_bb)) : -1); if (else_bb) fprintf (dump_file, ", else %d [%d]", else_bb->index, BB_HEAD (else_bb) ? (int)INSN_UID (BB_HEAD (else_bb)) : -1); - fprintf (dump_file, ", join %d [%d]", + if (join_bb) + fprintf (dump_file, ", join %d [%d]", join_bb->index, BB_HEAD (join_bb) ? (int)INSN_UID (BB_HEAD (join_bb)) : -1); @@ -3125,20 +3248,25 @@ first condition for free, since we've already asserted that there's a fallthru edge from IF to THEN. Likewise for the && and || blocks, since we checked the FALLTHRU flag, those are already adjacent to the last IF - block. */ + block. (When then_bb is null, we are only looking at the && blocks, which + were already verified.) */ /* ??? As an enhancement, move the ELSE block. Have to deal with BLOCK notes, if by no other means than backing out the merge if they exist. Sticky enough I don't want to think about it now. */ - next = then_bb; - if (else_bb && (next = next->next_bb) != else_bb) - return FALSE; - if ((next = next->next_bb) != join_bb && join_bb != EXIT_BLOCK_PTR) + if (then_bb) { - if (else_bb) - join_bb = NULL; - else + next = then_bb; + if (else_bb && (next = next->next_bb) != else_bb) return FALSE; + if ((next = next->next_bb) != join_bb && join_bb != EXIT_BLOCK_PTR) + { + if (else_bb) + join_bb = NULL; + else + return FALSE; + } } + /* APPLE LOCAL end ARM enhance conditional insn generation */ /* Do the real work. */ ce_info->else_bb = else_bb; Modified: llvm-gcc-4.2/trunk/gcc/recog.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/recog.c?rev=54208&r1=54207&r2=54208&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/recog.c (original) +++ llvm-gcc-4.2/trunk/gcc/recog.c Wed Jul 30 03:02:52 2008 @@ -3005,7 +3005,12 @@ #else regno = raw_regno; #endif - +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER + if (mode == DImode) + regno = dimode_reg_alloc_order[raw_regno]; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ /* Don't allocate fixed registers. */ if (fixed_regs[regno]) continue; From bruno.cardoso at gmail.com Wed Jul 30 12:06:13 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 30 Jul 2008 17:06:13 -0000 Subject: [llvm-commits] [llvm] r54215 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200807301706.m6UH6DKW030883@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 30 12:06:13 2008 New Revision: 54215 URL: http://llvm.org/viewvc/llvm-project?rev=54215&view=rev Log: Fixed bug in global address lowering for functions and in Brcond lowering Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54215&r1=54214&r2=54215&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jul 30 12:06:13 2008 @@ -352,12 +352,14 @@ SDValue Dest = Op.getOperand(2); SDValue CondRes; - if (Op.getOperand(1).getOpcode() == ISD::AND) + if (Op.getOperand(1).getOpcode() == ISD::AND) { CondRes = Op.getOperand(1).getOperand(0); - else if (Op.getOperand(1).getOpcode() == MipsISD::FPCmp) + if (CondRes.getOpcode() != MipsISD::FPCmp) + return Op; + } else if (Op.getOperand(1).getOpcode() == MipsISD::FPCmp) CondRes = Op.getOperand(1); else - assert(0 && "Incoming condition flag unknown"); + return Op; SDValue CCNode = CondRes.getOperand(2); Mips::CondCode CC = (Mips::CondCode)cast(CCNode)->getValue(); @@ -431,11 +433,10 @@ SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); if (!Subtarget->hasABICall()) { - if (isa(GV)) return GA; const MVT *VTs = DAG.getNodeValueTypes(MVT::i32); SDValue Ops[] = { GA }; - - if (IsGlobalInSmallSection(GV)) { // %gp_rel relocation + // %gp_rel relocation + if (!isa(GV) && IsGlobalInSmallSection(GV)) { SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, VTs, 1, Ops, 1); SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); return DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); From isanbard at gmail.com Tue Jul 29 19:42:05 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 00:42:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54188 - in /llvm-gcc-4.2/trunk/gcc: c-cppbuiltin.c toplev.c tree-gimple.c Message-ID: <200807300042.m6U0g5at016017@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 19:42:05 2008 New Revision: 54188 URL: http://llvm.org/viewvc/llvm-project?rev=54188&view=rev Log: More merges with Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c llvm-gcc-4.2/trunk/gcc/toplev.c llvm-gcc-4.2/trunk/gcc/tree-gimple.c Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c?rev=54188&r1=54187&r2=54188&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Tue Jul 29 19:42:05 2008 @@ -368,13 +368,12 @@ else builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1); - gcc_assert (!*v || *v == ' ' || *v == '-' || *v == '('); + gcc_assert (!*v || *v == ' ' || *v == '-'); /* LLVM LOCAL no version number */ #ifndef LLVM_VERSION_INFO /* APPLE LOCAL begin Apple version */ -#ifdef CONFIG_DARWIN_H { /* This chunk of code defines __APPLE_CC__ from the version string. It expects to see a substring of the version string of @@ -398,7 +397,6 @@ abort (); builtin_define_with_value_n ("__APPLE_CC__", vt, q - vt); } -#endif /* APPLE LOCAL end Apple version */ /* LLVM LOCAL begin version number */ @@ -474,7 +472,6 @@ return; define__GNUC__ (); - /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM cpp_define (pfile, "__llvm__"); @@ -585,6 +582,11 @@ /* Other target-independent built-ins determined by command-line options. */ + /* APPLE LOCAL begin blocks */ + /* APPLE LOCAL radar 5868913 */ + if (flag_blocks && !c_dialect_cxx ()) + cpp_define (pfile, "__BLOCKS__=1"); + /* APPLE LOCAL end blocks */ if (optimize_size) cpp_define (pfile, "__OPTIMIZE_SIZE__"); if (optimize) Modified: llvm-gcc-4.2/trunk/gcc/toplev.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=54188&r1=54187&r2=54188&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/toplev.c (original) +++ llvm-gcc-4.2/trunk/gcc/toplev.c Tue Jul 29 19:42:05 2008 @@ -84,7 +84,9 @@ #include "tree-mudflap.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif /* LLVM LOCAL end */ #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO) Modified: llvm-gcc-4.2/trunk/gcc/tree-gimple.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-gimple.c?rev=54188&r1=54187&r2=54188&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-gimple.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-gimple.c Tue Jul 29 19:42:05 2008 @@ -157,6 +157,7 @@ } /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM static inline bool llvm_is_array_arrayref_extension(tree t) { @@ -170,6 +171,7 @@ #endif return false; } +#endif /* LLVM LOCAL end */ /* Return true if T is something whose address can be taken. */ @@ -178,8 +180,11 @@ is_gimple_addressable (tree t) { return (is_gimple_id (t) || handled_component_p (t) - /* LLVM LOCAL */ + /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM || llvm_is_array_arrayref_extension (t) +#endif + /* LLVM LOCAL end */ || INDIRECT_REF_P (t)); } From isanbard at gmail.com Tue Jul 29 19:52:15 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 00:52:15 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54190 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.c stub-objc.c Message-ID: <200807300052.m6U0qFwx016406@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 19:52:15 2008 New Revision: 54190 URL: http://llvm.org/viewvc/llvm-project?rev=54190&view=rev Log: More merges with Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c llvm-gcc-4.2/trunk/gcc/stub-objc.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=54190&r1=54189&r2=54190&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Tue Jul 29 19:52:15 2008 @@ -229,6 +229,15 @@ if (DECL_COMMON (decl)) return false; } + /* APPLE LOCAL begin 6077274 */ + /* Weak functions should always be indirected. */ + else if (SYMBOL_REF_FLAGS (sym_ref) & SYMBOL_FLAG_FUNCTION) + { + tree decl = SYMBOL_REF_DECL (sym_ref); + if (decl && DECL_WEAK (decl)) + return false; + } + /* APPLE LOCAL end 6077274 */ return true; } return false; @@ -2395,7 +2404,7 @@ { size_t numUniChars; const unsigned char *inbuf = (unsigned char *)TREE_STRING_POINTER (str); - utf16_str = objc_create_init_utf16_var (inbuf, length, &numUniChars); + utf16_str = create_init_utf16_var (inbuf, length, &numUniChars); if (!utf16_str) { warning (0, "input conversion stopped due to an input byte " @@ -2553,9 +2562,13 @@ /* APPLE LOCAL end kext v2 */ } /* APPLE LOCAL begin axe stubs 5571540 */ + /* APPLE LOCAL begin ARM 5683689 */ + /* Go ahead and generate stubs for old systems, just in case. */ - if (strverscmp (darwin_macosx_version_min, "10.5") < 0) + if (darwin_macosx_version_min + && strverscmp (darwin_macosx_version_min, "10.5") < 0) darwin_stubs = true; + /* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL end axe stubs 5571540 */ /* APPLE LOCAL diff confuses me */ } Modified: llvm-gcc-4.2/trunk/gcc/stub-objc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-objc.c?rev=54190&r1=54189&r2=54190&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-objc.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-objc.c Tue Jul 29 19:52:15 2008 @@ -562,15 +562,6 @@ return false; } /* APPLE LOCAL end radar 4985544 */ -/* APPLE LOCAL begin radar 2996215 */ -tree -objc_create_init_utf16_var (const unsigned char * ARG_UNUSED (inbuf), - size_t ARG_UNUSED (length), - size_t *ARG_UNUSED (numUniChars)) -{ - return NULL_TREE; -} -/* APPLE LOCAL end radar 2996215 */ /* APPLE LOCAL begin radar 5202926 */ bool objc_anonymous_local_objc_name (const char * ARG_UNUSED (name)) @@ -585,3 +576,35 @@ } /* APPLE LOCAL end radar 5195402 */ /* APPLE LOCAL end radar 5202926 */ + +/* APPLE LOCAL begin radar 5782740 - blocks */ +tree copy_in_object (tree exp) +{ + return exp; +} +tree retain_block_component (tree ARG_UNUSED (exp)) +{ + return NULL_TREE; +} +tree release_block_component (tree ARG_UNUSED (exp)) +{ + return NULL_TREE; +} +bool block_requires_copying (tree exp) +{ + return TREE_CODE (TREE_TYPE (exp)) == BLOCK_POINTER_TYPE; +} +/* APPLE LOCAL end radar 5782740 - blocks */ + +/* APPLE LOCAL begin radar 5802025 */ +tree objc_build_property_getter_func_call (tree object) +{ + return object; +} +/* APPLE LOCAL end radar 5802025 */ +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +tree cast_to_pointer_to_id (tree exp) +{ + return exp; +} +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ From isanbard at gmail.com Tue Jul 29 19:47:51 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 00:47:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54189 - in /llvm-gcc-4.2/trunk/gcc: cgraphunit.c flow.c Message-ID: <200807300047.m6U0lp1r016270@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 19:47:51 2008 New Revision: 54189 URL: http://llvm.org/viewvc/llvm-project?rev=54189&view=rev Log: More merges with Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/gcc/cgraphunit.c llvm-gcc-4.2/trunk/gcc/flow.c Modified: llvm-gcc-4.2/trunk/gcc/cgraphunit.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cgraphunit.c?rev=54189&r1=54188&r2=54189&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cgraphunit.c (original) +++ llvm-gcc-4.2/trunk/gcc/cgraphunit.c Tue Jul 29 19:47:51 2008 @@ -166,8 +166,11 @@ #include "tree-gimple.h" #include "tree-pass.h" #include "output.h" -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif +/* LLVM LOCAL end */ static void cgraph_expand_all_functions (void); static void cgraph_mark_functions_to_output (void); Modified: llvm-gcc-4.2/trunk/gcc/flow.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flow.c?rev=54189&r1=54188&r2=54189&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/flow.c (original) +++ llvm-gcc-4.2/trunk/gcc/flow.c Tue Jul 29 19:47:51 2008 @@ -143,6 +143,8 @@ #include "splay-tree.h" #include "tree-pass.h" #include "params.h" +/* APPLE LOCAL 5695218 */ +#include "reload.h" #ifndef HAVE_epilogue #define HAVE_epilogue 0 @@ -285,6 +287,14 @@ static int *reg_deaths; +/* APPLE LOCAL begin 5695218 */ +/* TRUE for normal operation. Set FALSE to avoid recomputing + REG_LIVE_LENGTH(). REG_LIVE_LENGTH is initially computed by flow, + and then modified by local_alloc. Another flow pass ("life3") + must not change the lifetimes. */ +static int normal_flow = 1; +/* APPLE LOCAL end 5695218 */ + /* Forward declarations */ static int verify_wide_reg_1 (rtx *, void *); static void verify_wide_reg (int, basic_block); @@ -330,6 +340,10 @@ static int count_or_remove_death_notes_bb (basic_block, int); static void allocate_bb_life_data (void); +/* APPLE LOCAL begin 5695218 */ +static void maybe_uses_pic_offset_table_rtx (struct propagate_block_info *pbi, rtx reg, + rtx cond ATTRIBUTE_UNUSED, rtx insn); +/* APPLE LOCAL end 5695218 */ /* Return the INSN immediately following the NOTE_INSN_BASIC_BLOCK note associated with the BLOCK. */ @@ -529,19 +543,25 @@ EXECUTE_IF_SET_IN_REG_SET (new_live_at_start, 0, i, rsi) { /* No registers should die. */ - if (REGNO_REG_SET_P (bb->il.rtl->global_live_at_start, i)) + /* APPLE LOCAL begin 5695218 */ + /* life3 pass added expressly so the pic-base/GOT could die here; not an error. */ + if (i != PIC_OFFSET_TABLE_REGNUM) { - if (dump_file) + if (REGNO_REG_SET_P (bb->il.rtl->global_live_at_start, i)) { - fprintf (dump_file, - "Register %d died unexpectedly.\n", i); - dump_bb (bb, dump_file, 0); + if (dump_file) + { + fprintf (dump_file, + "Register %d died unexpectedly.\n", i); + dump_bb (bb, dump_file, 0); + } + internal_error ("internal consistency failure"); } - internal_error ("internal consistency failure"); + /* Verify that the now-live register is wider than word_mode. */ + verify_wide_reg (i, bb); } - /* Verify that the now-live register is wider than word_mode. */ - verify_wide_reg (i, bb); } + /* APPLE LOCAL end 5695218 */ } } @@ -722,7 +742,10 @@ { if (regno_reg_rtx[i] != 0) { - REG_LIVE_LENGTH (i) = -1; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (i) = -1; + /* APPLE LOCAL end 5695218 */ REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN; } } @@ -1634,7 +1657,10 @@ REG_N_DEATHS (i) = 0; REG_N_CALLS_CROSSED (i) = 0; REG_N_THROWING_CALLS_CROSSED (i) = 0; - REG_LIVE_LENGTH (i) = 0; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (i) = 0; + /* APPLE LOCAL end 5695218 */ REG_FREQ (i) = 0; REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN; } @@ -2165,7 +2191,10 @@ EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i, rsi) { - REG_LIVE_LENGTH (i) += num - reg_deaths[i]; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (i) += num - reg_deaths[i]; + /* APPLE LOCAL end 5695218 */ reg_deaths[i] = 0; } } @@ -2939,7 +2968,10 @@ elsewhere, but we want the count to include the insn where the reg is set, and the normal counting mechanism would not count it. */ - REG_LIVE_LENGTH (i) += 1; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (i) += 1; + /* APPLE LOCAL end 5695218 */ } /* If this is a hard reg, record this function uses the reg. */ @@ -3052,7 +3084,10 @@ if ((pbi->flags & PROP_REG_INFO) && REGNO_REG_SET_P (pbi->reg_live, i)) { - REG_LIVE_LENGTH (i) += pbi->insn_num - reg_deaths[i]; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (i) += pbi->insn_num - reg_deaths[i]; + /* APPLE LOCAL end 5695218 */ reg_deaths[i] = 0; } CLEAR_REGNO_REG_SET (pbi->reg_live, i); @@ -3640,7 +3675,10 @@ if ((pbi->flags & PROP_REG_INFO) && REGNO_REG_SET_P (pbi->reg_live, regno)) { - REG_LIVE_LENGTH (regno) += pbi->insn_num - reg_deaths[regno]; + /* APPLE LOCAL begin 5695218 */ + if (normal_flow) + REG_LIVE_LENGTH (regno) += pbi->insn_num - reg_deaths[regno]; + /* APPLE LOCAL end 5695218 */ reg_deaths[regno] = 0; } CLEAR_REGNO_REG_SET (pbi->reg_live, REGNO (XEXP (note, 0))); @@ -3875,6 +3913,14 @@ } } + /* APPLE LOCAL begin 5695218 */ + /* If this pseudo register might turn into a reference involving the PIC register + (e.g. not allocated to a hard reg, reload substitutes initial mem-ref), + mark the PIC register alive. */ + if (flag_pic + && regno_first >= FIRST_PSEUDO_REGISTER) + maybe_uses_pic_offset_table_rtx (pbi, reg, cond, insn); + /* APPLE LOCAL end 5695218 */ /* Mark the register as being live. */ for (i = regno_first; i <= regno_last; ++i) { @@ -3946,6 +3992,46 @@ #endif } } +/* APPLE LOCAL begin 5695218 */ +static void +maybe_uses_pic_offset_table_rtx (struct propagate_block_info *pbi ATTRIBUTE_UNUSED, + rtx reg ATTRIBUTE_UNUSED, + rtx cond ATTRIBUTE_UNUSED, + rtx insn ATTRIBUTE_UNUSED) +{ + /* LLVM LOCAL */ +#ifndef ENABLE_LLVM + int found; + /* rtx step; */ + unsigned int regno = REGNO (reg); + extern sbitmap pic_rtx_inheritance; + + /* If we're not generating PIC code, or if the pic_offset_table_rtx + is never referenced, no PIC references are possible. x86_64 PIC + doesn't use a PIC-base/GOT register. */ + if (!pic_rtx_inheritance) + return; + + /* If this is the PIC-base (GOT) register, it's obviously used here. */ + if (regno < FIRST_PSEUDO_REGISTER + && regno == PIC_OFFSET_TABLE_REGNUM) + { + current_function_uses_pic_offset_table = 1; + mark_used_reg (pbi, pic_offset_table_rtx, cond, insn); + return; + } + + /* It's a pseudo register. See if we can tell where it came from. */ + found = TEST_BIT (pic_rtx_inheritance, regno); + if (found) + mark_used_reg (pbi, pic_offset_table_rtx, cond, insn); + /* LLVM LOCAL begin */ +#else + gcc_assert(0); +#endif + /* LLVM LOCAL end */ +} +/* APPLE LOCAL end 5695218 */ /* Scan expression X for registers which have to be marked used in PBI. X is considered to be the SET_DEST rtx of SET. TRUE is returned if @@ -4487,6 +4573,50 @@ return 0; } +/* APPLE LOCAL begin 5695218 */ +static bool gate_flow_lite (void); +static bool gate_flow_lite (void) +{ +#ifdef TARGET_386 + return !!optimize; +#else + return 0; +#endif +} +static unsigned int flow_lite (void); +/* Extra register life-analysis pass to determine the life of the + PIC-base/GOT register. */ +static unsigned int +flow_lite (void) +{ + /* LLVM LOCAL */ +#ifndef ENABLE_LLVM + extern sbitmap pic_rtx_inheritance; + if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + { + fixed_regs[PIC_OFFSET_TABLE_REGNUM] = call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 0; + CLEAR_HARD_REG_BIT (call_fixed_reg_set, PIC_OFFSET_TABLE_REGNUM); + CLEAR_HARD_REG_BIT (fixed_reg_set, PIC_OFFSET_TABLE_REGNUM); + CLEAR_HARD_REG_BIT (call_used_reg_set, PIC_OFFSET_TABLE_REGNUM); + } + normal_flow = 0; + count_or_remove_death_notes ((sbitmap)0, 1); + life_analysis (PROP_FINAL); + if (pic_rtx_inheritance) + { + sbitmap_free (pic_rtx_inheritance); + pic_rtx_inheritance = NULL; + } + normal_flow = 1; + /* LLVM LOCAL begin */ +#else + gcc_assert(0); +#endif + /* LLVM LOCAL end */ + return 0; +} +/* APPLE LOCAL end 5695218 */ + struct tree_opt_pass pass_recompute_reg_usage = { "life2", /* name */ @@ -4504,6 +4634,25 @@ 'f' /* letter */ }; +/* APPLE LOCAL begin 5695218 */ +struct tree_opt_pass pass_life3 = +{ + "life3", /* name */ + gate_flow_lite, /* gate */ + flow_lite, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 'f' /* letter */ +}; +/* APPLE LOCAL end 5695218 */ + /* Optionally removes all the REG_DEAD and REG_UNUSED notes from a set of blocks. If BLOCKS is NULL, assume the universal set. Returns a count of the number of registers that died. From isanbard at gmail.com Tue Jul 29 20:08:37 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 01:08:37 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54191 - in /llvm-gcc-4.2/trunk/gcc/cp: class.c decl.c init.c optimize.c Message-ID: <200807300108.m6U18bdM016892@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 20:08:37 2008 New Revision: 54191 URL: http://llvm.org/viewvc/llvm-project?rev=54191&view=rev Log: More merges with Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/gcc/cp/class.c llvm-gcc-4.2/trunk/gcc/cp/decl.c llvm-gcc-4.2/trunk/gcc/cp/init.c llvm-gcc-4.2/trunk/gcc/cp/optimize.c Modified: llvm-gcc-4.2/trunk/gcc/cp/class.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/class.c?rev=54191&r1=54190&r2=54191&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/class.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/class.c Tue Jul 29 20:08:37 2008 @@ -1316,6 +1316,12 @@ TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (basetype); TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype); + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + if (CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (basetype) + || CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (basetype)) + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (t) = 1; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype); TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (basetype); @@ -1474,6 +1480,13 @@ TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants) = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t); + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (variants) = + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (t); + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (variants) = + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (t); + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + TYPE_POLYMORPHIC_P (variants) = TYPE_POLYMORPHIC_P (t); TYPE_BINFO (variants) = TYPE_BINFO (t); @@ -2584,6 +2597,13 @@ { bool lazy_p = true; + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + /* Since this is an empty destructor, it can only be nontrivial + because one of its base classes has a destructor that must be + called. */ + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (t) = 1; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + if (TYPE_FOR_JAVA (t)) /* If this a Java class, any non-trivial destructor is invalid, even if compiler-generated. Therefore, if the @@ -3773,7 +3793,16 @@ } /* All user-declared destructors are non-trivial. */ if (DECL_DESTRUCTOR_P (x)) - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1; + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + { + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1; + + /* Conservatively assume that destructor body is nontrivial. Will + be unmarked during parsing of function body if it happens to be + trivial. */ + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (t) = 1; + } + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ } } Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=54191&r1=54190&r2=54191&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Tue Jul 29 20:08:37 2008 @@ -2464,6 +2464,39 @@ return check_previous_goto_1 (NULL_TREE, level, level->names, false, NULL); } +/* APPLE LOCAL begin blocks 6040305 (cp) */ +/* This routine issues a diagnostic if a __block variable is seen in + the current scope. This is for now called from a goto statement. */ +void +diagnose_byref_var_in_current_scope (void) +{ +#if 0 + /* FIXME finish this off. */ + struct c_scope *scope; + struct c_binding *b; + + gcc_assert (current_scope); + if (flag_objc_gc_only || !current_scope->byref_in_current_scope) + return; + + scope = current_scope; + while (scope && scope != file_scope) + { + for (b = scope->bindings; b; b = b->prev) + { + tree p = b->decl; + if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) { + error ("local byref variable %s is in the scope of this goto", + IDENTIFIER_POINTER (DECL_NAME (p))); + return; + } + } + scope = scope->outer; + } +#endif +} +/* APPLE LOCAL begin blocks 6040305 (cp) */ + /* Check that a new jump to a label DECL is OK. Called by finish_goto_stmt. */ @@ -2474,6 +2507,10 @@ bool saw_catch = false, identified = false; tree bad; + /* APPLE LOCAL begin 6040305 */ + diagnose_byref_var_in_current_scope (); + /* APPLE LOCAL end 6040305 */ + /* We can't know where a computed goto is jumping. So we assume that it's OK. */ if (TREE_CODE (decl) != LABEL_DECL) @@ -4049,18 +4086,6 @@ DECL_DLLIMPORT_P (decl) = 0; } - /* APPLE LOCAL begin mainline 2005-10-12 */ - /* Dllimported symbols cannot be defined. Static data members (which - can be initialized in-class and dllimported) go through grokfield, - not here, so we don't need to exclude those decls when checking for - a definition. */ - if (initialized && DECL_DLLIMPORT_P (decl)) - { - error ("definition of %q#D is marked %", decl); - DECL_DLLIMPORT_P (decl) = 0; - } - /* APPLE LOCAL end mainline 2005-10-12 */ - /* If #pragma weak was used, mark the decl weak now. */ maybe_apply_pragma_weak (decl); @@ -5889,6 +5914,16 @@ && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) return; + /* APPLE LOCAL begin radar 5733674 */ + if (c_dialect_objc () && flag_objc_gc && init && TREE_CODE (init) == INIT_EXPR) + { + tree result = objc_generate_write_barrier (TREE_OPERAND (init, 0), + INIT_EXPR, TREE_OPERAND (init, 1)); + if (result) + init = result; + } + /* APPLE LOCAL end radar 5733674 */ + if (DECL_FUNCTION_SCOPE_P (decl)) { /* Emit code to perform this initialization but once. */ @@ -7384,6 +7419,8 @@ case cdk_pointer: case cdk_reference: case cdk_ptrmem: + /* APPLE LOCAL blocks 6040305 */ + case cdk_block_pointer: break; case cdk_error: @@ -8079,6 +8116,33 @@ ctype = NULL_TREE; break; + /* APPLE LOCAL begin blocks 6040305 (cj) */ + case cdk_block_pointer: + if (TREE_CODE (type) != FUNCTION_TYPE) + { + error ("block pointer to non-function type is invalid"); + type = error_mark_node; + } + else + { + /* We now know that the TYPE_QUALS don't apply to the decl, + but to the target of the pointer. */ + type_quals = TYPE_UNQUALIFIED; + + type = build_block_pointer_type (type); + + if (declarator->u.pointer.qualifiers) + { + type + = cp_build_qualified_type (type, + declarator->u.pointer.qualifiers); + type_quals = cp_type_quals (type); + } + } + ctype = NULL_TREE; + break; + /* APPLE LOCAL end blocks 6040305 (cj) */ + case cdk_error: break; @@ -11868,8 +11932,28 @@ { tree type = TREE_TYPE (decl); - if (type != error_mark_node && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + tree dtor = NULL_TREE; + bool build_cleanup = false; + + if (TREE_CODE (type) == RECORD_TYPE) + dtor = CLASSTYPE_DESTRUCTORS (type); + + if (type != error_mark_node) + { + if (TREE_CODE (type) == RECORD_TYPE) + /* For RECORD_TYPEs, we can refer to more precise flags than + TYPE_HAS_NONTRIVIAL_DESTRUCTOR. */ + build_cleanup = (dtor && TREE_PRIVATE (dtor)) + || CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (type) + || CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (type); + else + build_cleanup = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type); + } + + if (build_cleanup) { + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ int flags = LOOKUP_NORMAL|LOOKUP_DESTRUCTOR; tree rval; bool has_vbases = (TREE_CODE (type) == RECORD_TYPE Modified: llvm-gcc-4.2/trunk/gcc/cp/init.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/init.c?rev=54191&r1=54190&r2=54191&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/init.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/init.c Tue Jul 29 20:08:37 2008 @@ -2921,7 +2921,13 @@ for (binfo = TYPE_BINFO (current_class_type), i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) { - if (TYPE_HAS_TRIVIAL_DESTRUCTOR (BINFO_TYPE (base_binfo)) + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + tree dtor = CLASSTYPE_DESTRUCTORS (BINFO_TYPE (base_binfo)); + + if ((!CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (BINFO_TYPE (base_binfo)) + && !CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (BINFO_TYPE (base_binfo)) + && !(dtor && (TREE_PRIVATE (dtor)))) + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ || BINFO_VIRTUAL_P (base_binfo)) continue; @@ -2951,6 +2957,12 @@ LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0); finish_decl_cleanup (NULL_TREE, expr); + + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + /* Even if body of current class's destructor was found to be empty, + it must now be called because it must delete its members. */ + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (current_class_type) = 1; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ } } } Modified: llvm-gcc-4.2/trunk/gcc/cp/optimize.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/optimize.c?rev=54191&r1=54190&r2=54191&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/optimize.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/optimize.c Tue Jul 29 20:08:37 2008 @@ -43,13 +43,58 @@ #include "tree-dump.h" #include "tree-gimple.h" +/* APPLE LOCAL begin ARM structor thunks */ +/* We detect cases where two cloned structors are identical, + and replace the body of one by a call to the other. This + is normally shrunk further by the sibcall optimization later. + + More could be done along these lines. Where the clones are + not identical, typically one consists of code identical to + the other one plus some additional code. It is possible + to replace the duplicated code with a call to the smaller + function. + + This is primarily a space optimization. One extra unconditional + branch may be executed. This is cheap or free on most modern + hardware and is probably less important than getting the size + down to reduce cache and paging problems (ymmv), so the + optimization is done unconditionally. +*/ +enum in_charge_use +{ + NO_THUNKS, /* cannot use thunks */ + ALL_THUNKS, /* all clones are equivalent (no in-charge + param, or unreferenced */ + IN_CHARGE_1, /* all uses of in-charge parm AND it with 1, so + clones with in-charge==0 and 2 are equivalent, + likewise 1 and 3 */ + IN_CHARGE_0 /* all uses of in-charge parm test it for equality + with 0, so clones with in-charge==1, 2 and 3 + are equivalent */ +}; +struct thunk_tree_walk_data +{ + tree in_charge_parm; + enum in_charge_use in_charge_use; +}; +struct clone_info +{ + int next_clone; + tree in_charge_value[3]; + tree clones[3]; + enum in_charge_use which_thunks_ok; +}; +/* APPLE LOCAL end ARM structor thunks */ + /* Prototypes. */ static void update_cloned_parm (tree, tree, bool); -/* APPLE LOCAL begin structor thunks */ -static int maybe_alias_body (tree fn, tree clone); -static int maybe_thunk_body (tree fn); -/* APPLE LOCAL end structor thunks */ +/* APPLE LOCAL begin ARM structor thunks */ +static void thunk_body (tree, tree, tree); +static tree examine_tree_for_in_charge_use (tree *, int *, void *); +static enum in_charge_use compute_use_thunks (tree); +static tree find_earlier_clone (struct clone_info *); +/* APPLE LOCAL end ARM structor thunks */ /* CLONED_PARM is a copy of CLONE, generated for a cloned constructor or destructor. Update it to ensure that the source-position for @@ -77,81 +122,125 @@ DECL_COMPLEX_GIMPLE_REG_P (cloned_parm) = DECL_COMPLEX_GIMPLE_REG_P (parm); } -/* APPLE LOCAL begin structor thunks */ -/* FN is a constructor or destructor, and there are FUNCTION_DECLs cloned from it nearby. - If the clone and the original funciton have identical parameter lists, - it is a fully-degenerate (does absolutely nothing) thunk. - Make the clone an alias for the original function label. */ -static int -maybe_alias_body (tree fn ATTRIBUTE_UNUSED, tree clone ATTRIBUTE_UNUSED) -{ - extern FILE *asm_out_file ATTRIBUTE_UNUSED; +/* APPLE LOCAL begin ARM structor thunks */ +/* Callback for walk_tree. We compute data->in_charge_use. */ -#ifdef ASM_MAYBE_ALIAS_BODY - ASM_MAYBE_ALIAS_BODY (asm_out_file, fn, clone); -#endif - return 0; +static tree +examine_tree_for_in_charge_use (tree *tp, int *walk_subtrees, void *vdata) +{ + struct thunk_tree_walk_data *data = (struct thunk_tree_walk_data *) vdata; + switch (TREE_CODE (*tp)) + { + case PARM_DECL: + if (*tp == data->in_charge_parm) + data->in_charge_use = NO_THUNKS; + return NULL; + case BIT_AND_EXPR: + if (TREE_OPERAND (*tp, 0) == data->in_charge_parm + && integer_onep (TREE_OPERAND (*tp, 1))) + { + *walk_subtrees = 0; + if (data->in_charge_use == ALL_THUNKS + || data->in_charge_use == IN_CHARGE_1) + data->in_charge_use = IN_CHARGE_1; + else + data->in_charge_use = NO_THUNKS; + } + return NULL; + case EQ_EXPR: + case NE_EXPR: + if (TREE_OPERAND (*tp, 0) == data->in_charge_parm + && integer_zerop (TREE_OPERAND (*tp, 1))) + { + *walk_subtrees = 0; + if (data->in_charge_use == ALL_THUNKS + || data->in_charge_use == IN_CHARGE_0) + data->in_charge_use = IN_CHARGE_0; + else + data->in_charge_use = NO_THUNKS; + } + return NULL; + default: + return NULL; + } } -/* FN is a constructor or destructor, and there are FUNCTION_DECLs - cloned from it nearby. Instead of cloning this body, leave it - alone and create tiny one-call bodies for the cloned - FUNCTION_DECLs. These clones are sibcall candidates, and their - resulting code will be very thunk-esque. */ -static int -maybe_thunk_body (tree fn) +/* Determine which clones of FN can use the thunk implementation. */ + +static enum in_charge_use +compute_use_thunks (tree fn) { - tree call, clone, expr_stmt, fn_parm, fn_parm_typelist, last_arg, start; - int parmno, vtt_parmno; + tree last_arg, fn_parm; - /* APPLE LOCAL disable de-cloner */ - if (TRUE || TARGET_KEXTABI || flag_clone_structors) - return 0; + if (DECL_HAS_VTT_PARM_P (fn)) + return NO_THUNKS; + + if (flag_apple_kext) + return NO_THUNKS; - /* If we've already seen this structor, avoid re-processing it. */ - if (TREE_ASM_WRITTEN (fn)) - return 1; + if (flag_clone_structors) + return NO_THUNKS; + + /* Functions that are too small will just get inlined back in anyway. + Let the inliner do something useful instead. */ + if (flag_inline_functions + && estimate_num_insns (DECL_SAVED_TREE (fn)) < MAX_INLINE_INSNS_AUTO) + return NO_THUNKS; /* If function accepts variable arguments, give up. */ last_arg = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fn))); if ( ! VOID_TYPE_P (TREE_VALUE (last_arg))) - return 0; + return NO_THUNKS; /* If constructor expects vector (AltiVec) arguments, give up. */ - for (fn_parm = DECL_ARGUMENTS( fn); fn_parm; fn_parm = TREE_CHAIN (fn_parm)) + for (fn_parm = DECL_ARGUMENTS (fn); fn_parm; fn_parm = TREE_CHAIN (fn_parm)) if (TREE_CODE (fn_parm) == VECTOR_TYPE) - return 0; + return NO_THUNKS; - /* If we don't see a clone, nothing to do. */ - clone = TREE_CHAIN (fn); - if (!clone || ! DECL_CLONED_FUNCTION_P (clone)) - return 0; + if (DECL_HAS_IN_CHARGE_PARM_P (fn)) + { + int parmno; + struct thunk_tree_walk_data data; + for (parmno = 0, fn_parm = DECL_ARGUMENTS (fn); + fn_parm; + ++parmno, fn_parm = TREE_CHAIN (fn_parm)) + if (parmno == 1) + { + data.in_charge_parm = fn_parm; + break; + } + /* If every use of the in-charge parameter ANDs it + with 1, then the functions that have in-charge + set to 1 and 3 are equivalent, likewise 0 and 2. + Check for this (common in practice). Likewise, + if every use tests for equality with 0, then + values 1, 2 and 3 are equivalent. */ + gcc_assert (data.in_charge_parm != NULL_TREE); + data.in_charge_use = ALL_THUNKS; + walk_tree_without_duplicates (&DECL_SAVED_TREE (fn), + examine_tree_for_in_charge_use, + &data); + return data.in_charge_use; + } - /* This is only a win if there are two or more clones. */ - if ( ! TREE_CHAIN (clone)) - return 0; + return ALL_THUNKS; +} + +/* An earlier version of this is in Apple's 4.0 tree, and some of the + modifications here are in 3983462. */ - /* Only thunk-ify non-trivial structors. */ - if (DECL_ESTIMATED_INSNS (fn) < 5) - return 0; - - /* If we got this far, we've decided to turn the clones into thunks. */ - - /* We're going to generate code for fn, so it is no longer "abstract." */ - /* APPLE LOCAL begin fix -gused debug info (radar 3271957 3262497) */ - /* Leave 'abstract' bit set for unified constructs and destructors when - -gused is used. */ - if (!(flag_debug_only_used_symbols - && DECL_DESTRUCTOR_P (fn) - && DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn)) - && !(flag_debug_only_used_symbols - && DECL_CONSTRUCTOR_P (fn) - && DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)) - ) - DECL_ABSTRACT (fn) = 0; - /* APPLE LOCAL end */ +/* FN is a constructor or destructor, and there are FUNCTION_DECLs + cloned from it nearby. Instead of cloning this body, leave it + alone and create tiny one-call bodies for the cloned + FUNCTION_DECLs. These clones are sibcall candidates, and their + resulting code will be very thunk-esque. */ +static void +thunk_body (tree clone, tree fn, tree clone_to_call) +{ + tree bind, block, call, fn_parm, fn_parm_typelist; + int parmno, vtt_parmno; + tree clone_parm, parmlist; - /* Find the vtt_parm, if present. */ for (vtt_parmno = -1, parmno = 0, fn_parm = DECL_ARGUMENTS (fn); fn_parm; ++parmno, fn_parm = TREE_CHAIN (fn_parm)) @@ -162,80 +251,108 @@ break; } } + /* Currently, we are not supposed to have a vtt argument. */ + gcc_assert(vtt_parmno == -1); - /* We know that any clones immediately follow FN in the TYPE_METHODS - list. */ - for (clone = start = TREE_CHAIN (fn); - clone && DECL_CLONED_FUNCTION_P (clone); - clone = TREE_CHAIN (clone)) + /* Walk parameter lists together, creating parameter list for call to original function. */ + for (parmno = 0, + parmlist = NULL, + fn_parm = DECL_ARGUMENTS (fn), + fn_parm_typelist = TYPE_ARG_TYPES (TREE_TYPE (fn)), + clone_parm = DECL_ARGUMENTS (clone); + fn_parm; + ++parmno, + fn_parm = TREE_CHAIN (fn_parm)) { - tree clone_parm, parmlist; + if (parmno == vtt_parmno && ! DECL_HAS_VTT_PARM_P (clone)) + { + tree typed_null_pointer_node = copy_node (null_pointer_node); + gcc_assert (fn_parm_typelist); + /* Clobber actual parameter with formal parameter type. */ + TREE_TYPE (typed_null_pointer_node) = TREE_VALUE (fn_parm_typelist); + parmlist = tree_cons (NULL, typed_null_pointer_node, parmlist); + } + else if (parmno == 1 && DECL_HAS_IN_CHARGE_PARM_P (fn)) + { + /* Just skip it. */ + } + /* Map other parameters to their equivalents in the cloned + function. */ + else + { + gcc_assert (clone_parm); + DECL_ABSTRACT_ORIGIN (clone_parm) = NULL; + parmlist = tree_cons (NULL, clone_parm, parmlist); + clone_parm = TREE_CHAIN (clone_parm); + } + if (fn_parm_typelist) + fn_parm_typelist = TREE_CHAIN (fn_parm_typelist); + } - /* If the clone and original parmlists are identical, turn the clone into an alias. */ - if (maybe_alias_body (fn, clone)) - continue; - - /* If we've already generated a body for this clone, avoid duplicating it. - (Is it possible for a clone-list to grow after we first see it?) */ - if (DECL_SAVED_TREE (clone) || TREE_ASM_WRITTEN (clone)) - continue; + /* We built this list backwards; fix now. */ + parmlist = nreverse (parmlist); - /* Start processing the function. */ - push_to_top_level (); - start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED); + TREE_USED (clone_to_call) = 1; + call = build_cxx_call (clone_to_call, parmlist); - /* Walk parameter lists together, creating parameter list for call to original function. */ - for (parmno = 0, - parmlist = NULL, - fn_parm = DECL_ARGUMENTS (fn), - fn_parm_typelist = TYPE_ARG_TYPES (TREE_TYPE (fn)), - clone_parm = DECL_ARGUMENTS (clone); - fn_parm; - ++parmno, - fn_parm = TREE_CHAIN (fn_parm)) - { - if (parmno == vtt_parmno && ! DECL_HAS_VTT_PARM_P (clone)) - { - tree typed_null_pointer_node = copy_node (null_pointer_node); - gcc_assert (fn_parm_typelist); - /* Clobber actual parameter with formal parameter type. */ - TREE_TYPE (typed_null_pointer_node) = TREE_VALUE (fn_parm_typelist); - parmlist = tree_cons (NULL, typed_null_pointer_node, parmlist); - } - else if (parmno == 1 && DECL_HAS_IN_CHARGE_PARM_P (fn)) - { - tree in_charge = copy_node (in_charge_arg_for_name (DECL_NAME (clone))); - parmlist = tree_cons (NULL, in_charge, parmlist); - } - /* Map other parameters to their equivalents in the cloned - function. */ - else - { - gcc_assert (clone_parm); - DECL_ABSTRACT_ORIGIN (clone_parm) = NULL; - parmlist = tree_cons (NULL, clone_parm, parmlist); - clone_parm = TREE_CHAIN (clone_parm); - } - if (fn_parm_typelist) - fn_parm_typelist = TREE_CHAIN (fn_parm_typelist); - } + for (parmlist = TREE_OPERAND (call, 1); parmlist; parmlist = TREE_CHAIN (parmlist)) + { + fn_parm = TREE_VALUE (parmlist); + /* Remove the EMPTY_CLASS_EXPR because it upsets estimate_num_insns(). */ + if (TREE_CODE (fn_parm) == COMPOUND_EXPR) + { + gcc_assert (TREE_CODE (TREE_OPERAND (fn_parm, 1)) == EMPTY_CLASS_EXPR); + TREE_VALUE (parmlist) = TREE_OPERAND (fn_parm, 0); + } + } + block = make_node (BLOCK); + if (targetm.cxx.cdtor_returns_this ()) + { + tree clone_result = DECL_RESULT (clone); + tree modify = build2 (MODIFY_EXPR, TREE_TYPE (clone_result), clone_result, call); + add_stmt (modify); + BLOCK_VARS (block) = clone_result; + } + else + { + add_stmt (call); + } + bind = c_build_bind_expr (block, cur_stmt_list); + DECL_SAVED_TREE (clone) = push_stmt_list (); + add_stmt (bind); +} - /* We built this list backwards; fix now. */ - parmlist = nreverse (parmlist); - mark_used (fn); - call = build_function_call (fn, parmlist); - expr_stmt = build_stmt (EXPR_STMT, call); - add_stmt (expr_stmt); +/* Determine whether the current clone (the one indexed by + INFO->NEXT_CLONE) can be implemented by a call to an + earlier (already emitted) clone. */ - /* Now, expand this function into RTL, if appropriate. */ - finish_function (0); - DECL_ABSTRACT_ORIGIN (clone) = NULL; - expand_body (clone); - pop_from_top_level (); - } - return 1; +static tree +find_earlier_clone (struct clone_info* info) +{ + int i; + + if (info->which_thunks_ok == NO_THUNKS + || info->next_clone == 0) + return NULL_TREE; + + if (info->which_thunks_ok == ALL_THUNKS) + return info->clones [0]; + + if (info->which_thunks_ok == IN_CHARGE_1) + for (i = 0; i < info->next_clone; i++) + if ((TREE_INT_CST_LOW (info->in_charge_value [i]) & 1) + == (TREE_INT_CST_LOW (info->in_charge_value [info->next_clone]) & 1)) + return info->clones [i]; + + if (info->which_thunks_ok == IN_CHARGE_0) + for (i = 0; i < info->next_clone; i++) + if ((TREE_INT_CST_LOW (info->in_charge_value [i]) == 0) + == (TREE_INT_CST_LOW (info->in_charge_value [info->next_clone]) == 0)) + return info->clones [i]; + + return NULL_TREE; } -/* APPLE LOCAL end structor thunks */ +/* APPLE LOCAL end ARM structor thunks */ /* FN is a function that has a complete body. Clone the body as necessary. Returns nonzero if there's no longer any need to @@ -246,6 +363,10 @@ { tree clone; bool first = true; +/* APPLE LOCAL begin ARM structor thunks */ + tree clone_to_call; + struct clone_info info; +/* APPLE LOCAL end ARM structor thunks */ /* We only clone constructors and destructors. */ if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn) @@ -255,6 +376,13 @@ /* Emit the DWARF1 abstract instance. */ (*debug_hooks->deferred_inline_function) (fn); +/* APPLE LOCAL begin ARM structor thunks */ + /* Figure out whether we can use the 'thunk' implementation, + and if so on which clones. */ + info.next_clone = 0; + info.which_thunks_ok = compute_use_thunks (fn); +/* APPLE LOCAL end ARM structor thunks */ + /* We know that any clones immediately follow FN in the TYPE_METHODS list. */ push_to_top_level (); @@ -262,8 +390,8 @@ { tree parm; tree clone_parm; - /* APPLE LOCAL structor thunks */ - /* Delete some local variables. */ + int parmno; + splay_tree decl_map; /* Update CLONE's source position information to match FN's. */ DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn); @@ -298,28 +426,6 @@ parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm)) /* Update this parameter. */ update_cloned_parm (parm, clone_parm, first); - /* APPLE LOCAL structor thunks */ - } - - /* APPLE LOCAL begin structor thunks */ - /* If we decide to turn clones into thunks, they will branch to fn. - Must have original function available to call. */ - if (maybe_thunk_body (fn)) - return 0; - /* APPLE LOCAL end structor thunks */ - - /* APPLE LOCAL begin structor thunks */ - /* We know that any clones immediately follow FN in the TYPE_METHODS - list. */ - for (clone = TREE_CHAIN (fn); - clone && DECL_CLONED_FUNCTION_P (clone); - clone = TREE_CHAIN (clone)) - { - tree parm; - tree clone_parm; - int parmno; - splay_tree decl_map; - /* APPLE LOCAL end structor thunks */ /* Start processing the function. */ start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED); @@ -341,6 +447,8 @@ splay_tree_insert (decl_map, (splay_tree_key) parm, (splay_tree_value) in_charge); + /* APPLE LOCAL ARM structor thunks */ + info.in_charge_value [info.next_clone] = in_charge; } else if (DECL_ARTIFICIAL (parm) && DECL_NAME (parm) == vtt_parm_identifier) @@ -382,11 +490,16 @@ splay_tree_insert (decl_map, (splay_tree_key) parm, (splay_tree_value) clone_parm); } - /* Clone the body. */ - clone_body (clone, fn, decl_map); - - /* Clean up. */ - splay_tree_delete (decl_map); + /* APPLE LOCAL begin ARM structor thunks */ + clone_to_call = find_earlier_clone (&info); + if (clone_to_call) + /* Bodies are identical; replace later one with call to an + earlier one. */ + thunk_body (clone, fn, clone_to_call); + else + /* Clone the body. */ + clone_body (clone, fn, decl_map); + /* APPLE LOCAL end ARM structor thunks */ /* The clone can throw iff the original function can throw. */ cp_function_chain->can_throw = !TREE_NOTHROW (fn); @@ -396,6 +509,10 @@ BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn); expand_or_defer_fn (clone); first = false; + /* APPLE LOCAL begin ARM structor thunks */ + info.clones [info.next_clone] = clone; + info.next_clone++; + /* APPLE LOCAL end ARM structor thunks */ } pop_from_top_level (); From resistor at mac.com Tue Jul 29 19:22:56 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jul 2008 00:22:56 -0000 Subject: [llvm-commits] [llvm] r54186 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200807300022.m6U0MuFd015456@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 29 19:22:56 2008 New Revision: 54186 URL: http://llvm.org/viewvc/llvm-project?rev=54186&view=rev Log: More fixes for corner cases when remapping live range indices. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54186&r1=54185&r2=54186&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Jul 29 19:22:56 2008 @@ -156,14 +156,13 @@ // following instruction. index = (LI->end - 1) / InstrSlots::NUM; offset = LI->end % InstrSlots::NUM; - if (offset == InstrSlots::USE) { + if (offset == InstrSlots::LOAD) { + // VReg dies at end of block. std::vector::const_iterator I = std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), LI->end); - // Take the pair containing the index - std::vector::const_iterator J = - (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; + --I; - LI->end = getMBBEndIdx(J->second) + 1; + LI->end = getMBBEndIdx(I->second) + 1; } else { unsigned idx = index; while (index < OldI2MI.size() && !OldI2MI[index]) ++index; @@ -195,16 +194,17 @@ // Remap the VNInfo kill indices, which works the same as // the end indices above. for (size_t i = 0; i < vni->kills.size(); ++i) { + // PHI kills don't need to be remapped. + if (!vni->kills[i]) continue; + index = (vni->kills[i]-1) / InstrSlots::NUM; offset = vni->kills[i] % InstrSlots::NUM; - if (offset == InstrSlots::USE) { + if (offset == InstrSlots::LOAD) { std::vector::const_iterator I = std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), vni->kills[i]); - // Take the pair containing the index - std::vector::const_iterator J = - (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; + --I; - vni->kills[i] = getMBBEndIdx(J->second) + 1; + vni->kills[i] = getMBBEndIdx(I->second) + 1; } else { unsigned idx = index; while (!OldI2MI[index]) ++index; From resistor at mac.com Tue Jul 29 19:21:17 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jul 2008 00:21:17 -0000 Subject: [llvm-commits] [llvm] r54185 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200807300021.m6U0LHVJ015406@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 29 19:21:16 2008 New Revision: 54185 URL: http://llvm.org/viewvc/llvm-project?rev=54185&view=rev Log: When merging live intervals, we also need to merge in any live ranges that are inputs to two-address instructions that themselves define a range we already care about. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54185&r1=54184&r2=54185&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Jul 29 19:21:16 2008 @@ -792,20 +792,49 @@ VNInfo* NewVN = LHS.getNextValue(RangeMergingIn->valno->def, RangeMergingIn->valno->copy, LI.getVNInfoAllocator()); - - for (LiveInterval::iterator RI = RHS.begin(), RE = RHS.end(); - RI != RE; ) - if (RI->valno == RHSVN) { - NewVN->hasPHIKill = true; - LiveRange NewRange(RI->start, RI->end, NewVN); - LHS.addRange(NewRange); + + // If we discover that a live range was defined by a two-addr + // instruction, we need to merge over the input as well, even if + // it has a different VNInfo. + SmallPtrSet MergedVNs; + MergedVNs.insert(RHSVN); + + DenseMap VNMap; + VNMap.insert(std::make_pair(RangeMergingIn->valno, NewVN)); + + bool changed = true; + while (changed) { + changed = false; + for (LiveInterval::iterator RI = RHS.begin(), RE = RHS.end(); + RI != RE; ) + if (MergedVNs.count(RI->valno)) { + NewVN->hasPHIKill = true; + LiveRange NewRange(RI->start, RI->end, VNMap[RI->valno]); + LHS.addRange(NewRange); + + MachineInstr* instr = LI.getInstructionFromIndex(RI->start); + for (unsigned i = 0; i < instr->getNumOperands(); ++i) { + if (instr->getOperand(i).isReg() && + instr->getOperand(i).getReg() == secondary) + if (instr->isRegReDefinedByTwoAddr(secondary, i)) { + VNInfo* twoaddr = RHS.getLiveRangeContaining(RI->start-1)->valno; + MergedVNs.insert(twoaddr); + + VNInfo* NextVN = LHS.getNextValue(twoaddr->def, + twoaddr->copy, + LI.getVNInfoAllocator()); + VNMap.insert(std::make_pair(twoaddr, NextVN)); + } + } - unsigned start = RI->start; - unsigned end = RI->end; - ++RI; - RHS.removeRange(start, end, true); - } else - ++RI; + unsigned start = RI->start; + unsigned end = RI->end; + ++RI; + RHS.removeRange(start, end, true); + changed = true; + } else + ++RI; + } if (RHS.begin() == RHS.end()) LI.removeInterval(RHS.reg); From eli.friedman at gmail.com Tue Jul 29 19:04:08 2008 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 30 Jul 2008 00:04:08 -0000 Subject: [llvm-commits] [llvm] r54184 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll Message-ID: <200807300004.m6U049nd014910@zion.cs.uiuc.edu> Author: efriedma Date: Tue Jul 29 19:04:08 2008 New Revision: 54184 URL: http://llvm.org/viewvc/llvm-project?rev=54184&view=rev Log: Fix for PR2607: SCEV miscomputing the loop count for loops with an SGT exit condition. Essentially, the correct way to flip an inequality in 2's complement is the not operator, not the negation operator. That said, the difference only affects cases involving INT_MIN. Also, enhance the pre-test search logic to be a bit smarter about inequalities flipped with a not operator, so it can eliminate the smax from the iteration count for simple loops. Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=54184&r1=54183&r2=54184&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jul 29 19:04:08 2008 @@ -1976,8 +1976,8 @@ break; } case ICmpInst::ICMP_SGT: { - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), - SE.getNegativeSCEV(RHS), L, true); + SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS), + SE.getNotSCEV(RHS), L, true); if (!isa(TC)) return TC; break; } @@ -2724,7 +2724,11 @@ if (!PreCondLHS->getType()->isInteger()) return false; - return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS); + SCEVHandle PreCondLHSSCEV = getSCEV(PreCondLHS); + SCEVHandle PreCondRHSSCEV = getSCEV(PreCondRHS); + return (LHS == PreCondLHSSCEV && RHS == PreCondRHSSCEV) || + (LHS == SE.getNotSCEV(PreCondRHSSCEV) && + RHS == SE.getNotSCEV(PreCondLHSSCEV)); } /// HowManyLessThans - Return the number of times a backedge containing the Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll?rev=54184&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll Tue Jul 29 19:04:08 2008 @@ -0,0 +1,27 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: -scalar-evolution-max-iterations=0 | \ +; RUN: grep -F "( -1 + ( -1 * %j)) iterations" +; PR2607 + +define i32 @_Z1aj(i32 %j) nounwind { +entry: + icmp sgt i32 0, %j ; :0 [#uses=1] + br i1 %0, label %bb.preheader, label %return + +bb.preheader: ; preds = %entry + br label %bb + +bb: ; preds = %bb, %bb.preheader + %i.01 = phi i32 [ %1, %bb ], [ 0, %bb.preheader ] ; [#uses=1] + add i32 %i.01, -1 ; :1 [#uses=3] + icmp sgt i32 %1, %j ; :2 [#uses=1] + br i1 %2, label %bb, label %return.loopexit + +return.loopexit: ; preds = %bb + br label %return + +return: ; preds = %return.loopexit, %entry + %i.0.lcssa = phi i32 [ 0, %entry ], [ %1, %return.loopexit ] ; [#uses=1] + ret i32 %i.0.lcssa +} + From isanbard at gmail.com Tue Jul 29 18:52:44 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 23:52:44 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54183 - in /llvm-gcc-4.2/trunk/gcc: builtins.c c-incpath.c passes.c Message-ID: <200807292352.m6TNqiTg014491@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 18:52:44 2008 New Revision: 54183 URL: http://llvm.org/viewvc/llvm-project?rev=54183&view=rev Log: Merges from Apple's GCC 4.2 r148430 Modified: llvm-gcc-4.2/trunk/gcc/builtins.c llvm-gcc-4.2/trunk/gcc/c-incpath.c llvm-gcc-4.2/trunk/gcc/passes.c Modified: llvm-gcc-4.2/trunk/gcc/builtins.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/builtins.c?rev=54183&r1=54182&r2=54183&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/builtins.c (original) +++ llvm-gcc-4.2/trunk/gcc/builtins.c Tue Jul 29 18:52:44 2008 @@ -71,8 +71,12 @@ required to implement the function call in all cases). */ tree implicit_built_in_decls[(int) END_BUILTINS]; -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif int get_pointer_alignment (tree, unsigned int); +/* LLVM LOCAL end */ static const char *c_getstr (tree); static rtx c_readstr (const char *, enum machine_mode); static int target_char_cast (tree, char *); @@ -141,6 +145,9 @@ static tree fold_builtin_inf (tree, int); static tree fold_builtin_nan (tree, tree, int); /* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif int validate_arglist (tree, ...); /* LLVM LOCAL end */ static bool integer_valued_real_p (tree); @@ -232,8 +239,12 @@ Otherwise, look at the expression to see if we can do better, i.e., if the expression is actually pointing at an object whose alignment is tighter. */ -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif int +/* LLVM LOCAL end */ get_pointer_alignment (tree exp, unsigned int max_align) { unsigned int align, inner; @@ -9360,6 +9371,9 @@ ellipses, otherwise the last specifier must be a VOID_TYPE. */ /* LLVM LOCAL begin */ +#ifndef ENABLE_LLVM +static +#endif int /* export this for LLVM to use*/ /* LLVM LOCAL end */ validate_arglist (tree arglist, ...) Modified: llvm-gcc-4.2/trunk/gcc/c-incpath.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-incpath.c?rev=54183&r1=54182&r2=54183&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-incpath.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-incpath.c Tue Jul 29 18:52:44 2008 @@ -176,6 +176,7 @@ } } + /* APPLE LOCAL begin headermaps 3871393 */ #include Modified: llvm-gcc-4.2/trunk/gcc/passes.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/passes.c?rev=54183&r1=54182&r2=54183&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/passes.c (original) +++ llvm-gcc-4.2/trunk/gcc/passes.c Tue Jul 29 18:52:44 2008 @@ -83,9 +83,9 @@ #include "tree-pass.h" #include "tree-dump.h" /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #include "llvm.h" -#ifdef ENABLE_LLVM /* LLVM doesn't need the GCC scheduler. Clear this so it need not be linked in. */ #undef INSN_SCHEDULING @@ -198,11 +198,11 @@ { /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM - timevar_push (TV_SYMOUT); - debug_hooks->type_decl (decl, !top_level); - timevar_pop (TV_SYMOUT); + timevar_push (TV_SYMOUT); + debug_hooks->type_decl (decl, !top_level); + timevar_pop (TV_SYMOUT); #else - llvm_emit_typedef (decl); + llvm_emit_typedef (decl); #endif /* LLVM LOCAL end */ } @@ -246,7 +246,7 @@ enum tree_dump_index i; struct dump_file_info *dfi; char *name; - + timevar_push (TV_DUMP); if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities) { @@ -725,6 +725,11 @@ NEXT_PASS (pass_sms); NEXT_PASS (pass_sched); NEXT_PASS (pass_local_alloc); + /* APPLE LOCAL begin 5695218 */ +#ifdef TARGET_386 + NEXT_PASS (pass_life3); +#endif + /* APPLE LOCAL end 5695218 */ NEXT_PASS (pass_global_alloc); NEXT_PASS (pass_postreload); *p = NULL; From isanbard at gmail.com Tue Jul 29 19:33:35 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 00:33:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54187 - in /llvm-gcc-4.2/trunk/gcc: config/darwin-driver.c config/darwin.h gcc.c Message-ID: <200807300033.m6U0XZpY015789@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 19:33:35 2008 New Revision: 54187 URL: http://llvm.org/viewvc/llvm-project?rev=54187&view=rev Log: More merges with Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-driver.c llvm-gcc-4.2/trunk/gcc/config/darwin.h llvm-gcc-4.2/trunk/gcc/gcc.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-driver.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-driver.c?rev=54187&r1=54186&r2=54187&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-driver.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-driver.c Tue Jul 29 19:33:35 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file mainline 2007-06-14 5235474 */ +/* APPLE LOCAL file 5235474 5683689 */ /* Additional functions for the GCC driver on Darwin native. Copyright (C) 2006, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -37,12 +37,17 @@ #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) #endif -/* When running on a Darwin system and using that system's headers and - libraries, default the -mmacosx-version-min flag to be the version - of the system on which the compiler is running. */ +/* This function is used when running on a Darwin system and using that + system's headers and libraries. Unless specified otherwise by + command-line options or environment variables, this routine will + set the appropriate version specification flag to a default value. + The version flag used is based on VERS_TYPE, and is either: + DARWIN_VERSION_MACOSX to use -mmacosx-version-min and + DARWIN_VERSION_IPHONEOS to use -miphoneos-version-min. */ void -darwin_default_min_version (int * argc_p, char *** argv_p) +darwin_default_min_version (int * argc_p, char *** argv_p, + enum darwin_version_type vers_type) { const int argc = *argc_p; char ** const argv = *argv_p; @@ -54,7 +59,7 @@ char * version_pend; int major_vers; char minor_vers[6]; - static char new_flag[sizeof ("-mmacosx-version-min=10.0.0") + 6]; + static char new_flag[sizeof ("-mxxxxxx-version-min=99.99.99") + 6]; /* If the command-line is empty, just return. */ if (argc <= 1) @@ -66,14 +71,17 @@ ((argv[1][1] == 'b') && (NULL != strchr(argv[1] + 2,'-'))))) return; - /* Don't do this if the user specified -mmacosx-version-min= or - -mno-macosx-version-min. */ + /* Don't do this if the user specified -mmacosx-version-min=, + -miphoneos-version-min, -mno-macosx-version-min, or + -mno-iphoneos-version-min. */ for (i = 1; i < argc; i++) if (argv[i][0] == '-') { const char * const p = argv[i]; if (strncmp (p, "-mno-macosx-version-min", 23) == 0 - || strncmp (p, "-mmacosx-version-min", 20) == 0) + || strncmp (p, "-mno-iphoneos-version-min", 25) == 0 + || strncmp (p, "-mmacosx-version-min", 20) == 0 + || strncmp (p, "-miphoneos-version-min", 22) == 0) return; /* It doesn't count if it's an argument to a different switch. */ @@ -87,12 +95,31 @@ it as a flag. */ { const char * macosx_deployment_target; + const char * iphoneos_deployment_target; + bool iphoneos_env_set, macosx_env_set; + macosx_deployment_target = getenv ("MACOSX_DEPLOYMENT_TARGET"); - if (macosx_deployment_target - /* Apparently, an empty string for MACOSX_DEPLOYMENT_TARGET means - "use the default". Or, possibly "use 10.1". We choose - to ignore the environment variable, as if it was never set. */ - && macosx_deployment_target[0]) + iphoneos_deployment_target = getenv ("IPHONEOS_DEPLOYMENT_TARGET"); + + /* We choose to ignore an environment variable set to an empty + string. */ + macosx_env_set = macosx_deployment_target + && macosx_deployment_target[0]; + iphoneos_env_set = iphoneos_deployment_target + && iphoneos_deployment_target[0]; + + if (macosx_env_set && iphoneos_env_set) + { + /* Conflicting DEPLOYMENT_TARGETs given. Don't emit a warning + for now (see rdar://5819018) -- just choose based on + VERS_TYPE. */ + if (vers_type == DARWIN_VERSION_IPHONEOS) + macosx_env_set = 0; + else + iphoneos_env_set = 0; + } + + if (macosx_env_set) { ++*argc_p; *argv_p = xmalloc (sizeof (char *) * *argc_p); @@ -102,8 +129,33 @@ memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *)); return; } + + if (iphoneos_env_set) + { + ++*argc_p; + *argv_p = xmalloc (sizeof (char *) * *argc_p); + (*argv_p)[0] = argv[0]; + (*argv_p)[1] = concat ("-miphoneos-version-min=", + iphoneos_deployment_target, NULL); + memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *)); + return; + } } + /* For iPhone OS, if no version number is specified, we default to + 2.0. */ + if (vers_type == DARWIN_VERSION_IPHONEOS) + { + ++*argc_p; + *argv_p = xmalloc (sizeof (char *) * *argc_p); + (*argv_p)[0] = argv[0]; + (*argv_p)[1] = xstrdup ("-miphoneos-version-min=2.0"); + memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *)); + return; + } + + gcc_assert (vers_type == DARWIN_VERSION_MACOSX); + /* Determine the version of the running OS. If we can't, warn user, and do nothing. */ if (sysctl (osversion_name, ARRAY_SIZE (osversion_name), osversion, Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=54187&r1=54186&r2=54187&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Tue Jul 29 19:33:35 2008 @@ -1541,8 +1541,6 @@ /* APPLE LOCAL begin mainline 2007-06-14 5235474 */ #ifndef CROSS_DIRECTORY_STRUCTURE /* APPLE LOCAL begin ARM 5683689 */ -/* LLVM FIXME: Uncomment!!! */ -#if 0 extern void darwin_default_min_version (int * argc, char *** argv, enum darwin_version_type vers_type); #define GCC_DRIVER_HOST_INITIALIZATION \ @@ -1550,13 +1548,6 @@ GCC_DRIVER_HOST_INITIALIZATION1; \ darwin_default_min_version (&argc, &argv, DARWIN_DEFAULT_VERSION_TYPE) /* APPLE LOCAL end ARM 5683689 */ -#else -extern void darwin_default_min_version (int * argc, char *** argv); -#define GCC_DRIVER_HOST_INITIALIZATION \ - /* APPLE LOCAL isysroot 5083137 */ \ - GCC_DRIVER_HOST_INITIALIZATION1; \ - darwin_default_min_version (&argc, &argv) -#endif #endif /* CROSS_DIRECTORY_STRUCTURE */ /* APPLE LOCAL end mainline 2007-06-14 5235474 */ Modified: llvm-gcc-4.2/trunk/gcc/gcc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gcc.c?rev=54187&r1=54186&r2=54187&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gcc.c (original) +++ llvm-gcc-4.2/trunk/gcc/gcc.c Tue Jul 29 19:33:35 2008 @@ -6460,7 +6460,8 @@ main (int argc, char **argv) { size_t i; - int value; + /* APPLE LOCAL uninit warning */ + int value = 0; int linker_was_run = 0; int lang_n_infiles = 0; int num_linker_inputs = 0; @@ -7000,9 +7001,7 @@ infiles[i].incompiler = lookup_compiler (infiles[i].name, strlen (infiles[i].name), infiles[i].language); - - if (value < 0) - this_file_error = 1; + } else if (traditional_cpp_flag) { @@ -7015,6 +7014,9 @@ } } + if (value < 0) + this_file_error = 1; + if (this_file_error) { delete_failure_queue (); From isanbard at gmail.com Tue Jul 29 17:46:07 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 22:46:07 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54177 - in /llvm-gcc-4.2/trunk: driverdriver.c gcc/optabs.c gcc/reload1.c gcc/tree.c Message-ID: <200807292246.m6TMk7Ha012200@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 17:46:06 2008 New Revision: 54177 URL: http://llvm.org/viewvc/llvm-project?rev=54177&view=rev Log: More merging to Apple's GCC 4.2 Modified: llvm-gcc-4.2/trunk/driverdriver.c llvm-gcc-4.2/trunk/gcc/optabs.c llvm-gcc-4.2/trunk/gcc/reload1.c llvm-gcc-4.2/trunk/gcc/tree.c Modified: llvm-gcc-4.2/trunk/driverdriver.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=54177&r1=54176&r2=54177&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/driverdriver.c (original) +++ llvm-gcc-4.2/trunk/driverdriver.c Tue Jul 29 17:46:06 2008 @@ -120,6 +120,11 @@ {"ppc", "powerpc"}, {"ppc64", "powerpc"}, {"x86_64", "i686"}, + {"arm", "arm"}, + {"armv4t", "arm"}, + {"armv5", "arm"}, + {"xscale", "arm"}, + {"armv6", "arm"}, {NULL, NULL} }; @@ -754,6 +759,16 @@ current_argv[arch_index] = "-march=pentium2"; else if (!strcmp (arches[index], "x86_64")) current_argv[arch_index] = "-m64"; + else if (!strcmp (arches[index], "arm")) + current_argv[arch_index] = "-march=armv4t"; + else if (!strcmp (arches[index], "armv4t")) + current_argv[arch_index] = "-march=armv4t"; + else if (!strcmp (arches[index], "armv5")) + current_argv[arch_index] = "-march=armv5tej"; + else if (!strcmp (arches[index], "xscale")) + current_argv[arch_index] = "-march=xscale"; + else if (!strcmp (arches[index], "armv6")) + current_argv[arch_index] = "-march=armv6k"; else count = 0; @@ -1251,7 +1266,6 @@ char *override_option_str = NULL; char path_buffer[2*PATH_MAX+1]; int linklen; - int delete_prefix = 0; total_argc = argc; prog_len = 0; @@ -1307,26 +1321,7 @@ curr_dir = (char *) malloc (sizeof (char) * (prefix_len + 1)); strncpy (curr_dir, argv[0], prefix_len); curr_dir[prefix_len] = '\0'; - /* LLVM LOCAL begin - These drivers live in /.../usr/llvm-gcc-4.2/bin */ -#if 0 - { - size_t curr_dir_len = strlen (curr_dir); - const char *llvm_bin_dir = "/usr/llvm-gcc-4.2/bin/"; - size_t bin_dir_len = strlen (llvm_bin_dir); - - if (curr_dir_len <= bin_dir_len || - strncmp (&curr_dir[curr_dir_len - bin_dir_len], llvm_bin_dir, bin_dir_len) != 0) { - driver_exec_prefix = - make_relative_prefix (argv[0], curr_dir, "/usr/llvm-gcc-4.2/bin/"); - delete_prefix = 1; - prefix_len = strlen (driver_exec_prefix); - } else - driver_exec_prefix = curr_dir; - } -#else - driver_exec_prefix = curr_dir; -#endif - /* LLVM LOCAL end - These drivers live in /.../usr/llvm-gcc-4.2/bin */ + driver_exec_prefix = (argv[0], "/usr/bin", curr_dir); #ifdef DEBUG fprintf (stderr,"%s: full progname = %s\n", progname, argv[0]); @@ -1628,11 +1623,5 @@ final_cleanup (); free (curr_dir); - /* LLVM LOCAL - begin */ -#if 0 - if (delete_prefix) - free (driver_exec_prefix); -#endif - /* LLVM LOCAL - end */ return greatest_status; } Modified: llvm-gcc-4.2/trunk/gcc/optabs.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/optabs.c?rev=54177&r1=54176&r2=54177&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/optabs.c (original) +++ llvm-gcc-4.2/trunk/gcc/optabs.c Tue Jul 29 17:46:06 2008 @@ -59,7 +59,9 @@ rtx libfunc_table[LTI_MAX]; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM tree llvm_libfunc_table[LTI_MAX]; +#endif /* LLVM LOCAL end */ /* Tables of patterns for converting one mode to another. */ @@ -5136,7 +5138,7 @@ } -/* LLVM local begin */ +/* LLVM LOCAL begin */ tree llvm_init_one_libfunc_impl (const char *name) { @@ -5144,25 +5146,22 @@ targetm.encode_section_info. */ /* ??? We don't have any type information except for this is a function. Pretend this is "int foo()". */ - tree decl; - - decl = build_decl (FUNCTION_DECL, get_identifier (name), - build_function_type (integer_type_node, NULL_TREE)); - + tree decl = build_decl (FUNCTION_DECL, get_identifier (name), + build_function_type (integer_type_node, NULL_TREE)); DECL_ARTIFICIAL (decl) = 1; DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; return decl; } +/* LLVM LOCAL end */ -/* LLVM local end */ rtx init_one_libfunc (const char *name) { rtx symbol; - /* LLVM local begin */ + /* LLVM LOCAL begin */ tree decl; #ifdef ENABLE_LLVM @@ -5170,7 +5169,7 @@ #endif decl = llvm_init_one_libfunc_impl (name); - /* LLVM local end */ + /* LLVM LOCAL end */ symbol = XEXP (DECL_RTL (decl), 0); Modified: llvm-gcc-4.2/trunk/gcc/reload1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/reload1.c?rev=54177&r1=54176&r2=54177&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/reload1.c (original) +++ llvm-gcc-4.2/trunk/gcc/reload1.c Tue Jul 29 17:46:06 2008 @@ -1797,6 +1797,21 @@ /* Among registers with equal cost, prefer caller-saved ones, or use REG_ALLOC_ORDER if it is defined. */ || (this_cost == best_cost +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER + && ((rl->mode == DImode + && dimode_inv_reg_alloc_order[regno] + < dimode_inv_reg_alloc_order[best_reg]) + || (rl->mode != DImode +#ifdef REG_ALLOC_ORDER + && (inv_reg_alloc_order[regno] + < inv_reg_alloc_order[best_reg]) +#else + && call_used_regs[regno] + && ! call_used_regs[best_reg] +#endif + )) +#else #ifdef REG_ALLOC_ORDER && (inv_reg_alloc_order[regno] < inv_reg_alloc_order[best_reg]) @@ -1804,6 +1819,8 @@ && call_used_regs[regno] && ! call_used_regs[best_reg] #endif +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ )) { best_reg = regno; Modified: llvm-gcc-4.2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=54177&r1=54176&r2=54177&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree.c Tue Jul 29 17:46:06 2008 @@ -1911,7 +1911,7 @@ case SAVE_EXPR: case COMPOUND_EXPR: case MODIFY_EXPR: case INIT_EXPR: case TARGET_EXPR: case WITH_CLEANUP_EXPR: case CLEANUP_POINT_EXPR: - /* These don't change the alignment of an object. */ + /* These don't change the alignment of an object. */ return expr_align (TREE_OPERAND (t, 0)); case COND_EXPR: @@ -5102,6 +5102,25 @@ return build_pointer_type_for_mode (to_type, ptr_mode, false); } +/* APPLE LOCAL begin radar 5732232 - blocks */ +tree +build_block_pointer_type (tree to_type) +{ + tree t; + + t = make_node (BLOCK_POINTER_TYPE); + + TREE_TYPE (t) = to_type; + TYPE_MODE (t) = ptr_mode; + + /* Lay out the type. This function has many callers that are concerned + with expression-construction, and this simplifies them all. */ + layout_type (t); + + return t; +} +/* APPLE LOCAL end radar 5732232 - blocks */ + /* Same as build_pointer_type_for_mode, but for REFERENCE_TYPE. */ tree @@ -6919,7 +6938,12 @@ /* APPLE LOCAL begin AltiVec */ outer = (TREE_CODE (type) == REFERENCE_TYPE ? build_reference_type (inner) - : build_pointer_type (inner)); + /* APPLE LOCAL begin blocks 5882266 */ + : (TREE_CODE (type) == BLOCK_POINTER_TYPE ? + build_block_pointer_type (inner) : + build_pointer_type (inner)) + ); + /* APPLE LOCAL end blocks 5882266 */ /* APPLE LOCAL end AltiVec */ } else if (TREE_CODE (type) == ARRAY_TYPE) From isanbard at gmail.com Tue Jul 29 18:24:37 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 23:24:37 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54180 - in /llvm-gcc-4.2/trunk/gcc: c-gimplify.c config.gcc config.host config/arm/arm.c config/arm/t-darwin config/darwin-c.c config/host-darwin.c config/rs6000/t-darwin convert.c cp/cp-lang.c genautomata.c stmt.c tree.h Message-ID: <200807292324.m6TNOcIP013447@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 18:24:37 2008 New Revision: 54180 URL: http://llvm.org/viewvc/llvm-project?rev=54180&view=rev Log: More merges from Apple GCC's 4.2 branch. Modified: llvm-gcc-4.2/trunk/gcc/c-gimplify.c llvm-gcc-4.2/trunk/gcc/config.gcc llvm-gcc-4.2/trunk/gcc/config.host llvm-gcc-4.2/trunk/gcc/config/arm/arm.c llvm-gcc-4.2/trunk/gcc/config/arm/t-darwin llvm-gcc-4.2/trunk/gcc/config/darwin-c.c llvm-gcc-4.2/trunk/gcc/config/host-darwin.c llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin llvm-gcc-4.2/trunk/gcc/convert.c llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c llvm-gcc-4.2/trunk/gcc/genautomata.c llvm-gcc-4.2/trunk/gcc/stmt.c llvm-gcc-4.2/trunk/gcc/tree.h Modified: llvm-gcc-4.2/trunk/gcc/c-gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-gimplify.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-gimplify.c Tue Jul 29 18:24:37 2008 @@ -204,6 +204,15 @@ switch (code) { + /* APPLE LOCAL begin radar 5732232 - blocks */ + case RETURN_EXPR: + if (current_function_decl && + BLOCK_HELPER_FUNC (current_function_decl)) { + tree ret_expr = TREE_OPERAND (*expr_p, 0); + TREE_OPERAND (*expr_p, 0) = c_finish_return (ret_expr); + } + return GS_UNHANDLED; + /* APPLE LOCAL end radar 5732232 - blocks */ case DECL_EXPR: /* This is handled mostly by gimplify.c, but we have to deal with not warning about int x = x; as it is a GCC extension to turn off Modified: llvm-gcc-4.2/trunk/gcc/config.gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config.gcc?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config.gcc (original) +++ llvm-gcc-4.2/trunk/gcc/config.gcc Tue Jul 29 18:24:37 2008 @@ -394,7 +394,8 @@ *-*-darwin*) tm_file="${tm_file} darwin.h" case ${target} in - *-*-darwin9*) + # APPLE LOCAL darwin10 5810054 + *-*-darwin[912]*) tm_file="${tm_file} darwin9.h" ;; esac @@ -793,7 +794,8 @@ arm*-*-darwin*) extra_options="${extra_options} arm/darwin.opt" tm_file="${tm_file} arm/darwin.h" - tmake_file="${tmake_file} arm/t-darwin" + tmake_file="${tmake_file} arm/t-darwin arm/t-slibgcc-iphoneos" + extra_headers= ;; # APPLE LOCAL end ARM darwin target arm*-wince-pe*) @@ -1057,7 +1059,7 @@ # Deleted a comment here. # APPLE LOCAL mainline with_cpu=${with_cpu:-core2} - # APPLE LOCAL Macintosh alignment 2002-2-19 --ff + # APPLE LOCAL Macintosh alignment 2002-2-19 --ff extra_options="${extra_options} i386/darwin.opt" # APPLE LOCAL 4099000 5681645 tmake_file="${tmake_file} t-slibgcc-darwin i386/t-darwin" @@ -1330,10 +1332,8 @@ target_gtfiles="\$(srcdir)/config/i386/winnt.c" extra_options="${extra_options} i386/cygming.opt" extra_objs="winnt.o winnt-stubs.o" -# LLVM LOCAL begin mainline - c_target_objs="cygwin2.o" + c_target_objs=cygwin2.o cxx_target_objs="cygwin2.o winnt-cxx.o" -# LLVM LOCAL end mainline extra_gcc_objs=cygwin1.o extra_parts="crtbegin.o crtend.o" if test x$enable_threads = xyes; then @@ -1350,7 +1350,7 @@ extra_options="${extra_options} i386/cygming.opt" extra_objs="winnt.o winnt-stubs.o" # LLVM LOCAL begin mainline - cxx_target_objs="winnt-cxx.o" + cxx_target_objs=winnt-cxx.o default_use_cxa_atexit=yes # LLVM LOCAL end mainline extra_parts="crtbegin.o crtend.o" @@ -1776,8 +1776,8 @@ use_fixproto=yes ;; powerpc-*-darwin*) - # APPLE LOCAL ARM 5681645 - tmake_file="${tmake_file} t-slibgcc-darwin" + # APPLE LOCAL ARM 5681645 + tmake_file="${tmake_file} t-slibgcc-darwin" extra_options="${extra_options} rs6000/darwin.opt" # APPLE LOCAL mainline candidate 2006-06-22 4512244 extra_parts="${extra_parts} crt2.o" @@ -1801,8 +1801,8 @@ ;; powerpc64-*-darwin*) tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" - # APPLE LOCAL ARM 5681645 - tmake_file="${tmake_file} t-slibgcc-darwin" + # APPLE LOCAL ARM 5681645 + tmake_file="${tmake_file} t-slibgcc-darwin" extra_options="${extra_options} ${cpu_type}/darwin.opt" # We're omitting t-darwin8 to avoid building any multilibs extra_headers=altivec.h Modified: llvm-gcc-4.2/trunk/gcc/config.host URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config.host?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config.host (original) +++ llvm-gcc-4.2/trunk/gcc/config.host Tue Jul 29 18:24:37 2008 @@ -91,6 +91,10 @@ # Generic darwin host support. out_host_hook_obj=host-darwin.o host_xmake_file="${host_xmake_file} x-darwin" + /* APPLE LOCAL begin ARM native compiler support */ + /* Default size of memory to set aside for precompiled headers */ + host_xm_defines='DARWIN_PCH_ADDR_SPACE_SIZE=1024*1024*1024' + /* APPLE LOCAL end ARM native compiler support */ ;; esac @@ -120,6 +124,13 @@ prefix=/gnu local_prefix=/gnu ;; +# APPLE LOCAL begin ARM native compiler support + arm-*-darwin*) + out_host_hook_obj="${out_host_hook_obj} host-arm-darwin.o" + host_xmake_file="${host_xmake_file} arm/x-darwin" + host_xm_defines='DARWIN_PCH_ADDR_SPACE_SIZE=64*1024*1024' + ;; +# APPLE LOCAL end ARM native compiler support hppa1.1-*-pro*) host_xmake_file="${host_xmake_file} pa/x-ada" ;; Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Tue Jul 29 18:24:37 2008 @@ -89,7 +89,12 @@ int, HOST_WIDE_INT); static const char *shift_op (rtx, HOST_WIDE_INT *); static struct machine_function *arm_init_machine_status (void); -static void thumb_exit (FILE *, int); +/* APPLE LOCAL begin compact switch tables */ +static int handle_thumb_unexpanded_prologue (FILE *, bool); +static int handle_thumb_unexpanded_epilogue (bool); +static int handle_thumb_exit (FILE *, int, bool); +static int handle_thumb_pushpop (FILE *, unsigned long, int, int *, unsigned long, bool); +/* APPLE LOCAL end compact switch tables */ static rtx is_jump_table (rtx); static HOST_WIDE_INT get_jump_table_size (rtx); static Mnode *move_minipool_fix_forward_ref (Mnode *, Mnode *, HOST_WIDE_INT); @@ -153,9 +158,13 @@ #ifdef OBJECT_FORMAT_ELF static void arm_elf_asm_constructor (rtx, int); #endif -#ifndef ARM_PE +/* APPLE LOCAL begin ARM darwin section_info */ +#if TARGET_MACHO +static void arm_darwin_encode_section_info (tree, rtx, int); +#elif !defined(ARM_PE) static void arm_encode_section_info (tree, rtx, int); #endif +/* APPLE LOCAL end ARM darwin section_info */ static void arm_file_end (void); @@ -213,6 +222,11 @@ static bool arm_binds_local_p (tree); #endif /* APPLE LOCAL end ARM darwin local binding */ +/* APPLE LOCAL begin 5946347 ms_struct support */ +static tree arm_handle_ms_struct_attribute (tree *, tree, tree, int, bool *); +static tree arm_handle_gcc_struct_attribute (tree *, tree, tree, int, bool *); +static bool arm_ms_bitfield_layout_p (tree); +/* APPLE LOCAL end 5946347 ms_struct support */ /* Initialize the GCC target structure. */ @@ -286,6 +300,10 @@ #undef TARGET_ENCODE_SECTION_INFO #ifdef ARM_PE #define TARGET_ENCODE_SECTION_INFO arm_pe_encode_section_info +/* APPLE LOCAL begin ARM darwin section_info */ +#elif TARGET_MACHO +#define TARGET_ENCODE_SECTION_INFO arm_darwin_encode_section_info +/* APPLE LOCAL end ARM darwin section_info */ #else #define TARGET_ENCODE_SECTION_INFO arm_encode_section_info #endif @@ -413,12 +431,19 @@ #define TARGET_BINDS_LOCAL_P arm_binds_local_p #endif /* APPLE LOCAL end ARM darwin local binding */ +/* APPLE LOCAL ARM 6008578 */ +static HOST_WIDE_INT get_label_pad (rtx, HOST_WIDE_INT); /* APPLE LOCAL begin ARM reliable backtraces */ #undef TARGET_BUILTIN_SETJMP_FRAME_VALUE #define TARGET_BUILTIN_SETJMP_FRAME_VALUE arm_builtin_setjmp_frame_value /* APPLE LOCAL end ARM reliable backtraces */ +/* APPLE LOCAL begin 5946347 ms_struct support */ +#undef TARGET_MS_BITFIELD_LAYOUT_P +#define TARGET_MS_BITFIELD_LAYOUT_P arm_ms_bitfield_layout_p +/* APPLE LOCAL end 5946347 ms_struct support */ + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -466,6 +491,15 @@ rtx thumb_call_via_label[14]; static int thumb_call_reg_needed; +/* APPLE LOCAL begin ARM compact switch tables */ +/* Keeps track of which *_switch* functions we've used, so we + can emit the right stubs. */ +static GTY(()) rtx switch8_libfunc; +static GTY(()) rtx switchu8_libfunc; +static GTY(()) rtx switch16_libfunc; +static GTY(()) rtx switch32_libfunc; +/* APPLE LOCAL end ARM compact switch tables */ + /* Bit values used to identify processor capabilities. */ #define FL_CO_PROC (1 << 0) /* Has external co-processor bus */ #define FL_ARCH3M (1 << 1) /* Extended multiply */ @@ -661,6 +695,7 @@ {"armv6j", arm1136js, "6J", FL_CO_PROC | FL_FOR_ARCH6J, NULL}, {"armv6k", mpcore, "6K", FL_CO_PROC | FL_FOR_ARCH6K, NULL}, #endif +/* APPLE LOCAL end ARM custom architectures */ {"armv6z", arm1176jzs, "6Z", FL_CO_PROC | FL_FOR_ARCH6Z, NULL}, {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC | FL_FOR_ARCH6ZK, NULL}, {"ep9312", ep9312, "4T", FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL}, @@ -808,11 +843,125 @@ } /* APPLE LOCAL end ARM custom frame layout */ +/* APPLE LOCAL begin ARM compact switch tables */ +/* These are library functions, but calls to them are not + represented as calls in the RTL because they do not have + normal function-call semantics. We generate the + Mach-O stuff lazily in this case. */ + +void register_switch8_libfunc (void) +{ +#if TARGET_MACHO + if (switch8_libfunc == NULL) + switch8_libfunc = gen_rtx_SYMBOL_REF (Pmode, + ggc_alloc_string ("__switch8", sizeof ("__switch8"))); + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + machopic_validate_stub_or_non_lazy_ptr + (machopic_indirection_name (switch8_libfunc, true)); +#endif +} + +void register_switchu8_libfunc (void) +{ +#if TARGET_MACHO + if (switchu8_libfunc == NULL) + switchu8_libfunc = gen_rtx_SYMBOL_REF (Pmode, + ggc_alloc_string ("__switchu8", sizeof ("__switchu8"))); + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + machopic_validate_stub_or_non_lazy_ptr + (machopic_indirection_name (switchu8_libfunc, true)); +#endif +} + +void register_switch16_libfunc (void) +{ +#if TARGET_MACHO + if (switch16_libfunc == NULL) + switch16_libfunc = gen_rtx_SYMBOL_REF (Pmode, + ggc_alloc_string ("__switch16", sizeof ("__switch16"))); + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + machopic_validate_stub_or_non_lazy_ptr + (machopic_indirection_name (switch16_libfunc, true)); +#endif +} + +void register_switch32_libfunc (void) +{ +#if TARGET_MACHO + if (switch32_libfunc == NULL) + switch32_libfunc = gen_rtx_SYMBOL_REF (Pmode, + ggc_alloc_string ("__switch32", sizeof ("__switch32"))); + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + machopic_validate_stub_or_non_lazy_ptr + (machopic_indirection_name (switch32_libfunc, true)); +#endif +} +/* APPLE LOCAL end ARM compact switch tables */ + /* Set up library functions unique to ARM. */ static void arm_init_libfuncs (void) { + /* APPLE LOCAL begin ARM 4702983 Thumb VFP math */ + if (TARGET_MACHO && TARGET_THUMB && !TARGET_SOFT_FLOAT + && (flag_pic || MACHO_DYNAMIC_NO_PIC_P)) + { + /* Double-precision floating-point arithmetic. */ + set_optab_libfunc (add_optab, DFmode, "__adddf3vfp"); + set_optab_libfunc (sdiv_optab, DFmode, "__divdf3vfp"); + set_optab_libfunc (smul_optab, DFmode, "__muldf3vfp"); + set_optab_libfunc (neg_optab, DFmode, NULL); + set_optab_libfunc (sub_optab, DFmode, "__subdf3vfp"); + + /* Double-precision comparisons. */ + set_optab_libfunc (eq_optab, DFmode, "__eqdf2vfp"); + set_optab_libfunc (ne_optab, DFmode, "__nedf2vfp"); + set_optab_libfunc (lt_optab, DFmode, "__ltdf2vfp"); + set_optab_libfunc (le_optab, DFmode, "__ledf2vfp"); + set_optab_libfunc (ge_optab, DFmode, "__gedf2vfp"); + set_optab_libfunc (gt_optab, DFmode, "__gtdf2vfp"); + set_optab_libfunc (unord_optab, DFmode, "__unorddf2vfp"); + + /* Single-precision floating-point arithmetic. */ + set_optab_libfunc (add_optab, SFmode, "__addsf3vfp"); + set_optab_libfunc (sdiv_optab, SFmode, "__divsf3vfp"); + set_optab_libfunc (smul_optab, SFmode, "__mulsf3vfp"); + set_optab_libfunc (neg_optab, SFmode, NULL); + set_optab_libfunc (sub_optab, SFmode, "__subsf3vfp"); + + /* Single-precision comparisons. */ + set_optab_libfunc (eq_optab, SFmode, "__eqsf2vfp"); + set_optab_libfunc (ne_optab, SFmode, "__nesf2vfp"); + set_optab_libfunc (lt_optab, SFmode, "__ltsf2vfp"); + set_optab_libfunc (le_optab, SFmode, "__lesf2vfp"); + set_optab_libfunc (ge_optab, SFmode, "__gesf2vfp"); + set_optab_libfunc (gt_optab, SFmode, "__gtsf2vfp"); + set_optab_libfunc (unord_optab, SFmode, "__unordsf2vfp"); + + /* Floating-point to integer conversions. */ + /* DImode conversions are done via library routines even + when generating VFP instructions, so use the same ones. */ + set_conv_libfunc (sfix_optab, SImode, DFmode, "__fixdfsivfp"); + set_conv_libfunc (ufix_optab, SImode, DFmode, "__fixunsdfsivfp"); + set_conv_libfunc (sfix_optab, SImode, SFmode, "__fixsfsivfp"); + set_conv_libfunc (ufix_optab, SImode, SFmode, "__fixunssfsivfp"); + + /* Conversions between floating types. */ + set_conv_libfunc (trunc_optab, SFmode, DFmode, "__truncdfsf2vfp"); + set_conv_libfunc (sext_optab, DFmode, SFmode, "__extendsfdf2vfp"); + + /* Integer to floating-point conversions. */ + /* DImode conversions are done via library routines even + when generating VFP instructions, so use the same ones. */ + set_conv_libfunc (sfloat_optab, DFmode, SImode, "__floatsidfvfp"); + set_conv_libfunc (ufloat_optab, DFmode, SImode, "__floatunssidfvfp"); + set_conv_libfunc (sfloat_optab, SFmode, SImode, "__floatsisfvfp"); + set_conv_libfunc (ufloat_optab, SFmode, SImode, "__floatunssisfvfp"); + return; + } + /* APPLE LOCAL end ARM 4702983 Thumb VFP math */ + /* There are no special library functions unless we are using the ARM BPABI. */ if (!TARGET_BPABI) @@ -1560,6 +1709,91 @@ return cfun->machine->func_type; } +/* APPLE LOCAL begin ARM indirect sibcalls */ +/* Look for an indirect sibling call that uses a callee-saved reg. + We'll need to copy this reg to IP and change the call, since + the callee-saved reg will be clobbered by the restore of the old + value. (This negates the code size advantage of the sibcall, but + not the gain in stack size at runtime.) */ + +static int +indirect_sibreturn_reg (rtx sibling, bool *is_value) +{ + if (GET_CODE (sibling) == CALL_INSN + && GET_CODE (PATTERN (sibling)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (sibling), 0, 0)) == CALL + && GET_CODE (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0)) == MEM + && GET_CODE (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0)) == REG) + { + *is_value = 0; + return REGNO (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0)); + } + if (GET_CODE (sibling) == CALL_INSN + && GET_CODE (PATTERN (sibling)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (sibling), 0, 0)) == SET + && GET_CODE (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1)) == CALL + && GET_CODE (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0)) == MEM + && GET_CODE (XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0)) == REG) + { + *is_value = 1; + return REGNO (XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0)); + } + return -1; +} + +/* Look for an indirect sibling call that uses a memory location, at + reg + or - constant; this will be a stack location, but registers + other than SP and FP are possible with large stack frames. + We'll need to load this location into IP and change the call, since + a memory location is not valid in the instruction. (The usual approach + of forcing reload to copy the value into a register through predicates + and constraints will not work here, as the load would come out after + the restore of FP and SP, too late.) + Return value = signed offset from register *reg (usually SP or FP). + Null if this case doesn't apply. + We do not check for offsets too big to fit in a load, nor offsets in a + register; it is believed that these cases cannot occur. */ + +static rtx +indirect_sibreturn_mem (rtx sibling, rtx* reg, bool *is_value) +{ + rtx mem = NULL_RTX; + if (GET_CODE (sibling) == CALL_INSN + && GET_CODE (PATTERN (sibling)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (sibling), 0, 0)) == CALL + && GET_CODE (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0)) == MEM + && GET_CODE (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0)) == MEM) + { + *is_value = 0; + mem = XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0); + } + else if (GET_CODE (sibling) == CALL_INSN + && GET_CODE (PATTERN (sibling)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (sibling), 0, 0)) == SET + && GET_CODE (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1)) == CALL + && GET_CODE (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0)) == MEM + && GET_CODE (XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0)) == MEM) + { + *is_value = 1; + mem = XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0); + } + if (mem + && GET_CODE (XEXP (mem, 0)) == PLUS + && GET_CODE (XEXP (XEXP (mem, 0), 0)) == REG + && GET_CODE (XEXP (XEXP (mem, 0), 1)) == CONST_INT) + { + *reg = XEXP (XEXP (mem, 0), 0); + return XEXP (XEXP (mem, 0), 1); + } + else if (mem && GET_CODE (XEXP (mem, 0)) == REG) + { + *reg = XEXP (mem, 0); + return const0_rtx; + } + return NULL_RTX; +} +/* APPLE LOCAL end ARM indirect sibcalls */ + /* Return 1 if it is possible to return using a single instruction. If SIBLING is non-null, this is a test for a return before a sibling call. SIBLING is the call insn, so we can examine its register usage. */ @@ -1637,6 +1871,16 @@ if (find_regno_fusage (sibling, USE, 3)) return 0; + + /* APPLE LOCAL begin ARM indirect sibcalls */ + /* ... or to hold the target address for an indirect sibcall. */ + { + bool ignored; + int regno = indirect_sibreturn_reg (sibling, &ignored); + if (regno == 3) + return 0; + } + /* APPLE LOCAL end ARM indirect sibcalls */ } /* ... and that there are no call-saved registers in r0-r2 @@ -1671,6 +1915,20 @@ if (saved_int_regs && !(saved_int_regs & (1 << LR_REGNUM))) return 0; + /* APPLE LOCAL begin ARM indirect sibcalls */ + /* If we have an indirect sibcall that uses a saved reg, we'll need + to copy that value into IP before restoring. */ + if (sibling) + { + bool ignored; + int regno = indirect_sibreturn_reg (sibling, &ignored); + if (regno > 3 && regno != 12) + return 0; + if (regno == -1) + return 0; + } + /* APPLE LOCAL end ARM indirect sibcalls */ + /* Can't be done if any of the FPA regs are pushed, since this also requires an insn. */ if (TARGET_HARD_FLOAT && TARGET_FPA) @@ -2976,6 +3234,10 @@ { "dllexport", 0, 0, false, false, false, handle_dll_attribute }, { "notshared", 0, 0, false, true, false, arm_handle_notshared_attribute }, #endif +/* APPLE LOCAL begin 5946347 ms_struct support */ + { "ms_struct", 0, 0, false, false, false, arm_handle_ms_struct_attribute }, + { "gcc_struct", 0, 0, false, false, false, arm_handle_gcc_struct_attribute }, +/* APPLE LOCAL end 5946347 ms_struct support */ /* APPLE LOCAL begin ARM darwin attributes */ #ifdef SUBTARGET_ATTRIBUTE_TABLE SUBTARGET_ATTRIBUTE_TABLE, @@ -3138,8 +3400,11 @@ #if TARGET_MACHO rtx sym_ref = XEXP (DECL_RTL (decl), 0); - /* Do not allow weak functions to be treated as short call. */ - if (DECL_WEAK (decl) && flag == SYMBOL_SHORT_CALL) + /* Do not allow weak functions with default visibility to be treated + as short call. */ + if (DECL_WEAK (decl) + && DECL_VISIBILITY (decl) == VISIBILITY_DEFAULT + && flag == SYMBOL_SHORT_CALL) return; SYMBOL_REF_FLAGS (sym_ref) |= flag; @@ -3186,6 +3451,24 @@ type_attr_list = tree_cons (attr_name, NULL_TREE, type_attr_list); TYPE_ATTRIBUTES (type) = type_attr_list; } + /* APPLE LOCAL begin 5946347 ms_struct support */ + /* If -mms-bitfields is active and this is a structure or union type + definition, then add an ms_struct attribute. */ +#if TARGET_MACHO + else if ((TARGET_MS_BITFIELD_LAYOUT || darwin_ms_struct) + && (TREE_CODE (type) == RECORD_TYPE + || TREE_CODE (type) == UNION_TYPE)) +#else + else if (TARGET_MS_BITFIELD_LAYOUT + && (TREE_CODE (type) == RECORD_TYPE + || TREE_CODE (type) == UNION_TYPE)) +#endif + { + TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("ms_struct"), + NULL_TREE, + TYPE_ATTRIBUTES (type)); + } + /* APPLE LOCAL end 5946347 ms_struct support */ } /* Return 1 if the operand is a SYMBOL_REF for a function known to be @@ -3292,11 +3575,18 @@ if (cfun->machine->sibcall_blocked) return false; + /* APPLE LOCAL begin ARM indirect sibcalls */ /* Never tailcall something for which we have no decl, or if we are in Thumb mode. */ - if (decl == NULL || TARGET_THUMB) + if (TARGET_THUMB) return false; + /* All indirect calls are within range, since we load the address into a + register. */ + if (decl == NULL) + return true; + /* APPLE LOCAL end ARM indirect sibcalls */ + /* Get the calling method. */ if (lookup_attribute ("short_call", TYPE_ATTRIBUTES (TREE_TYPE (decl)))) call_type = CALL_SHORT; @@ -4239,7 +4529,17 @@ if (arm_tls_symbol_p (x)) return legitimize_tls_address (x, NULL_RTX); - if (GET_CODE (x) == PLUS) + /* APPLE LOCAL begin ARM addresses involving large constants */ + if (flag_pic) + { + /* We need to find and carefully transform any SYMBOL and LABEL + references; so go back to the original address expression. */ + rtx new_x = legitimize_pic_address (orig_x, mode, NULL_RTX); + + if (new_x != orig_x) + x = new_x; + } + else if (GET_CODE (x) == PLUS) { rtx xop0 = XEXP (x, 0); rtx xop1 = XEXP (x, 1); @@ -4247,16 +4547,42 @@ if (CONSTANT_P (xop0) && !symbol_mentioned_p (xop0)) xop0 = force_reg (SImode, xop0); - if (CONSTANT_P (xop1) && !symbol_mentioned_p (xop1)) + if (CONSTANT_P (xop1) && !symbol_mentioned_p (xop1) + && GET_CODE (xop1) != CONST_INT) xop1 = force_reg (SImode, xop1); - if (ARM_BASE_REGISTER_RTX_P (xop0) - && GET_CODE (xop1) == CONST_INT) + if (GET_CODE (xop1) == CONST_INT) { HOST_WIDE_INT n, low_n; rtx base_reg, val; - n = INTVAL (xop1); + /* Look for + (+ (+ (foo, SFP) const)). It is better to rearrange this as + (+ (foo (+ (SFP, const))). The eventual SP + const1 + const will + get folded. */ + + if (GET_CODE (xop0) == PLUS) + { + rtx xop00 = XEXP (xop0, 0); + rtx xop01 = XEXP (xop0, 1); + + if (xop01 == virtual_stack_vars_rtx) + { + base_reg = gen_reg_rtx (SImode); + val = force_operand (gen_rtx_PLUS (SImode, xop01, xop1), + NULL_RTX); + emit_move_insn (base_reg, val); + /* Canonical form requires some non-reg ops to be first. */ + x = gen_rtx_PLUS (SImode, xop00, base_reg); + return x; + } + } + + n = INTVAL (xop1); + /* The size of constant that fits in a load or store instruction + is different for different sized operations. Break N into + low_n (the part that will fit in the instruction) and n + (the part that won't). */ /* VFP addressing modes actually allow greater offsets, but for now we just stick with the lowest common denominator. */ if (mode == DImode @@ -4270,6 +4596,11 @@ low_n -= 16; } } + else if ((mode == HImode || mode == QImode) && arm_arch4) + { + low_n = n >= 0 ? (n & 0xff) : -((-n) & 0xff); + n -= low_n; + } else { low_n = ((mode) == TImode ? 0 @@ -4277,10 +4608,17 @@ n -= low_n; } - base_reg = gen_reg_rtx (SImode); - val = force_operand (plus_constant (xop0, n), NULL_RTX); - emit_move_insn (base_reg, val); - x = plus_constant (base_reg, low_n); + if (n != 0) + { + /* Emit an auxiliary instruction to compute base+high_part + into a register base_reg, then return base_reg+low_part. */ + base_reg = gen_reg_rtx (SImode); + val = force_operand (plus_constant (xop0, n), NULL_RTX); + emit_move_insn (base_reg, val); + x = plus_constant (base_reg, low_n); + } + else if (xop0 != XEXP (x, 0) || xop1 != XEXP (x, 1)) + x = gen_rtx_PLUS (SImode, xop0, xop1); } else if (xop0 != XEXP (x, 0) || xop1 != XEXP (x, 1)) x = gen_rtx_PLUS (SImode, xop0, xop1); @@ -4314,14 +4652,14 @@ rtx base_reg; /* ldr and ldrb can use a 12 bit index, ldrsb and the rest can only - use a 8 bit index. So let's use a 12 bit index for SImode only and - hope that arm_gen_constant will enable ldrb to use more bits. */ + use a 8 bit index. So let's use a 12 bit index for SImode only and + hope that arm_gen_constant will enable ldrb to use more bits. */ bits = (mode == SImode) ? 12 : 8; mask = (1 << bits) - 1; base = INTVAL (x) & ~mask; index = INTVAL (x) & mask; if (bit_count (base & 0xffffffff) > (32 - bits)/2) - { + { /* It'll most probably be more efficient to generate the base with more bits set and use a negative index instead. */ base |= mask; @@ -4330,16 +4668,7 @@ base_reg = force_reg (SImode, GEN_INT (base)); x = plus_constant (base_reg, index); } - - if (flag_pic) - { - /* We need to find and carefully transform any SYMBOL and LABEL - references; so go back to the original address expression. */ - rtx new_x = legitimize_pic_address (orig_x, mode, NULL_RTX); - - if (new_x != orig_x) - x = new_x; - } + /* APPLE LOCAL end ARM addresses involving large constants */ return x; } @@ -4638,6 +4967,113 @@ } } +/* APPLE LOCAL begin ARM size variant of thumb costs */ +/* This is very much a work in progress; it is just thumb_rtx_costs + with modifications for size as discovered. Currently, the costs + for MULT, AND, XOR, IOR have been fixed; all of these are single + instructions. (Not for DImode, but that's not taken into account + anywhere here.) */ + +static inline int +thumb_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + case ROTATERT: + case PLUS: + case MINUS: + case COMPARE: + case NEG: + case NOT: + case AND: + case XOR: + case IOR: + case MULT: + return COSTS_N_INSNS (1); + + case SET: + return (COSTS_N_INSNS (1) + + 4 * ((GET_CODE (SET_SRC (x)) == MEM) + + GET_CODE (SET_DEST (x)) == MEM)); + + case CONST_INT: + if (outer == SET) + { + if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256) + return 0; + if (thumb_shiftable_const (INTVAL (x))) + return COSTS_N_INSNS (2); + return COSTS_N_INSNS (3); + } + else if ((outer == PLUS || outer == COMPARE) + && INTVAL (x) < 256 && INTVAL (x) > -256) + return 0; + else if (outer == AND + && INTVAL (x) < 256 && INTVAL (x) >= -256) + return COSTS_N_INSNS (1); + else if (outer == ASHIFT || outer == ASHIFTRT + || outer == LSHIFTRT) + return 0; + return COSTS_N_INSNS (2); + + case CONST: + case CONST_DOUBLE: + case LABEL_REF: + case SYMBOL_REF: + return COSTS_N_INSNS (3); + + case UDIV: + case UMOD: + case DIV: + case MOD: + return 100; + + case TRUNCATE: + return 99; + + case MEM: + /* XXX another guess. */ + /* Memory costs quite a lot for the first word, but subsequent words + load at the equivalent of a single insn each. */ + return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) + + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) + ? 4 : 0)); + + case IF_THEN_ELSE: + /* XXX a guess. */ + if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC) + return 14; + return 2; + + case ZERO_EXTEND: + /* XXX still guessing. */ + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + return (1 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + case HImode: + return (4 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + case SImode: + return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + default: + return 99; + } + + default: + return 99; + } +} +/* APPLE LOCAL end ARM size variant of thumb costs */ /* Worker routine for arm_rtx_costs. */ static inline int @@ -4768,6 +5204,11 @@ && const_ok_for_op (INTVAL (XEXP (x, 1)), code))) ? 0 : 4)); + /* APPLE LOCAL begin ARM 4652753 */ + /* If the previous insn feeds into the shifted operand of this one, + there is a 1 cycle delay. We can't tell here whether this will + be the case or not. Model it for now, as this seems to lead to + better decisions about splitting up multiply-by-constant. */ else if (REG_OR_SUBREG_REG (XEXP (x, 1))) return (1 + extra_cost + ((((subcode = GET_CODE (XEXP (x, 0))) == ASHIFT @@ -4780,7 +5221,8 @@ && (REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 0))) && ((REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 1))) || GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)) - ? 0 : 4)); + ? 1 : 4)); + /* APPLE LOCAL end ARM 4652753 */ return 8; @@ -4890,8 +5332,9 @@ if (TARGET_THUMB) { - /* XXX TBD. For now, use the standard costs. */ - *total = thumb_rtx_costs (x, code, outer_code); + /* APPLE LOCAL begin ARM size variant of thumb costs */ + *total = thumb_size_rtx_costs (x, code, outer_code); + /* APPLE LOCAL end ARM size variant of thumb costs */ return true; } @@ -4999,9 +5442,34 @@ *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); return false; + /* APPLE LOCAL begin DImode multiply enhancement */ case MULT: + if (mode == DImode) + { + if (((GET_CODE (XEXP (x, 0)) == SIGN_EXTEND + && GET_CODE (XEXP (x, 1)) == SIGN_EXTEND) + || (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + && GET_CODE (XEXP (x, 1)) == ZERO_EXTEND)) + && GET_MODE (XEXP (XEXP (x, 0), 0)) == SImode + && GET_MODE (XEXP (XEXP (x, 1), 0)) == SImode) + { + /* SMULL, etc., do sign extend better than free */ + *total = COSTS_N_INSNS (1) + + rtx_cost (XEXP (XEXP (x, 0), 0), MULT) + + rtx_cost (XEXP (XEXP (x, 1), 0), MULT); + return true; + } + else + { + /* broken into 3 insns later, plus cost of kids */ + /** does not allow for Cirrus instruction **/ + *total = COSTS_N_INSNS (3); + return false; + } + } *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); return false; + /* APPLE LOCAL end DImode multiply enhancement */ case NEG: if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) @@ -5927,10 +6395,13 @@ int j; for (j = XVECLEN (x, i) - 1; j >= 0; j--) - if (symbol_mentioned_p (XVECEXP (x, i, j))) + if (symbol_mentioned_with_filter (XVECEXP (x, i, j), + filter_local)) return 1; } - else if (fmt[i] == 'e' && symbol_mentioned_p (XEXP (x, i))) + else if (fmt[i] == 'e' + && symbol_mentioned_with_filter (XEXP (x, i), + filter_local)) return 1; } @@ -5999,10 +6470,21 @@ if (GET_CODE (pat) == SET) { rtx rhs = SET_SRC (pat); + rtx lhs = SET_DEST (pat); if (GET_CODE (rhs) == UNSPEC && XINT (rhs, 1) == UNSPEC_PIC_BASE) return TRUE; + + if (GET_CODE (rhs) == MEM + && GET_CODE (XEXP (rhs, 0)) == UNSPEC + && XINT (XEXP (rhs, 0), 1) == UNSPEC_PIC_BASE) + return TRUE; + + if (GET_CODE (lhs) == MEM + && GET_CODE (XEXP (lhs, 0)) == UNSPEC + && XINT (XEXP (lhs, 0), 1) == UNSPEC_PIC_BASE) + return TRUE; } /* APPLE LOCAL end ARM pic support */ @@ -6682,6 +7164,22 @@ || INTVAL (operands[3]) & 3) return 0; + /* APPLE LOCAL begin ARM use memcpy more at -Os */ + /* At -Os we consider the size of repeated lod/sto vs memcpy call. Both ways + require getting source and dest addresses into regs. Beyond that memcpy + is 2 insns; lod/sto is at least 2, maybe more. But lod/sto is faster so + we prefer that when it is only 2 insns; that occurs when the size is + 1, 2, 4, 8, 12, or 16 only. */ + if (optimize_size + && INTVAL (operands[2]) != 1 + && INTVAL (operands[2]) != 2 + && INTVAL (operands[2]) != 4 + && INTVAL (operands[2]) != 8 + && INTVAL (operands[2]) != 12 + && INTVAL (operands[2]) != 16) + return 0; + /* APPLE LOCAL end ARM use memcpy more at -Os */ + dstbase = operands[0]; srcbase = operands[1]; @@ -7612,6 +8110,250 @@ #define MINIPOOL_FIX_SIZE(mode) \ (GET_MODE_SIZE ((mode)) >= 4 ? GET_MODE_SIZE ((mode)) : 4) +/* APPLE LOCAL begin ARM 4790140 compact switch tables */ +/* The miniLisp in attributes doesn't seem to be up to extracting + a numeric datum from the argument; do it in code. */ +void +arm_adjust_insn_length (rtx insn, int *length) +{ + rtx body = PATTERN (insn); + if (GET_CODE (body) == UNSPEC_VOLATILE + && (int) XEXP (body, 1) == VUNSPEC_POOL_STRING) + { + int len = TREE_STRING_LENGTH (SYMBOL_REF_DECL + (XVECEXP (body, 0, 0))); + len = (len + 3) & ~3; + *length = len; + } + if (GET_CODE (body) == ADDR_DIFF_VEC) + { + /* The obvious sizeof(elt)*nelts, plus sizeof(elt) for the + count. */ + int len = (XVECLEN (body, 1) + 1) * GET_MODE_SIZE (GET_MODE (body)); + int insn_size = (TARGET_THUMB) ? 2 : 4; + + /* 32-bit thumb tables can have one halfword of padding. + If we knew the alignment + offset now, we could be correct + about this calculation. Instead, we have to be + pessimistic. */ + if (TARGET_THUMB + && GET_MODE_SIZE (GET_MODE (body)) == 4) + len += 2; + + /* Round up to a multiple of instruction size. */ + len = ((len + insn_size - 1) / insn_size) * insn_size; + *length = len; + } + if (TARGET_THUMB + && GET_CODE (body) == UNSPEC_VOLATILE + && (int) XEXP (body, 1) == VUNSPEC_EPILOGUE) + { + *length = handle_thumb_unexpanded_epilogue (false); + } + if (INSN_CODE (insn) == CODE_FOR_adjustable_thumb_zero_extendhisi2 + || INSN_CODE (insn) == CODE_FOR_adjustable_thumb_zero_extendhisi2_v6) + { + rtx mem = XEXP (XEXP (body, 1), 0); + if (GET_CODE (mem) == REG || GET_CODE (mem) == SUBREG) + *length = 2; + else + { + gcc_assert (GET_CODE (mem) == MEM); + mem = XEXP (mem, 0); + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + if (GET_CODE (mem) == PLUS + && GET_CODE (XEXP (mem, 0)) == REG + && REGNO (XEXP (mem, 0)) == SP_REGNUM) + *length = 4; + else + *length = 2; + } + } + if (INSN_CODE (insn) == CODE_FOR_thumb_extendhisi2 + || INSN_CODE (insn) == CODE_FOR_adjustable_thumb_extendhisi2_insn_v6) + { + rtx mem = XEXP (XEXP (XVECEXP (body, 0, 0), 1), 0); + if (GET_CODE (mem) == REG || GET_CODE (mem) == SUBREG) + *length = 2; + else + { + gcc_assert (GET_CODE (mem) == MEM); + mem = XEXP (mem, 0); + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + *length = 4; + if (GET_CODE (mem) == LABEL_REF) + *length = 2; + if (GET_CODE (mem) == PLUS) + { + if (GET_CODE (XEXP (mem, 0)) == LABEL_REF + && GET_CODE (XEXP (mem, 1)) == CONST_INT) + *length = 2; + if (GET_CODE (XEXP (mem, 1)) == REG) + *length = 2; + } + } + } + if (INSN_CODE (insn) == CODE_FOR_adjustable_thumb_extendqisi2) + { + rtx mem = XEXP (XEXP (body, 1), 0); + if (GET_CODE (mem) == REG || GET_CODE (mem) == SUBREG) + *length = 2; + else + { + gcc_assert (GET_CODE (mem) == MEM); + mem = XEXP (mem, 0); + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + if (GET_CODE (mem) == LABEL_REF) + *length = 2; + else if (GET_CODE (mem) == PLUS + && GET_CODE (XEXP (mem, 0)) == LABEL_REF) + *length = 2; + /* The "operand matches V constraint" case is not handled explicitly; + this can only generate valid code if the address is REG + REG, + so assume this is the case and let the code below handle it. */ + else if (GET_CODE (mem) == PLUS) + { + if (GET_CODE (XEXP (mem, 0)) == REG) + { + if (GET_CODE (XEXP (mem, 1)) == REG) + *length = 2; + else if (REGNO (XEXP (mem, 0)) == REGNO (XEXP (body, 0))) + *length = 6; + else + *length = 4; + } + else + { + gcc_assert (GET_CODE (XEXP (mem, 1)) == REG); + if (REGNO (XEXP (mem, 1)) == REGNO (XEXP (body, 0))) + *length = 6; + else + *length = 4; + } + } + else if (GET_CODE (mem) == REG && REGNO (XEXP (body, 0)) == REGNO (mem)) + *length = 6; + else + *length = 4; + } + } + if (INSN_CODE (insn) == CODE_FOR_adjustable_thumb_extendqisi2_v6) + { + rtx mem = XEXP (XEXP (body, 1), 0); + if (GET_CODE (mem) == REG || GET_CODE (mem) == SUBREG) + *length = 2; + else + { + gcc_assert (GET_CODE (mem) == MEM); + mem = XEXP (mem, 0); + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + if (GET_CODE (mem) == LABEL_REF) + *length = 2; + else if (GET_CODE (mem) == PLUS + && GET_CODE (XEXP (mem, 0)) == LABEL_REF) + *length = 2; + /* The "operand matches V constraint" case is not handled explicitly; + this can only generate valid code if the address is REG + REG, + so assume this is the case and let the code below handle it. */ + else if (GET_CODE (mem) == PLUS) + { + if (GET_CODE (XEXP (mem, 0)) == REG) + { + if (GET_CODE (XEXP (mem, 1)) == REG) + *length = 2; + else if (REGNO (XEXP (mem, 0)) == REGNO (XEXP (body, 0))) + *length = 4; + else + *length = 4; + } + else + { + gcc_assert (GET_CODE (XEXP (mem, 1)) == REG); + if (REGNO (XEXP (mem, 1)) == REGNO (XEXP (body, 0))) + *length = 4; + else + *length = 4; + } + } + else if (GET_CODE (mem) == REG && REGNO (XEXP (body, 0)) == REGNO (mem)) + *length = 4; + else + *length = 4; + } + } + if (INSN_CODE (insn) == CODE_FOR_adjustable_thumb_movhi_insn) + { + rtx mem = XEXP (body, 1); + if (GET_CODE (mem) != MEM) + *length = 2; + else if (GET_CODE (XEXP (mem, 0)) == PLUS + && GET_CODE (XEXP (XEXP (mem, 0), 0)) == REG + && REGNO (XEXP (XEXP (mem, 0), 0)) == SP_REGNUM) + *length = 4; + else + *length = 2; + } + if (INSN_CODE (insn) == CODE_FOR_adjustable_thumb_movdi_insn) + { + rtx op0 = XEXP (body, 0); + rtx op1 = XEXP (body, 1); + + /* case 3 */ + if (GET_CODE (op0) == MEM && + (GET_CODE (XEXP (op0, 0)) == PRE_INC + || GET_CODE (XEXP (op0, 0)) == POST_INC)) + *length = 2; + /* case 4 */ + else if (GET_CODE (op1) == MEM && + (GET_CODE (XEXP (op1, 0)) == PRE_INC + || GET_CODE (XEXP (op1, 0)) == POST_INC)) + *length = 2; + /* case 2 */ + else if (GET_CODE (op1) == CONST_INT + && !const_ok_for_arm (INTVAL (op1)) + && INTVAL (op1) >= -4095 + && INTVAL (op1) <= 4095 + && thumb_low_register_operand (op0, GET_MODE (op0))) + *length = 6; + /* case 0, 1, 6, 7 */ + else if (GET_CODE (op1) != MEM) + *length = 4; + /* case 5 */ + else + { + rtx addr = XEXP (op1, 0); + if (GET_CODE (addr) == REG) + *length = 4; + else if (GET_CODE (addr) == CONST) + *length = 4; + else if (GET_CODE (addr) == PLUS) + { + rtx base = XEXP (addr, 0); + rtx offset = XEXP (addr, 1); + if (CONSTANT_P (base)) + { + rtx temp = base; + base = offset; + offset = temp; + } + if (GET_CODE (offset) == REG) + *length = 6; + else + *length = 4; + } + else if (GET_CODE (addr) == LABEL_REF) + *length = 4; + else + abort (); + } + } +} +/* APPLE LOCAL end ARM 4790140 compact switch tables */ + static Mnode * minipool_vector_head; static Mnode * minipool_vector_tail; static rtx minipool_vector_label; @@ -8203,6 +8945,11 @@ /* Count the length of this insn. */ count += get_attr_length (from); + /* APPLE LOCAL begin ARM 6008578 */ + if (LABEL_P (from)) + count += get_label_pad (from, fix->address + count); + /* APPLE LOCAL end ARM 6008578 */ + /* If there is a jump table, add its length. */ tmp = is_jump_table (from); if (tmp != NULL) @@ -8368,6 +9115,75 @@ NULL_RTX, NULL_RTX, 0, 0)); } +/* APPLE LOCAL begin 5831562 long long constants */ +/* Return true if a 64-bit constant consists of two 32-bit halves, + each of which is a valid immediate data-processing operand. + (This differs from other 64-bit evaluations in that ~const is + not considered.) +*/ + +bool +const64_ok_for_arm_immediate (rtx val) +{ + rtx lowpart, highpart; + enum machine_mode mode; + + if (!TARGET_ARM) + return false; + + mode = GET_MODE (val); + + if (mode == VOIDmode) + mode = DImode; + + gcc_assert (GET_MODE_SIZE (mode) == 8); + + lowpart = gen_lowpart (SImode, val); + highpart = gen_highpart_mode (SImode, mode, val); + + gcc_assert (GET_CODE (lowpart) == CONST_INT); + gcc_assert (GET_CODE (highpart) == CONST_INT); + + return (const_ok_for_arm (INTVAL (lowpart)) + && const_ok_for_arm (INTVAL (highpart))); +} + +/* As above, but allow for constants whose negative value + fits as well. Both halves must match either as themselves + or as negated. */ +bool +const64_ok_for_arm_add (rtx val) +{ + rtx lowpart, highpart, lowpart_neg, highpart_neg, val_neg; + enum machine_mode mode; + + if (!TARGET_ARM) + return false; + + mode = GET_MODE (val); + + if (mode == VOIDmode) + mode = DImode; + + gcc_assert (GET_MODE_SIZE (mode) == 8); + + lowpart = gen_lowpart (SImode, val); + highpart = gen_highpart_mode (SImode, mode, val); + + val_neg = negate_rtx (mode, val); + lowpart_neg = gen_lowpart (SImode, val_neg); + highpart_neg = gen_highpart_mode (SImode, mode, val_neg); + + gcc_assert (GET_CODE (lowpart) == CONST_INT); + gcc_assert (GET_CODE (highpart) == CONST_INT); + + return ((const_ok_for_arm (INTVAL (lowpart)) + && const_ok_for_arm (INTVAL (highpart))) + || (const_ok_for_arm (INTVAL (lowpart_neg)) + && const_ok_for_arm (INTVAL (highpart_neg)))); +} +/* APPLE LOCAL end 5831562 long long constants */ + /* Return true if it is worthwhile to split a 64-bit constant into two 32-bit operations. This is the case if optimizing for size, or if we have load delay slots, or if one 32-bit part can be done with @@ -8476,6 +9292,36 @@ return result; } +/* APPLE LOCAL begin ARM 6008578 */ +/* Return the bytes of padding that will be inserted to align + the label INSN given the current pc ADDRESS. */ +static HOST_WIDE_INT get_label_pad (rtx insn, HOST_WIDE_INT address) +{ + int label_align, max_skip; + unsigned HOST_WIDE_INT align_mask; + int pad_needed; + + gcc_assert (LABEL_P (insn)); + + label_align = LABEL_ALIGN_LOG (insn); + max_skip = LABEL_MAX_SKIP (insn); + align_mask = ((unsigned int) 1 << label_align) - 1; + + /* Already aligned. */ + if ((address & align_mask) == 0) + return 0; + + pad_needed = ((address | align_mask) + 1) - address; + + /* We would have to insert more than max_skip bytes to + align this label. */ + if (max_skip && (pad_needed > max_skip)) + return 0; + + return pad_needed; +} +/* APPLE LOCAL end ARM 6008578 */ + /* Gcc puts the pool in the wrong place for ARM, since we can only load addresses a limited distance around the pc. We do some special munging to move the constant pool values to the correct @@ -8489,6 +9335,12 @@ minipool_fix_head = minipool_fix_tail = NULL; +/* APPLE LOCAL begin ARM compact switch tables */ +/* This is actually lurking bug I think, alignment matters. */ + if (TARGET_THUMB) + address = count_thumb_unexpanded_prologue (); +/* APPLE LOCAL end ARM compact switch tables */ + /* The first insn must always be a note, or the code below won't scan it properly. */ insn = get_insns (); @@ -8506,6 +9358,8 @@ if (GET_CODE (insn) == BARRIER) push_minipool_barrier (insn, address); + else if (LABEL_P (insn)) + address += get_label_pad (insn, address); else if (INSN_P (insn)) { rtx table; @@ -10291,6 +11145,43 @@ /* APPLE LOCAL ARM custom frame layout */ /* Removed lines. */ + /* APPLE LOCAL begin ARM indirect sibcalls */ + /* If we have an indirect sibcall that uses a reg saved across calls, that reg will + be clobbered when we pop the old value off the stack. Copy the value to IP + before doing the pop. */ + if (sibling) + { + bool is_value; + int regno = indirect_sibreturn_reg (sibling, &is_value); + if (regno > 3 && regno != 12) + { + if (is_value) + XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + else + XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + asm_fprintf (f, "\tmov\t%r, %r\n", IP_REGNUM, regno); + } + if (regno == -1) + { + rtx stack_reg, offset; + offset = indirect_sibreturn_mem (sibling, &stack_reg, &is_value); + if (offset) + { + if (is_value) + XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + else + XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + asm_fprintf (f, "\tldr\t%r, [%r, #%wd]\n", IP_REGNUM, + REGNO (stack_reg), INTVAL (offset)); + } + } + } + /* APPLE LOCAL end ARM indirect sibcalls */ + /* We must use SP as the base register, because SP is one of the registers being restored. If an interrupt or page fault happens in the ldm instruction, the SP might or might not @@ -10349,13 +11240,98 @@ } else { + /* APPLE LOCAL begin ARM indirect sibcalls */ + int ip_ok = 1; + + /* If we have an indirect sibcall that uses a reg saved across calls, that reg will + be clobbered when we pop the old value off the stack. Copy the value to IP + before doing the pop. */ + if (sibling) + { + bool is_value; + int regno = indirect_sibreturn_reg (sibling, &is_value); + if (regno > 3 && regno != 12) + { + ip_ok = 0; + if (is_value) + XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + else + XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + asm_fprintf (f, "\tmov\t%r, %r\n", IP_REGNUM, regno); + } + if (regno == -1) + { + rtx stack_reg, offset; + offset = indirect_sibreturn_mem (sibling, &stack_reg, &is_value); + if (offset) + { + ip_ok = 0; + if (is_value) + XEXP (XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 1), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + else + XEXP (XEXP (XVECEXP (PATTERN (sibling), 0, 0), 0), 0) + = gen_rtx_REG (SImode, IP_REGNUM); + asm_fprintf (f, "\tldr\t%r, [%r, #%wd]\n", IP_REGNUM, + REGNO (stack_reg), INTVAL (offset)); + } + } + } + + /* APPLE LOCAL begin ARM combine stack pop and register pop */ + /* Code here is probably making overly specific assumptions about modes. */ /* Restore stack pointer if necessary. */ if (offsets->outgoing_args != offsets->saved_regs) { - operands[0] = operands[1] = stack_pointer_rtx; - operands[2] = GEN_INT (offsets->outgoing_args - offsets->saved_regs); - output_add_immediate (operands); + int delta = offsets->outgoing_args - offsets->saved_regs; + int maxpopsize; + tree rettype = TREE_TYPE (TREE_TYPE (current_function_decl)); + /* We can use R0 through R3 for this purpose, but not any regs that + contain (part of) the return value. */ + if (TYPE_MODE (rettype) == VOIDmode) + maxpopsize = 20; + else if (TYPE_MODE (rettype) == DFmode + || TYPE_MODE (rettype) == DImode) + maxpopsize = 12; + else + maxpopsize = 16; + /* We can also use R12 provided it was not used for the sibcall hack above, + and we are not saving any regs in the range R4...R11. In the latter case + they are stored on the stack below the "empty" spot used for R12 and + the saved values would get clobbered. */ + if (saved_regs_mask + & ((1<<4) | (1<<5) | (1<<6) | (1<<7) | (1<<8) | (1<<9) | (1<<10) | (1<<11))) + ip_ok = 0; + if (!ip_ok) + maxpopsize -= 4; + if (optimize_size + && delta <= maxpopsize && delta % 4 == 0 + && !TARGET_IWMMXT + && really_return + && TARGET_SOFT_FLOAT + && arm_fpu_arch == FPUTYPE_NONE + && !flag_pic + && !frame_pointer_needed) + { + int reg = ip_ok ? 12 : 3; + while (delta) + { + saved_regs_mask |= (1 << reg); + reg = (reg == 12) ? 3 : reg - 1; + delta -= 4; + } + } + else + { + operands[0] = operands[1] = stack_pointer_rtx; + operands[2] = GEN_INT (offsets->outgoing_args - offsets->saved_regs); + output_add_immediate (operands); + } } + /* APPLE LOCAL end ARM combine stack pop and register pop */ + /* APPLE LOCAL end ARM indirect sibcalls */ if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { @@ -11088,8 +12064,47 @@ emit_set_insn (lr, plus_constant (lr, -4)); } + /* APPLE LOCAL begin ARM peephole combine reg store and stack push */ + offsets = arm_get_frame_offsets (); + if (live_regs_mask) { + saved_regs += bit_count (live_regs_mask) * 4; + + /* Space optimization: if we need a small amount of stack space, and + we're going to do a push, push some extra registers rather than + doing a separate subtract. We can safely push R0 thru R3. We can + also use R12 provided no regs in the range R4..R11 are being saved. + (Their saved values would be below the value of R12 on the stack, + and would get clobbered.) */ + /* The conditions here are probably overly restrictive. */ + if (optimize_size + && !flag_pic + && !frame_pointer_needed + && arm_fpu_arch == FPUTYPE_NONE + && TARGET_SOFT_FLOAT + && !TARGET_IWMMXT) + { + int ip_ok = 1; + int delta = offsets->outgoing_args - offsets->saved_args - saved_regs; + if (delta < 0) + abort(); + if (live_regs_mask + & ((1<<4) | (1<<5) | (1<<6) | (1<<7) | (1<<8) | (1<<9) | (1<<10) | (1<<11))) + ip_ok = 0; + if (delta <= (ip_ok ? 20 : 16) && delta % 4 == 0) + { + int reg = (ip_ok ? 12 : 3); + while (delta) + { + delta -= 4; + live_regs_mask |= (1<= FIRST_IWMMXT_REGNUM; reg--) @@ -11214,7 +12229,8 @@ /* APPLE LOCAL ARM custom frame layout */ /* Removed lines. */ - offsets = arm_get_frame_offsets (); + /* APPLE LOCAL ARM peephole combine reg store and stack push */ + /* Remove call to arm_get_frame_offsets. */ if (offsets->outgoing_args != offsets->saved_args + saved_regs) { /* This add can produce multiple insns for a large constant, so we @@ -13271,21 +14287,29 @@ return bit; } -/* Emit code to push or pop registers to or from the stack. F is the - assembly file. MASK is the registers to push or pop. PUSH is +/* APPLE LOCAL begin ARM compact switch tables */ +/* Handle push or pop of registers from the stack. + If EMIT is true, generate the code. + If EMIT is false, compute and return the number of bytes that + would result from a call with EMIT true. In this case F is + not necessarily valid and should not be referenced. + + F is the assembly file. MASK is the registers to push or pop. PUSH is nonzero if we should push, and zero if we should pop. For debugging output, if pushing, adjust CFA_OFFSET by the amount of space added to the stack. REAL_REGS should have the same number of bits set as MASK, and will be used instead (in the same order) to describe which registers were saved - this is used to mark the save slots when we - push high registers after moving them to low registers. */ -static void -thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset, - unsigned long real_regs) + push high registers after moving them to low registers. +*/ +static int +handle_thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset, + unsigned long real_regs, bool emit) { int regno; int lo_mask = mask & 0xFF; int pushed_words = 0; + int bytes = 0; gcc_assert (mask); @@ -13293,11 +14317,10 @@ { /* Special case. Do not generate a POP PC statement here, do it in thumb_exit() */ - thumb_exit (f, -1); - return; + return handle_thumb_exit (f, -1, emit); } - if (ARM_EABI_UNWIND_TABLES && push) + if (ARM_EABI_UNWIND_TABLES && push && emit) { fprintf (f, "\t.save\t{"); for (regno = 0; regno < 15; regno++) @@ -13312,17 +14335,22 @@ fprintf (f, "}\n"); } - fprintf (f, "\t%s\t{", push ? "push" : "pop"); + bytes += 2; + if (emit) + fprintf (f, "\t%s\t{", push ? "push" : "pop"); /* Look at the low registers first. */ for (regno = 0; regno <= LAST_LO_REGNUM; regno++, lo_mask >>= 1) { if (lo_mask & 1) { - asm_fprintf (f, "%r", regno); + if (emit) + { + asm_fprintf (f, "%r", regno); - if ((lo_mask & ~1) != 0) - fprintf (f, ", "); + if ((lo_mask & ~1) != 0) + fprintf (f, ", "); + } pushed_words++; } @@ -13331,10 +14359,13 @@ if (push && (mask & (1 << LR_REGNUM))) { /* Catch pushing the LR. */ - if (mask & 0xFF) - fprintf (f, ", "); + if (emit) + { + if (mask & 0xFF) + fprintf (f, ", "); - asm_fprintf (f, "%r", LR_REGNUM); + asm_fprintf (f, "%r", LR_REGNUM); + } pushed_words++; } @@ -13349,13 +14380,14 @@ { /* The PC is never poped directly, instead it is popped into r3 and then BX is used. */ - fprintf (f, "}\n"); + if (emit) + fprintf (f, "}\n"); - thumb_exit (f, -1); + bytes += handle_thumb_exit (f, -1, emit); - return; + return bytes; } - else + else if (emit) { if (mask & 0xFF) fprintf (f, ", "); @@ -13364,9 +14396,10 @@ } } - fprintf (f, "}\n"); + if (emit) + fprintf (f, "}\n"); - if (push && pushed_words && dwarf2out_do_frame ()) + if (emit && push && pushed_words && dwarf2out_do_frame ()) { char *l = dwarf2out_cfi_label (); int pushed_mask = real_regs; @@ -13382,13 +14415,19 @@ dwarf2out_reg_save (l, regno, 4 * pushed_words++ - *cfa_offset); } } + return bytes; } -/* Generate code to return from a thumb function. +/* Handle return from a thumb function. + If EMIT is true, generate the code. + If EMIT is false, compute and return the number of bytes that + would result from a call with EMIT true. In this case F is + not necessarily valid and should not be referenced. If 'reg_containing_return_addr' is -1, then the return address is - actually on the stack, at the stack pointer. */ -static void -thumb_exit (FILE *f, int reg_containing_return_addr) + actually on the stack, at the stack pointer. +*/ +static int +handle_thumb_exit (FILE *f, int reg_containing_return_addr, bool emit) { unsigned regs_available_for_popping; unsigned regs_to_pop; @@ -13398,6 +14437,7 @@ int mode; int size; int restore_a4 = FALSE; + int bytes = 0; /* Compute the registers we need to pop. */ regs_to_pop = 0; @@ -13421,10 +14461,17 @@ if (pops_needed == 0) { if (current_function_calls_eh_return) - asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); + { + bytes += 2; + if (emit) + asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); + } - asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); - return; + bytes += 2; + if (emit) + asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); + + return bytes; } /* Otherwise if we are not supporting interworking and we have not created a backtrace structure and the function was not entered in ARM mode then @@ -13435,8 +14482,10 @@ && !is_called_in_ARM_mode (current_function_decl) && !current_function_calls_eh_return) { - asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM); - return; + bytes += 2; + if (emit) + asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM); + return bytes; } /* Find out how many of the (return) argument registers we can corrupt. */ @@ -13506,7 +14555,9 @@ if (regs_available_for_popping == 0 && reg_containing_return_addr == LAST_ARG_REGNUM) { - asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, LAST_ARG_REGNUM); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, LAST_ARG_REGNUM); reg_containing_return_addr = LR_REGNUM; } else if (size > 12) @@ -13515,7 +14566,9 @@ but we have dire need of a free, low register. */ restore_a4 = TRUE; - asm_fprintf (f, "\tmov\t%r, %r\n",IP_REGNUM, LAST_ARG_REGNUM); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n",IP_REGNUM, LAST_ARG_REGNUM); } if (reg_containing_return_addr != LAST_ARG_REGNUM) @@ -13528,8 +14581,8 @@ } /* Pop as many registers as we can. */ - thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, - regs_available_for_popping); + bytes += handle_thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, + regs_available_for_popping, emit); /* Process the registers we popped. */ if (reg_containing_return_addr == -1) @@ -13554,8 +14607,10 @@ frame_pointer = number_of_first_bit_set (regs_available_for_popping); /* Move it into the correct place. */ - asm_fprintf (f, "\tmov\t%r, %r\n", - ARM_HARD_FRAME_POINTER_REGNUM, frame_pointer); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", + ARM_HARD_FRAME_POINTER_REGNUM, frame_pointer); /* (Temporarily) remove it from the mask of popped registers. */ regs_available_for_popping &= ~(1 << frame_pointer); @@ -13570,7 +14625,9 @@ stack_pointer = number_of_first_bit_set (regs_available_for_popping); /* Move it into the stack register. */ - asm_fprintf (f, "\tmov\t%r, %r\n", SP_REGNUM, stack_pointer); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", SP_REGNUM, stack_pointer); /* At this point we have popped all necessary registers, so do not worry about restoring regs_available_for_popping @@ -13597,8 +14654,10 @@ { regs_available_for_popping |= 1 << reg_containing_return_addr; - asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, - reg_containing_return_addr); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, + reg_containing_return_addr); reg_containing_return_addr = LR_REGNUM; } @@ -13610,15 +14669,17 @@ int popped_into; int move_to; - thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, - regs_available_for_popping); + bytes += handle_thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, + regs_available_for_popping, emit); /* We have popped either FP or SP. Move whichever one it is into the correct register. */ popped_into = number_of_first_bit_set (regs_available_for_popping); move_to = number_of_first_bit_set (regs_to_pop); - asm_fprintf (f, "\tmov\t%r, %r\n", move_to, popped_into); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", move_to, popped_into); regs_to_pop &= ~(1 << move_to); @@ -13631,12 +14692,14 @@ { int popped_into; - thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, - regs_available_for_popping); + bytes += handle_thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, + regs_available_for_popping, emit); popped_into = number_of_first_bit_set (regs_available_for_popping); - asm_fprintf (f, "\tmov\t%r, %r\n", SP_REGNUM, popped_into); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", SP_REGNUM, popped_into); /* assert (regs_to_pop == (1 << STACK_POINTER)) assert (pops_needed == 1) @@ -13648,19 +14711,31 @@ { if (reg_containing_return_addr != LR_REGNUM) { - asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, LAST_ARG_REGNUM); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, LAST_ARG_REGNUM); reg_containing_return_addr = LR_REGNUM; } - asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM); } if (current_function_calls_eh_return) - asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); + { + bytes += 2; + if (emit) + asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); + } /* Return to caller. */ - asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); + bytes += 2; + if (emit) + asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); + return bytes; } +/* APPLE LOCAL end ARM compact switch tables */ void @@ -13775,21 +14850,28 @@ #endif } -/* The bits which aren't usefully expanded as rtl. */ -const char * -thumb_unexpanded_epilogue (void) +/* APPLE LOCAL begin ARM compact switch tables */ +/* This handles the part of the epilogue that is not expressed as RTL. + It computes and returns the number of bytes in this part of the epilogue. + When EMIT is true, it additionally outputs this part of the epilogue. + When !EMIT, this function does not output anything; in this case + F need not be valid and should not be referenced. +*/ +static int +handle_thumb_unexpanded_epilogue (bool emit) { int regno; unsigned long live_regs_mask = 0; int high_regs_pushed = 0; int had_to_push_lr; int size; + int bytes = 0; if (return_used_this_function) - return ""; + return bytes; if (IS_NAKED (arm_current_func_type ())) - return ""; + return bytes; live_regs_mask = thumb_compute_save_reg_mask (); high_regs_pushed = bit_count (live_regs_mask & 0x0f00); @@ -13847,15 +14929,17 @@ mask &= (2 << regno) - 1; /* A noop if regno == 8 */ /* Pop the values into the low register(s). */ - thumb_pushpop (asm_out_file, mask, 0, NULL, mask); + bytes += handle_thumb_pushpop (asm_out_file, mask, 0, NULL, mask, emit); /* Move the value(s) into the high registers. */ for (regno = 0; regno <= LAST_LO_REGNUM; regno++) { if (mask & (1 << regno)) { - asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg, - regno); + bytes += 2; + if (emit) + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg, + regno); for (next_hi_reg++; next_hi_reg < 13; next_hi_reg++) if (live_regs_mask & (1 << next_hi_reg)) @@ -13879,42 +14963,48 @@ structure was created which includes an adjusted stack pointer, so just pop everything. */ if (live_regs_mask) - thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, - live_regs_mask); + bytes += handle_thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, + live_regs_mask, emit); /* We have either just popped the return address into the PC or it is was kept in LR for the entire function. */ if (!had_to_push_lr) - thumb_exit (asm_out_file, LR_REGNUM); + bytes += handle_thumb_exit (asm_out_file, LR_REGNUM, emit); } else { /* Pop everything but the return address. */ if (live_regs_mask) - thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, - live_regs_mask); + bytes += handle_thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, + live_regs_mask, emit); if (had_to_push_lr) { if (size > 12) { /* We have no free low regs, so save one. */ - asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", IP_REGNUM, - LAST_ARG_REGNUM); + bytes += 2; + if (emit) + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", IP_REGNUM, + LAST_ARG_REGNUM); } /* Get the return address into a temporary register. */ - thumb_pushpop (asm_out_file, 1 << LAST_ARG_REGNUM, 0, NULL, - 1 << LAST_ARG_REGNUM); + bytes += handle_thumb_pushpop (asm_out_file, 1 << LAST_ARG_REGNUM, 0, NULL, + 1 << LAST_ARG_REGNUM, emit); if (size > 12) { - /* Move the return address to lr. */ - asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LR_REGNUM, - LAST_ARG_REGNUM); - /* Restore the low register. */ - asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, - IP_REGNUM); + bytes += 4; + if (emit) + { + /* Move the return address to lr. */ + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LR_REGNUM, + LAST_ARG_REGNUM); + /* Restore the low register. */ + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, + IP_REGNUM); + } regno = LR_REGNUM; } else @@ -13924,15 +15014,28 @@ regno = LR_REGNUM; /* Remove the argument registers that were pushed onto the stack. */ - asm_fprintf (asm_out_file, "\tadd\t%r, %r, #%d\n", - SP_REGNUM, SP_REGNUM, - current_function_pretend_args_size); + bytes += 2; + if (emit) + asm_fprintf (asm_out_file, "\tadd\t%r, %r, #%d\n", + SP_REGNUM, SP_REGNUM, + current_function_pretend_args_size); - thumb_exit (asm_out_file, regno); + bytes += handle_thumb_exit (asm_out_file, regno, emit); } + return bytes; +} + +/* This is the externally visible entry point for generating code for the + part of the epilogue that is not stored as RTL. This is just a wrapper + around the previous, with the correct externally imposed interface. */ + +const char * thumb_unexpanded_epilogue (void) +{ + (void) handle_thumb_unexpanded_epilogue (true); return ""; } +/* APPLE LOCAL end ARM compact switch tables */ /* Functions to save and restore machine-specific function data. */ static struct machine_function * @@ -14060,9 +15163,9 @@ if (flag_pic && arm_pic_register != INVALID_REGNUM) arm_load_pic_register (live_regs_mask); + /* APPLE LOCAL begin ARM custom frame layout */ offsets = arm_get_frame_offsets (); - /* APPLE LOCAL begin ARM custom frame layout */ if (frame_pointer_needed) { insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, @@ -14261,17 +15364,25 @@ emit_insn (gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM))); } -static void -thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +/* APPLE LOCAL begin ARM 4790140 compact switch tables */ +/* This handles the part of the prologue that is not expressed as RTL. + It computes and returns the number of bytes in this part of the prologue. + When EMIT is true, it additionally outputs this part of the prologue. + When !EMIT, this function does not output anything; in this case + F need not be valid and should not be referenced. +*/ +static int +handle_thumb_unexpanded_prologue (FILE *f, bool emit) { unsigned long live_regs_mask = 0; unsigned long l_mask; unsigned high_regs_pushed = 0; int cfa_offset = 0; int regno; + int bytes = 0; if (IS_NAKED (arm_current_func_type ())) - return; + return bytes; if (is_called_in_ARM_mode (current_function_decl)) { @@ -14280,65 +15391,80 @@ gcc_assert (GET_CODE (DECL_RTL (current_function_decl)) == MEM); gcc_assert (GET_CODE (XEXP (DECL_RTL (current_function_decl), 0)) == SYMBOL_REF); - name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); - /* Generate code sequence to switch us into Thumb mode. */ - /* The .code 32 directive has already been emitted by - ASM_DECLARE_FUNCTION_NAME. */ - asm_fprintf (f, "\torr\t%r, %r, #1\n", IP_REGNUM, PC_REGNUM); - asm_fprintf (f, "\tbx\t%r\n", IP_REGNUM); - - /* Generate a label, so that the debugger will notice the - change in instruction sets. This label is also used by - the assembler to bypass the ARM code when this function - is called from a Thumb encoded function elsewhere in the - same file. Hence the definition of STUB_NAME here must - agree with the definition in gas/config/tc-arm.c. */ + bytes += 8; + + if (emit) + { + name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + + /* Generate code sequence to switch us into Thumb mode. */ + /* The .code 32 directive has already been emitted by + ASM_DECLARE_FUNCTION_NAME. */ + asm_fprintf (f, "\torr\t%r, %r, #1\n", IP_REGNUM, PC_REGNUM); + asm_fprintf (f, "\tbx\t%r\n", IP_REGNUM); + + /* Generate a label, so that the debugger will notice the + change in instruction sets. This label is also used by + the assembler to bypass the ARM code when this function + is called from a Thumb encoded function elsewhere in the + same file. Hence the definition of STUB_NAME here must + agree with the definition in gas/config/tc-arm.c. */ #define STUB_NAME ".real_start_of" - fprintf (f, "\t.code\t16\n"); + fprintf (f, "\t.code\t16\n"); #ifdef ARM_PE - if (arm_dllexport_name_p (name)) - name = arm_strip_name_encoding (name); + if (arm_dllexport_name_p (name)) + name = arm_strip_name_encoding (name); #endif - asm_fprintf (f, "\t.globl %s%U%s\n", STUB_NAME, name); - fprintf (f, "\t.thumb_func\n"); - asm_fprintf (f, "%s%U%s:\n", STUB_NAME, name); + asm_fprintf (f, "\t.globl %s%U%s\n", STUB_NAME, name); + /* APPLE LOCAL begin ARM thumb_func */ + if (TARGET_MACHO) + asm_fprintf (f, "\t.thumb_func %s%U%s\n", STUB_NAME, name); + else + fprintf (f, "\t.thumb_func\n"); + /* APPLE LOCAL end ARM thumb_func */ + + asm_fprintf (f, "%s%U%s:\n", STUB_NAME, name); + } } if (current_function_pretend_args_size) { /* Output unwind directive for the stack adjustment. */ - if (ARM_EABI_UNWIND_TABLES) + if (emit && ARM_EABI_UNWIND_TABLES) fprintf (f, "\t.pad #%d\n", current_function_pretend_args_size); - if (cfun->machine->uses_anonymous_args) + if (emit) { - int num_pushes; + if (cfun->machine->uses_anonymous_args) + { + int num_pushes; - fprintf (f, "\tpush\t{"); + fprintf (f, "\tpush\t{"); - num_pushes = ARM_NUM_INTS (current_function_pretend_args_size); + num_pushes = ARM_NUM_INTS (current_function_pretend_args_size); - for (regno = LAST_ARG_REGNUM + 1 - num_pushes; - regno <= LAST_ARG_REGNUM; - regno++) - asm_fprintf (f, "%r%s", regno, - regno == LAST_ARG_REGNUM ? "" : ", "); + for (regno = LAST_ARG_REGNUM + 1 - num_pushes; + regno <= LAST_ARG_REGNUM; + regno++) + asm_fprintf (f, "%r%s", regno, + regno == LAST_ARG_REGNUM ? "" : ", "); - fprintf (f, "}\n"); + fprintf (f, "}\n"); + } + else + asm_fprintf (f, "\tsub\t%r, %r, #%d\n", + SP_REGNUM, SP_REGNUM, + current_function_pretend_args_size); } - else - asm_fprintf (f, "\tsub\t%r, %r, #%d\n", - SP_REGNUM, SP_REGNUM, - current_function_pretend_args_size); /* We don't need to record the stores for unwinding (would it help the debugger any if we did?), but record the change in the stack pointer. */ - if (dwarf2out_do_frame ()) + if (emit && dwarf2out_do_frame ()) { char *l = dwarf2out_cfi_label (); @@ -14379,14 +15505,16 @@ work_register = thumb_find_work_register (live_regs_mask); - if (ARM_EABI_UNWIND_TABLES) + if (emit && ARM_EABI_UNWIND_TABLES) asm_fprintf (f, "\t.pad #16\n"); - asm_fprintf - (f, "\tsub\t%r, %r, #16\t%@ Create stack backtrace structure\n", - SP_REGNUM, SP_REGNUM); + bytes += 2; + if (emit) + asm_fprintf + (f, "\tsub\t%r, %r, #16\t%@ Create stack backtrace structure\n", + SP_REGNUM, SP_REGNUM); - if (dwarf2out_do_frame ()) + if (emit && dwarf2out_do_frame ()) { char *l = dwarf2out_cfi_label (); @@ -14396,48 +15524,60 @@ if (l_mask) { - thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask); + bytes += handle_thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask, emit); offset = bit_count (l_mask) * UNITS_PER_WORD; } else offset = 0; - asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM, - offset + 16 + current_function_pretend_args_size); + bytes += 4; + if (emit) + { + asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM, + offset + 16 + current_function_pretend_args_size); - asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, - offset + 4); + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset + 4); + } - /* Make sure that the instruction fetching the PC is in the right place - to calculate "start of backtrace creation code + 12". */ - if (l_mask) + bytes += 8; + if (emit) { - asm_fprintf (f, "\tmov\t%r, %r\n", work_register, PC_REGNUM); - asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, - offset + 12); - asm_fprintf (f, "\tmov\t%r, %r\n", work_register, - ARM_HARD_FRAME_POINTER_REGNUM); - asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, - offset); + /* Make sure that the instruction fetching the PC is in the right place + to calculate "start of backtrace creation code + 12". */ + if (l_mask) + { + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, PC_REGNUM); + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset + 12); + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, + ARM_HARD_FRAME_POINTER_REGNUM); + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset); + } + else + { + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, + ARM_HARD_FRAME_POINTER_REGNUM); + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset); + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, PC_REGNUM); + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset + 12); + } } - else + + bytes += 8; + if (emit) { - asm_fprintf (f, "\tmov\t%r, %r\n", work_register, - ARM_HARD_FRAME_POINTER_REGNUM); - asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, - offset); - asm_fprintf (f, "\tmov\t%r, %r\n", work_register, PC_REGNUM); + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, LR_REGNUM); asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, + offset + 8); + asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM, offset + 12); + asm_fprintf (f, "\tmov\t%r, %r\t\t%@ Backtrace structure created\n", + ARM_HARD_FRAME_POINTER_REGNUM, work_register); } - - asm_fprintf (f, "\tmov\t%r, %r\n", work_register, LR_REGNUM); - asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, - offset + 8); - asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM, - offset + 12); - asm_fprintf (f, "\tmov\t%r, %r\t\t%@ Backtrace structure created\n", - ARM_HARD_FRAME_POINTER_REGNUM, work_register); } /* Optimization: If we are not pushing any low registers but we are going to push some high registers then delay our first push. This will just @@ -14445,7 +15585,7 @@ register. */ else if ((l_mask & 0xff) != 0 || (high_regs_pushed == 0 && l_mask)) - thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask); + bytes += handle_thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask, emit); if (high_regs_pushed) { @@ -14470,7 +15610,9 @@ { if (pushable_regs & (1 << regno)) { - asm_fprintf (f, "\tmov\t%r, %r\n", regno, next_hi_reg); + bytes += 2; + if (emit) + asm_fprintf (f, "\tmov\t%r, %r\n", regno, next_hi_reg); high_regs_pushed --; real_regs_mask |= (1 << next_hi_reg); @@ -14494,16 +15636,30 @@ saved the LR then add it to the list of regs to push. */ if (l_mask == (1 << LR_REGNUM)) { - thumb_pushpop (f, pushable_regs | (1 << LR_REGNUM), - 1, &cfa_offset, - real_regs_mask | (1 << LR_REGNUM)); + bytes += handle_thumb_pushpop + (f, pushable_regs | (1 << LR_REGNUM), + 1, &cfa_offset, + real_regs_mask | (1 << LR_REGNUM), emit); l_mask = 0; } else - thumb_pushpop (f, pushable_regs, 1, &cfa_offset, real_regs_mask); + bytes += handle_thumb_pushpop (f, pushable_regs, 1, &cfa_offset, real_regs_mask, emit); } } + return bytes; +} + +static void +thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + (void) handle_thumb_unexpanded_prologue (f, true); +} + +int count_thumb_unexpanded_prologue (void) +{ + return handle_thumb_unexpanded_prologue (NULL, false); } +/* APPLE LOCAL end ARM compact switch tables */ /* Handle the case of a double word load into a low register from a computed memory address. The computed address may involve a @@ -14563,24 +15719,13 @@ /* Catch the case of
= + */ if (GET_CODE (offset) == REG) { - int reg_offset = REGNO (offset); - int reg_base = REGNO (base); - int reg_dest = REGNO (operands[0]); - - /* Add the base and offset registers together into the - higher destination register. */ - asm_fprintf (asm_out_file, "\tadd\t%r, %r, %r", - reg_dest + 1, reg_base, reg_offset); - - /* Load the lower destination register from the address in - the higher destination register. */ - asm_fprintf (asm_out_file, "\tldr\t%r, [%r, #0]", - reg_dest, reg_dest + 1); - - /* Load the higher destination register from its own address - plus 4. */ - asm_fprintf (asm_out_file, "\tldr\t%r, [%r, #4]", - reg_dest + 1, reg_dest + 1); + /* APPLE LOCAL begin ARM compact switch tables */ + /* thumb_legitimate_address_p won't allow this form, + and allowing a 3-instruction variant confuses + our instruction length counts, so remove it. + Details in rdar://5435967. */ + gcc_unreachable(); + /* APPLE LOCAL end ARM compact switch tables */ } else { @@ -15085,7 +16230,8 @@ } #endif /* AOF_ASSEMBLER */ -#ifndef ARM_PE +/* APPLE LOCAL ARM darwin section_info */ +#if !defined(ARM_PE) && !TARGET_MACHO /* Symbols in the text segment can be accessed without indirecting via the constant pool; it may take an extra binary operation, but this is still faster than indirecting via memory. Don't do this when not optimizing, @@ -15095,12 +16241,6 @@ static void arm_encode_section_info (tree decl, rtx rtl, int first) { - /* APPLE LOCAL begin ARM darwin section_info */ -#if TARGET_MACHO - darwin_encode_section_info (decl, rtl, first); -#endif - /* APPLE LOCAL end ARM darwin section_info */ - /* This doesn't work with AOF syntax, since the string table may be in a different AREA. */ #ifndef AOF_ASSEMBLER @@ -15113,24 +16253,45 @@ or known to be defined in this file then encode a short call flag. */ if (first && DECL_P (decl)) { -/* APPLE LOCAL begin ARM longcall */ -#if TARGET_MACHO - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl)) - arm_encode_call_attribute (decl, SYMBOL_LONG_CALL); - else if (! TREE_PUBLIC (decl)) - arm_encode_call_attribute (decl, SYMBOL_SHORT_CALL); -#else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl)) arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR); else if (! TREE_PUBLIC (decl)) arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); -#endif -/* APPLE LOCAL end ARM longcall */ } default_encode_section_info (decl, rtl, first); } -#endif /* !ARM_PE */ +/* APPLE LOCAL begin ARM darwin section_info */ +#endif /* !ARM_PE && !TARGET_MACHO*/ + +#if TARGET_MACHO +/* Encode the standard darwin attributes, plus the longcall flag. */ + +static void +arm_darwin_encode_section_info (tree decl, rtx rtl, int first) +{ + darwin_encode_section_info (decl, rtl, first); + + if (optimize > 0 && TREE_CONSTANT (decl)) + SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; + + /* If we are referencing a function with default visibility that is + weak then encode a long call flag in the function name, otherwise + if the function is static or or known to be defined in this file + then encode a short call flag. */ + if (DECL_P (decl)) + { + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_WEAK (decl) + && DECL_VISIBILITY (decl) == VISIBILITY_DEFAULT) + arm_encode_call_attribute (decl, SYMBOL_LONG_CALL); + /* Should this be binds_local_p??? */ + else if (! TREE_PUBLIC (decl)) + arm_encode_call_attribute (decl, SYMBOL_SHORT_CALL); + } +} +#endif +/* APPLE LOCAL end ARM darwin section_info */ static void arm_internal_label (FILE *stream, const char *prefix, unsigned long labelno) @@ -15152,6 +16313,7 @@ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, tree function) { + /* APPLE LOCAL begin ARM 4620953 4745175 5920116 */ static int thunk_label = 0; char label[256]; char labelpc[256]; @@ -15160,26 +16322,29 @@ int shift = 0; int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function) ? 1 : 0); - /* APPLE LOCAL ARM begin 4745175 */ rtx function_rtx = XEXP (DECL_RTL (function), 0); const char *function_name; + bool is_longcall = arm_is_longcall_p (function_rtx, + SYMBOL_REF_FLAGS (function_rtx), + 1); + bool is_indirected = false; /* Darwin/mach-o: use a stub for dynamic references. */ #if TARGET_MACHO - if ((flag_pic || MACHO_DYNAMIC_NO_PIC_P) - && ! machopic_data_defined_p (function_rtx)) - function_name = - machopic_indirection_name (function_rtx, true); - else - function_name = XSTR (function_rtx, 0); -#else - function_name = XSTR (function_rtx, 0); + if (TARGET_MACHO + && MACHOPIC_INDIRECT + && (! machopic_data_defined_p (function_rtx))) + { + function_name = machopic_indirection_name (function_rtx, !is_longcall); + is_indirected = true; + } + else #endif - /* APPLE LOCAL ARM end 4745175 */ + function_name = XSTR (function_rtx, 0); if (mi_delta < 0) mi_delta = - mi_delta; - if (TARGET_THUMB) + if (TARGET_THUMB || is_longcall) { int labelno = thunk_label++; ASM_GENERATE_INTERNAL_LABEL (label, "LTHUMBFUNC", labelno); @@ -15203,6 +16368,8 @@ fputs (":\n", file); fputs ("\tadd\tr12, pc, r12\n", file); } + if (is_indirected) + fputs ("\tldr\tr12, [r12]\n", file); } while (mi_delta != 0) { @@ -15217,7 +16384,7 @@ shift += 8; } } - if (TARGET_THUMB) + if (TARGET_THUMB || is_longcall) { fprintf (file, "\tbx\tr12\n"); ASM_OUTPUT_ALIGN (file, 2); @@ -15225,23 +16392,17 @@ fputs (":\n", file); if (flag_pic) { - /* APPLE LOCAL begin ARM 4745175 */ - /* If we're branching to a local routine, output: + /* If we're branching to a local Thumb routine, output: ".word .LTHUNKn-7-.LTHUNKPCn". Otherwise, output: ".word .LTHUNKn-8-.LTHUNKPCn". (inter-module thumbness is fixed up by the linker). */ rtx tem = gen_rtx_SYMBOL_REF (Pmode, function_name); -#if TARGET_MACHO - if (! machopic_data_defined_p (function_rtx)) + if (TARGET_MACHO && (TARGET_ARM || is_indirected)) tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-8)); else tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7)); -#else - tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7)); -#endif - /* APPLE LOCAL end ARM 4745175 */ tem = gen_rtx_MINUS (GET_MODE (tem), tem, @@ -15251,20 +16412,18 @@ } else /* Output ".word .LTHUNKn". */ - /* APPLE LOCAL begin ARM 4745175 */ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, function_name), 4, BITS_PER_WORD, 1); - /* APPLE LOCAL end ARM 4745175 */ } else { fputs ("\tb\t", file); - /* APPLE LOCAL ARM 4745175 */ assemble_name (file, function_name); if (NEED_PLT_RELOC) fputs ("(PLT)", file); fputc ('\n', file); } + /* APPLE LOCAL end ARM 4620953 4745175 5920116 */ } int @@ -15719,7 +16878,8 @@ return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM; if (IS_VFP_REGNUM (regno)) - return 64 + regno - FIRST_VFP_REGNUM; + /* APPLE LOCAL ARM 5757769 */ + return 256 + regno - FIRST_VFP_REGNUM; if (IS_IWMMXT_GR_REGNUM (regno)) return 104 + regno - FIRST_IWMMXT_GR_REGNUM; @@ -16115,7 +17275,7 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) { unsigned int length; - char *symbol_name, *lazy_ptr_name; + char *symbol_name, *lazy_ptr_name, *slp_label_name; static int label = 0; /* Lose our funky encoding stuff so it doesn't contaminate the stub. */ @@ -16128,6 +17288,9 @@ lazy_ptr_name = alloca (length + 32); GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length); + slp_label_name = alloca (length + 32); + GEN_SUFFIXED_NAME_FOR_SYMBOL (slp_label_name, symb, length, "$slp"); + if (flag_pic == 2) switch_to_section (darwin_sections[machopic_picsymbol_stub4_section]); else @@ -16140,7 +17303,7 @@ fprintf (file, "%s:\n", stub); fprintf (file, "\t.indirect_symbol %s\n", symbol_name); - fprintf (file, "\tldr\tip, L%s$slp\n", symbol_name); + fprintf (file, "\tldr\tip, %s\n", slp_label_name); label++; @@ -16150,11 +17313,11 @@ fprintf (file, "\tldr\tpc, [ip, #0]\n"); if (flag_pic == 2) - fprintf (file, "L%s$slp:\n\t.long\tL%s$lazy_ptr - (L%d$scv + 8)\n", - symbol_name, symbol_name, label); + fprintf (file, "%s:\n\t.long\t%s - (L%d$scv + 8)\n", + slp_label_name, lazy_ptr_name, label); else - fprintf (file, "L%s$slp:\n\t.long\tL%s$lazy_ptr\n", - symbol_name, symbol_name); + fprintf (file, "%s:\n\t.long\t%s\n", + slp_label_name, lazy_ptr_name); switch_to_section (darwin_sections[machopic_lazy_symbol_ptr_section]); fprintf (file, "%s:\n", lazy_ptr_name); @@ -16189,9 +17352,8 @@ in darwin-c.c). */ flag_trapping_math = 0; - /* Disable local RA. */ /* APPLE LOCAL conditionally disable local RA */ - /* flag_local_alloc = 0; */ + flag_local_alloc = 0; /* APPLE LOCAL rerun cse after combine */ /* flag_rerun_cse_after_combine = 1; */ @@ -16252,4 +17414,272 @@ } /* APPLE LOCAL end ARM prefer SP to FP */ +/* APPLE LOCAL begin ARM compact switch tables */ +int arm_label_align (rtx label) +{ + rtx insn = NEXT_INSN (label); + if (insn + && GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE) + { + if ((int) XEXP (PATTERN (insn), 1) == VUNSPEC_ALIGN) + return 2; + if ((int) XEXP (PATTERN (insn), 1) == VUNSPEC_ALIGN8) + return 3; + } + return align_labels_log; +} +/* APPLE LOCAL end ARM compact switch tables */ + +/* APPLE LOCAL begin ARM enhance conditional insn generation */ +/* A C expression to modify the code described by the conditional if + information CE_INFO, for the basic block BB, possibly updating the tests in + TRUE_EXPR, and FALSE_EXPR for converting the && and || parts of if-then or + if-then-else code to conditional instructions. Set either TRUE_EXPR or + FALSE_EXPR to a null pointer if the tests cannot be converted. */ + +/* p_true and p_false are given expressions of the form: + + (and (relop:CC (reg:CC) (const_int 0)) + (relop:CC (reg:CC) (const_int 0))) + + We try to simplify them to something that will work in a branch instruction. + If we can't do anything useful, return; the caller will try to substitute + the complex expression and will fail. + Currently the true and false cases are not handled. + It's surprising that there isn't already a routine somewhere that does this, + but I couldn't find one. */ + +void +arm_ifcvt_modify_multiple_tests (ce_if_block_t *ce_info ATTRIBUTE_UNUSED, + basic_block bb ATTRIBUTE_UNUSED, + rtx *p_true, + rtx *p_false) +{ + /* There is a dependency here on the order of codes in rtl.def, + also an assumption that none of the useful enum values will + collide with 0 or 1. + Order is: NE EQ GE GT LE LT GEU GTU LEU LTU */ + static RTX_CODE and_codes[10][10] = + { { NE, 0, GT, GT, LT, LT, GTU, GTU, LTU, LTU }, + { 0, EQ, EQ, 0, EQ, 0, EQ, 0, EQ, 0 }, + { GT, EQ, GE, GT, EQ, 0, 0, 0, 0, 0 }, + { GT, 0, GT, GT, 0, 0, 0, 0, 0, 0 }, + { LT, EQ, EQ, 0, LE, LT, 0, 0, 0, 0 }, + { LT, 0, 0, 0, LT, LT, 0, 0, 0, 0 }, + { GTU, EQ, 0, 0, 0, 0, GEU, GTU, EQ, 0 }, + { GTU, 0, 0, 0, 0, 0, GTU, GTU, 0, 0 }, + { LTU, EQ, 0, 0, 0, 0, EQ, 0, LEU, LTU }, + { LTU, 0, 0, 0, 0, 0, 0, 0, LTU, LTU } }; + + static RTX_CODE or_codes[10][10] = + { { NE, 1, 1, NE, 1, NE, 1, NE, 1, NE }, + { 1, EQ, GE, GE, LE, LE, GEU, GEU, LEU, LEU }, + { 1, GE, GE, GE, 1, 1, 0, 0, 0, 0 }, + { NE, GE, GE, GT, 1, NE, 0, 0, 0, 0 }, + { 1, LE, 1, 1, LE, LE, 0, 0, 0, 0 }, + { NE, LE, 1, NE, LE, LT, 0, 0, 0, 0 }, + { 1, GEU, 0, 0, 0, 0, GEU, GEU, 1, 1 }, + { NE, GEU, 0, 0, 0, 0, GEU, GTU, 1, NE }, + { 1, LEU, 0, 0, 0, 0, 1, 1, LEU, LEU }, + { NE, LEU, 0, 0, 0, 0, 1, NE, LEU, LTU } }; + + rtx true_lhs = XEXP (*p_true, 0); + rtx false_lhs = XEXP (*p_false, 0); + rtx true_rhs = XEXP (*p_true, 1); + rtx false_rhs = XEXP (*p_false, 1); + int true_and_p, false_and_p; + RTX_CODE merged_code; + + if (!TARGET_ARM) + return; + + if (GET_CODE (*p_true) == AND) + true_and_p = true; + else if (GET_CODE (*p_true) == IOR) + true_and_p = false; + else + return; + + if (GET_CODE (*p_false) == AND) + false_and_p = true; + else if (GET_CODE (*p_false) == IOR) + false_and_p = false; + else + return; + + if (!cc_register (XEXP (true_lhs, 0), CCmode) + || !cc_register (XEXP (true_lhs, 0), CCmode) + || !cc_register (XEXP (true_lhs, 0), CCmode) + || !cc_register (XEXP (true_lhs, 0), CCmode)) + return; + + if (XEXP (true_lhs, 1) != const0_rtx + || XEXP (true_rhs, 1) != const0_rtx + || XEXP (false_lhs, 1) != const0_rtx + || XEXP (false_rhs, 1) != const0_rtx) + return; + + if (GET_CODE (true_lhs) < NE || GET_CODE (true_lhs) > LTU + || GET_CODE (true_rhs) < NE || GET_CODE (true_rhs) > LTU) + *p_true = 0; + else + { + if (true_and_p) + merged_code = and_codes [GET_CODE (true_lhs) - NE][GET_CODE (true_rhs) - NE]; + else + merged_code = or_codes [GET_CODE (true_lhs) - NE][GET_CODE (true_rhs) - NE]; + if (merged_code == 0 || merged_code == 1) + *p_true = 0; + else + *p_true = gen_rtx_fmt_ee (merged_code, VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM), const0_rtx); + } + + if (GET_CODE (false_lhs) < NE || GET_CODE (false_lhs) > LTU + || GET_CODE (false_rhs) < NE || GET_CODE (false_rhs) > LTU) + *p_false = 0; + else + { + if (false_and_p) + merged_code = and_codes [GET_CODE (false_lhs) - NE][GET_CODE (false_rhs) - NE]; + else + merged_code = or_codes [GET_CODE (false_lhs) - NE][GET_CODE (false_rhs) - NE]; + if (merged_code == 0 || merged_code == 1) + *p_false = 0; + else + *p_false = gen_rtx_fmt_ee (merged_code, VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM), const0_rtx); + } +} +/* APPLE LOCAL end ARM enhance conditional insn generation */ + +/* APPLE LOCAL begin 5946347 ms_struct support */ +/* Handle a "ms_struct" attribute; arguments as in struct + attribute_spec.handler. */ +static tree +arm_handle_ms_struct_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + tree *type = NULL; + if (DECL_P (*node)) + { + if (TREE_CODE (*node) == TYPE_DECL) + type = &TREE_TYPE (*node); + } + else + type = node; + + if (!(type && (TREE_CODE (*type) == RECORD_TYPE + || TREE_CODE (*type) == UNION_TYPE))) + { + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (*type))) + { + warning (OPT_Wattributes, "%qs incompatible attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +/* Handle a "gcc_struct" attribute; arguments as in struct + attribute_spec.handler. */ +static tree +arm_handle_gcc_struct_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + tree *type = NULL; + if (DECL_P (*node)) + { + if (TREE_CODE (*node) == TYPE_DECL) + type = &TREE_TYPE (*node); + } + else + type = node; + + if (!(type && (TREE_CODE (*type) == RECORD_TYPE + || TREE_CODE (*type) == UNION_TYPE))) + { + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))) + { + /* ms_struct may be on the type by default (-mms-bitfields or + #pragma ms_struct), so gcc_struct simply means that if there + is an ms_struct attribute on type, remove it. */ + remove_attribute ("ms_struct", TYPE_ATTRIBUTES (*type)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +static bool +arm_ms_bitfield_layout_p (tree record_type) +{ + return (lookup_attribute ("ms_struct", + TYPE_ATTRIBUTES (record_type)) != NULL); +} + +/* Return the alignment necessary for the field when it's part of + an ms_struct attributed structure. */ +int +arm_field_ms_struct_align (tree field) +{ + tree type = TREE_TYPE (field); + int desired_align; + + if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) + desired_align = TYPE_ALIGN (type); + else + { + enum machine_mode mode; + /* For non-aggregate types of BIGGEST_ALIGNMENT bits or greater, + the alignment should be the size of the type. For arrays, it + should be the alignement of the members of the array. */ + mode = TYPE_MODE (TREE_CODE (type) == ARRAY_TYPE + ? get_inner_array_type (type) : type); + desired_align = GET_MODE_BITSIZE (mode) > BIGGEST_ALIGNMENT ? + GET_MODE_BITSIZE (mode) : TYPE_ALIGN (type); + gcc_assert (desired_align <= BIGGEST_MS_STRUCT_ALIGNMENT); + } + return desired_align; +} + +/* APPLE LOCAL end 5946347 ms_struct support */ + +/* APPLE LOCAL begin ARM 6008578 */ +/* Minimum alignment of a function entry point, in bits. */ +int +arm_function_boundary (void) +{ + int min_align = TARGET_ARM ? 32 : 16; + + /* Even in Thumb mode, thunks are output as ARM functions. */ + if (cfun && current_function_is_thunk) + min_align = MAX (min_align, 32); + + /* e.g., Thumb functions with jump tables. */ + if (cfun && cfun->needs_4byte_alignment) + min_align = MAX (min_align, 32); + + /* If -falign-loops was specified, use that alignment. This is _not_ + needed to guarantee that loop alignments within the function are + honored -- that's handled by the assembler and linker. However, + if we don't align the function, then our address calculations (in + arm_reorg) are incorrect, potentially wreaking havoc on the + constant pool calculations. */ + min_align = MAX (min_align, align_loops * BITS_PER_UNIT); + + return min_align; +} +/* APPLE LOCAL end ARM 6008578 */ + #include "gt-arm.h" Modified: llvm-gcc-4.2/trunk/gcc/config/arm/t-darwin URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/t-darwin?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/t-darwin (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/t-darwin Tue Jul 29 18:24:37 2008 @@ -4,7 +4,23 @@ _lshrdi3 _ashrdi3 _ashldi3 \ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ - _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf + _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf \ + _muldf3vfp _adddf3vfp _subdf3vfp _divdf3vfp \ + _eqdf2vfp _nedf2vfp _ltdf2vfp _gtdf2vfp _ledf2vfp _gedf2vfp _unorddf2vfp \ + _fixdfsivfp _fixunsdfsivfp _extendsfdf2vfp _truncdfsf2vfp \ + _floatsidfvfp _floatunssidfvfp \ + _mulsf3vfp _addsf3vfp _subsf3vfp _divsf3vfp \ + _eqsf2vfp _nesf2vfp _ltsf2vfp _gtsf2vfp _lesf2vfp _gesf2vfp _unordsf2vfp \ + _fixsfsivfp _fixunssfsivfp _floatsisfvfp _floatunssisfvfp \ + _switchu8 _switch8 _switch16 _switch32 + +# APPLE LOCAL begin 5316398 improved float/double -> int64 functions +LIB2FUNCS_EXCLUDE = _fixdfdi _fixunsdfdi _fixsfdi _fixunssfdi +LIB2FUNCS_EXTRA = $(srcdir)/config/arm/_fixdfdi.c \ + $(srcdir)/config/arm/_fixunsdfdi.c \ + $(srcdir)/config/arm/_fixsfdi.c \ + $(srcdir)/config/arm/_fixunssfdi.c +# APPLE LOCAL end 5316398 improved float/double -> int64 functions MULTILIB_OPTIONS = march=armv6k MULTILIB_DIRNAMES = v6 @@ -12,5 +28,3 @@ MULTILIB_MATCHES = TARGET_LIBGCC2_CFLAGS = -fno-inline -SHLIB_VERPFX = $(srcdir)/config/arm/darwin-libgcc - Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Tue Jul 29 18:24:37 2008 @@ -930,7 +930,8 @@ so '10.4.2' becomes 1042. Print a warning if the version number is not known. */ static const char * -version_as_macro (void) +/* APPLE LOCAL ARM 5683689 */ +macosx_version_as_macro (void) { static char result[] = "1000"; @@ -960,6 +961,81 @@ return "1000"; } +/* APPLE LOCAL begin ARM 5683689 */ +/* Return the value of darwin_iphoneos_version_min suitable for the + __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ macro. Unlike the + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macros, minor version + numbers are left-zero-padded. e.g., '1.2.3' becomes 10203. + The last/third version number (patch level?) is optional, and + defaults to '00' if not specified. In the case of a parse error, + print a warning and return 10200. */ +static const char * +iphoneos_version_as_macro (void) +{ + static char result[sizeof ("99.99.99") + 1]; + const char *src_ptr = darwin_iphoneos_version_min; + char *result_ptr = &result[0]; + + if (! darwin_iphoneos_version_min) + goto fail; + + if (! ISDIGIT (*src_ptr)) + goto fail; + + /* Copy over the major version number. */ + *result_ptr++ = *src_ptr++; + + if (ISDIGIT (*src_ptr)) + *result_ptr++ = *src_ptr++; + + if (*src_ptr != '.') + goto fail; + + src_ptr++; + + /* Start parsing the minor version number. */ + if (! ISDIGIT (*src_ptr)) + goto fail; + + /* Zero-pad a single-digit value, or copy a two-digit value. */ + *result_ptr++ = ISDIGIT (*(src_ptr + 1)) ? *src_ptr++ : '0'; + *result_ptr++ = *src_ptr++; + + /* Parse the third version number (patch level?) */ + if (*src_ptr == '\0') + { + /* Not present -- default to zeroes. */ + *result_ptr++ = '0'; + *result_ptr++ = '0'; + } + else if (*src_ptr == '.') + { + src_ptr++; + + if (! ISDIGIT (*src_ptr)) + goto fail; + + /* Zero-pad a single-digit value, or copy a two-digit value. */ + *result_ptr++ = ISDIGIT (*(src_ptr + 1)) ? *src_ptr++ : '0'; + *result_ptr++ = *src_ptr++; + } + else + goto fail; + + /* Verify and copy the terminating NULL. */ + if (*src_ptr != '\0') + goto fail; + + *result_ptr++ = '\0'; + return result; + + fail: + error ("Unknown value %qs of -miphoneos-version-min", + darwin_iphoneos_version_min); + return "10200"; +} +/* APPLE LOCAL end ARM 5683689 */ + /* Define additional CPP flags for Darwin. */ #define builtin_define(TXT) cpp_define (pfile, TXT) @@ -973,10 +1049,14 @@ /* APPLE LOCAL Apple version */ /* Don't define __APPLE_CC__ here. */ - /* APPLE LOCAL begin mainline 2007-02-20 5005743 */ - builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", - version_as_macro(), false); - /* APPLE LOCAL end mainline 2007-02-20 5005743 */ + /* APPLE LOCAL begin ARM 5683689 */ + if (darwin_macosx_version_min) + builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", + macosx_version_as_macro(), false); + else + builtin_define_with_value ("__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__", + iphoneos_version_as_macro(), false); + /* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL begin constant cfstrings */ if (darwin_constant_cfstrings) @@ -989,7 +1069,8 @@ } /* APPLE LOCAL end pascal strings */ /* APPLE LOCAL begin ObjC GC */ - if (flag_objc_gc) + /* APPLE LOCAL radar 5914395 */ + if (flag_objc_gc || flag_objc_gc_only) { builtin_define ("__strong=__attribute__((objc_gc(strong)))"); builtin_define ("__weak=__attribute__((objc_gc(weak)))"); @@ -1001,6 +1082,20 @@ builtin_define ("__weak="); } /* APPLE LOCAL end ObjC GC */ + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + if (flag_blocks && !c_dialect_cxx ()) { + /* APPLE LOCAL radar 6096219 */ + builtin_define ("__byref=__attribute__((__blocks__(byref)))"); + /* APPLE LOCAL radar 6014138 */ + builtin_define ("__block=__attribute__((__blocks__(byref)))"); + } + else { + builtin_define ("__byref="); + /* APPLE LOCAL radar 6014138 */ + builtin_define ("__block="); + } + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* APPLE LOCAL begin C* warnings to easy porting to new abi */ if (flag_objc_abi == 2) builtin_define ("__OBJC2__"); @@ -1011,9 +1106,9 @@ /* APPLE LOCAL radar 4899595 */ builtin_define ("OBJC_NEW_PROPERTIES"); /* APPLE LOCAL end radar 5072864 */ +/* APPLE LOCAL begin confused diff */ } -/* APPLE LOCAL confused diff */ - +/* APPLE LOCAL end confused diff */ /* APPLE LOCAL begin iframework for 4.3 4094959 */ bool darwin_handle_c_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) @@ -1071,3 +1166,65 @@ return true; } /* APPLE LOCAL end radar 4985544 - radar 5096648 - radar 5195402 */ + +/* APPLE LOCAL begin radar 2996215 - 6068877 */ +/* wrapper to call libcpp's conversion routine. */ +bool +cvt_utf8_utf16 (const unsigned char *inbuf, size_t length, + unsigned char **uniCharBuf, size_t *numUniChars) +{ + return cpp_utf8_utf16 (parse_in, inbuf, length, uniCharBuf, numUniChars); +} +/* This routine declares static char __utf16_string [numUniChars] in __TEXT,__ustring + section and initializes it with uniCharBuf[numUniChars] characters. +*/ +tree +create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUniChars) +{ + size_t l; + tree decl, type, init; + tree initlist = NULL_TREE; + tree attribute; + const char *section_name = "__TEXT,__ustring"; + int len = strlen (section_name); + unsigned char *uniCharBuf; + static int num; + const char *name_prefix = "__utf16_string_"; + char *name; + + if (!cvt_utf8_utf16 (inbuf, length, &uniCharBuf, numUniChars)) + return NULL_TREE; + + for (l = 0; l < *numUniChars; l++) + initlist = tree_cons (NULL_TREE, build_int_cst (char_type_node, uniCharBuf[l]), initlist); + type = build_array_type (char_type_node, + build_index_type (build_int_cst (NULL_TREE, *numUniChars))); + name = (char *)alloca (strlen (name_prefix) + 10); + sprintf (name, "%s%d", name_prefix, ++num); + decl = build_decl (VAR_DECL, get_identifier (name), type); + TREE_STATIC (decl) = 1; + DECL_INITIAL (decl) = error_mark_node; /* A real initializer is coming... */ + DECL_IGNORED_P (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; + DECL_CONTEXT (decl) = NULL_TREE; + + attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE); + attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE); + decl_attributes (&decl, attribute, 0); + attribute = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 2), NULL_TREE); + attribute = tree_cons (get_identifier ("aligned"), attribute, NULL_TREE); + decl_attributes (&decl, attribute, 0); + init = build_constructor_from_list (type, nreverse (initlist)); + TREE_CONSTANT (init) = 1; + TREE_STATIC (init) = 1; + TREE_READONLY (init) = 1; + if (c_dialect_cxx ()) + TREE_TYPE (init) = NULL_TREE; + finish_decl (decl, init, NULL_TREE); + /* Ensure that the variable actually gets output. */ + mark_decl_referenced (decl); + /* Mark the decl to avoid "defined but not used" warning. */ + TREE_USED (decl) = 1; + return decl; +} +/* APPLE LOCAL end radar 2996215 - 6068877 */ Modified: llvm-gcc-4.2/trunk/gcc/config/host-darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/host-darwin.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/host-darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/host-darwin.c Tue Jul 29 18:24:37 2008 @@ -26,7 +26,10 @@ #include "config/host-darwin.h" /* Yes, this is really supposed to work. */ -static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); +/* APPLE LOCAL begin ARM native compiler support */ +/* Not all Darwins are created equal. */ +static char pch_address_space[DARWIN_PCH_ADDR_SPACE_SIZE] __attribute__((aligned (4096))); +/* APPLE LOCAL end ARM native compiler support */ /* Return the address of the PCH address space, if the PCH will fit in it. */ Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Tue Jul 29 18:24:37 2008 @@ -25,6 +25,9 @@ TARGET_LIBGCC2_STATIC_CFLAGS = -mmacosx-version-min=10.4 # APPLE LOCAL end gcov 5573505 +# APPLE LOCAL 5901604 +MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.5.sdk + # Export the _xlq* symbols from darwin-ldouble.c. SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver Modified: llvm-gcc-4.2/trunk/gcc/convert.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/convert.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/convert.c (original) +++ llvm-gcc-4.2/trunk/gcc/convert.c Tue Jul 29 18:24:37 2008 @@ -38,7 +38,12 @@ #include "langhooks.h" #include "real.h" +/* APPLE LOCAL LLVM - begin */ +#ifdef ENABLE_LLVM #include "llvm.h" +#endif +/* APPLE LOCAL LLVM - end */ + /* Convert EXPR to some pointer or reference type TYPE. EXPR must be pointer, reference, integer, enumeral, or literal zero; in other cases error is called. */ @@ -73,13 +78,62 @@ expr); return fold_build1 (CONVERT_EXPR, type, expr); - + /* APPLE LOCAL begin blocks (C++ ck) */ + case BLOCK_POINTER_TYPE: + /* APPLE LOCAL begin radar 5809099 */ + if (objc_is_id (type) + || (TREE_CODE (type) == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (type)))) + /* APPLE LOCAL end radar 5809099 */ + return fold_build1 (NOP_EXPR, type, expr); + /* APPLE LOCAL end blocks (C++ ck) */ default: error ("cannot convert to a pointer type"); return convert_to_pointer (type, integer_zero_node); } } +/* APPLE LOCAL begin blocks (C++ ck) */ +tree +convert_to_block_pointer (tree type, tree expr) +{ + if (TREE_TYPE (expr) == type) + return expr; + + if (integer_zerop (expr)) + { + tree t = build_int_cst (type, 0); + if (TREE_OVERFLOW (expr) || TREE_CONSTANT_OVERFLOW (expr)) + t = force_fit_type (t, 0, TREE_OVERFLOW (expr), + TREE_CONSTANT_OVERFLOW (expr)); + return t; + } + + switch (TREE_CODE (TREE_TYPE (expr))) + { + case BLOCK_POINTER_TYPE: + return fold_build1 (NOP_EXPR, type, expr); + + case INTEGER_TYPE: + if (TYPE_PRECISION (TREE_TYPE (expr)) != POINTER_SIZE) + expr = fold_build1 (NOP_EXPR, + lang_hooks.types.type_for_size (POINTER_SIZE, 0), + expr); + return fold_build1 (CONVERT_EXPR, type, expr); + + case POINTER_TYPE: + /* APPLE LOCAL radar 5809099 */ + if (objc_is_id (TREE_TYPE (expr)) || VOID_TYPE_P (TREE_TYPE (TREE_TYPE (expr)))) + return build1 (NOP_EXPR, type, expr); + /* fall thru */ + + default: + error ("cannot convert to a block pointer type"); + return convert_to_block_pointer (type, integer_zero_node); + } +} + +/* APPLE LOCAL end blocks (C++ ck) */ + /* Avoid any floating point extensions from EXP. */ tree strip_float_extensions (tree exp) @@ -397,9 +451,9 @@ break; /* LLVM LOCAL begin */ /* FIXME: l-functions should be supported sometimes */ - #ifdef ENABLE_LLVM +#ifdef ENABLE_LLVM break; - #endif +#endif /* LLVM LOCAL end */ if (outprec < TYPE_PRECISION (long_integer_type_node) || (outprec == TYPE_PRECISION (long_integer_type_node) @@ -415,9 +469,10 @@ if (!TARGET_C99_FUNCTIONS) break; /* LLVM LOCAL begin */ - #ifdef ENABLE_LLVM +#ifdef ENABLE_LLVM break; - #endif +#endif + /* LLVM LOCAL end */ if (outprec < TYPE_PRECISION (long_integer_type_node) || (outprec == TYPE_PRECISION (long_integer_type_node) && !TYPE_UNSIGNED (type))) @@ -474,6 +529,8 @@ { case POINTER_TYPE: case REFERENCE_TYPE: + /* APPLE LOCAL radar 6035389 */ + case BLOCK_POINTER_TYPE: if (integer_zerop (expr)) return build_int_cst (type, 0); Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c Tue Jul 29 18:24:37 2008 @@ -151,4 +151,10 @@ cp_finish_file (); } +/* APPLE LOCAL begin radar 5732232 - blocks */ +tree c_finish_return (tree exp) +{ + return exp; +} +/* APPLE LOCAL end radar 5732232 - blocks */ #include "gtype-cp.h" Modified: llvm-gcc-4.2/trunk/gcc/genautomata.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/genautomata.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/genautomata.c (original) +++ llvm-gcc-4.2/trunk/gcc/genautomata.c Tue Jul 29 18:24:37 2008 @@ -7031,6 +7031,7 @@ fprintf (output_file, "};\n\n"); VEC_free (vect_el_t,heap, translate_vect); } + /* The value in a table state x ainsn -> something which represents undefined value. */ static int undefined_vect_el_value; Modified: llvm-gcc-4.2/trunk/gcc/stmt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stmt.c?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stmt.c (original) +++ llvm-gcc-4.2/trunk/gcc/stmt.c Tue Jul 29 18:24:37 2008 @@ -2514,9 +2514,11 @@ /* RANGE may be signed, and really large ranges will show up as negative numbers. */ || compare_tree_int (range, 0) < 0 -#ifndef ASM_OUTPUT_ADDR_DIFF_ELT +/* APPLE LOCAL begin ARM compact switch tables */ +#if !defined(ASM_OUTPUT_ADDR_DIFF_ELT) && !defined(ASM_OUTPUT_ADDR_DIFF_VEC) || flag_pic #endif +/* APPLE LOCAL end ARM compact switch tables */ || !flag_jump_tables || TREE_CONSTANT (index_expr) /* If neither casesi or tablejump is available, we can @@ -2594,6 +2596,10 @@ /* Get table of labels to jump to, in order of case index. */ ncases = tree_low_cst (range, 0) + 1; +/* APPLE LOCAL begin ARM compact switch tables */ + /* Add target-specific extra labels. */ + ncases += TARGET_EXTRA_CASES; +/* APPLE LOCAL end ARM compact switch tables */ labelvec = alloca (ncases * sizeof (rtx)); memset (labelvec, 0, ncases * sizeof (rtx)); Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=54180&r1=54179&r2=54180&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Tue Jul 29 18:24:37 2008 @@ -995,8 +995,12 @@ (It should be renamed to INDIRECT_TYPE_P.) Keep these checks in ascending code order. */ +/* APPLE LOCAL begin blocks 5862465 */ #define POINTER_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE) + (TREE_CODE (TYPE) == POINTER_TYPE \ + || TREE_CODE (TYPE) == REFERENCE_TYPE \ + || TREE_CODE (TYPE) == BLOCK_POINTER_TYPE) +/* APPLE LOCAL end blocks 5862465 */ /* Nonzero if this type is a complete type. */ #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE) @@ -2104,6 +2108,17 @@ #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \ (TYPE_CHECK (NODE)->type.contains_placeholder_bits) +/* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks */ +/* Indicates that the struct type is a block struct, rather than + a 'normal' struct, i.e. one of its fields is a function that can + be called. This uses the existing bit-field lang_flag_2 in the + struct tree_type, rather than creating a new bit field, as + lang_flag_2 is currently unused and we don't want to increase the + size of trees if we can avoid it. */ +#define TYPE_BLOCK_IMPL_STRUCT(NODE) \ + (TYPE_CHECK (NODE)->type.lang_flag_2) +/* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ + struct die_struct; struct tree_type GTY(()) @@ -2128,6 +2143,14 @@ unsigned lang_flag_0 : 1; unsigned lang_flag_1 : 1; + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ + /* Since it is currently completely unused, and in the interest of + not making trees any bigger than they already are, lang_flag_2 + in the tree_type struct will be used to indicate that a struct is a + block struct. The macro used for these purposes is + TYPE_BLOCK_IMPL_STRUCT, rather than TYPE_LANG_FLAG_2, in order to make + its uses in the code more clear. */ + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ unsigned lang_flag_2 : 1; unsigned lang_flag_3 : 1; unsigned lang_flag_4 : 1; @@ -2142,11 +2165,11 @@ int GTY ((tag ("0"))) address; char * GTY ((tag ("1"))) pointer; struct die_struct * GTY ((tag ("2"))) die; - /* LLVM LOCAL begin */ +/* LLVM LOCAL begin */ unsigned GTY ((tag ("3"))) llvm; /* Really an LLVM Type vector (LTypes) index */ } GTY ((desc ("LLVM_IS_ENABLED ? 3 : debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"), - descbits ("2"))) symtab; /* LLVM LOCAL end */ + descbits ("2"))) symtab; tree name; tree minval; tree maxval; @@ -3038,7 +3061,19 @@ /* Belongs to VAR_DECL exclusively. */ ENUM_BITFIELD(tls_model) tls_model : 3; - /* 11 unused bits. */ + + /* APPLE LOCAL begin radar 5732232 - blocks */ + /* Belongs to FUNCTION_DECL exclusively. */ + unsigned block_helper_func : 1; + /* Belong to VAR_DECL exclusively. */ + unsigned block_decl_byref : 1; + unsigned block_decl_copied : 1; + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + unsigned copyable_byref_local_var : 1; + unsigned copyable_byref_local_nonpod : 1; + /* 6 unused bits. */ + /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* APPLE LOCAL end radar 5732232 - blocks */ }; /* In a VAR_DECL that's static, @@ -3084,6 +3119,16 @@ thread-local storage. */ #define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model) +/* APPLE LOCAL begin radar 5732232 - blocks */ +#define BLOCK_HELPER_FUNC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.block_helper_func) +#define BLOCK_DECL_BYREF(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_byref) +#define BLOCK_DECL_COPIED(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_copied) +/* APPLE LOCAL end radar 5732232 - blocks */ +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +#define COPYABLE_BYREF_LOCAL_VAR(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_var) +#define COPYABLE_BYREF_LOCAL_NONPOD(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_nonpod) +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* In a VAR_DECL, nonzero if the data should be allocated from thread-local storage. */ #define DECL_THREAD_LOCAL_P(NODE) \ From isanbard at gmail.com Tue Jul 29 18:46:20 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 23:46:20 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54182 - in /llvm-gcc-4.2/trunk/gcc/testsuite: bugs/powerpc/ g++.apple/ g++.dg/eh/ g++.dg/ext/ g++.dg/gomp/ g++.dg/inherit/ g++.dg/init/ g++.dg/template/ gcc.apple/ gcc.c-torture/execute/ gcc.c-torture/execute/ieee/ gcc.dg/ gcc.dg/gomp/ gcc.dg/pch/ gcc.dg/tree-ssa/ gcc.dg/vect/ gcc.dg/vmx/ gcc.target/arm/ gcc.target/i386/ gcc.target/powerpc/ gfortran.dg/ lib/ obj-c++.dg/ objc.dg/ objc/execute/ Message-ID: <200807292346.m6TNkOiC014297@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 18:46:19 2008 New Revision: 54182 URL: http://llvm.org/viewvc/llvm-project?rev=54182&view=rev Log: Merge changes from the Apple GCC 4.2 testsuite Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/complex2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/pr31748.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/covariant15.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/virtual4.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/new21.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/ptrmem4.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/overload9.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/static30.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4641942.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/qnan-eq-inf.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/pr32500.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/pr32468-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pr32450.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/arm/stack-corruption.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/pr32389.c llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/fmt_p_1.f90 llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/pr32533.f90 llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/disambiguate-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-5.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-aggr-assign-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-5.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-setter-name.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-assign-ivar-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/g++.xfail llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/libstdc++-v3.xfail llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/objc.xfail llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-13.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/pubtypes.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5814283.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pragma-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-4.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/uninit-test-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/zerofill-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/arm-mmx-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-no-ms-layout.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-version-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/framework-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/pch.exp llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-4.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/trampoline-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/vect-70.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vmx/varargs-4.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/rotate.c llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports.exp llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/5599048.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/encode-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/message-metadata-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-copy-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-neg-ivar-check-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/no-offsetof-warn.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-bycopy-return-warn-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-instantiate-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-passby-ref-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-13.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10-64bit.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11-64bit.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9-64bit.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-8.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/format-arg-attribute-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/message-metadata-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-copy-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1-64bit.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-bycopy-return-warn-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-ivar-offset.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-no-category-name.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/optional-property.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/pubtypes-id-test.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1-64bit.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/type-stream-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string1.x llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string2.x llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string3.x llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string4.x Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/g++.xfail URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/g%2B%2B.xfail?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/g++.xfail (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/g++.xfail Tue Jul 29 18:46:19 2008 @@ -12,14 +12,5 @@ ###------------------------------------------------------------------ 4531667: g++.dg/bitreverse-23.C execution test # -# The following tests fail only when the c++ suite is run through Obj-C++. -# -# The following tests fail only when the c++ suite is run with -m64 -# -# The following tests fail only when the c++ suite is run on ppc with -m64 -# -# The following tests fail only when the c++ suite is run on x86 -# -# The following tests fail only when the c++ suite is run on G5 with -m64 -# -# The following tests fail only when the c++ suite is run on x86 with -m64 +# The following tests fail only when the c++ suite is run with -mcpu=G5 +5822514: g++.dg/altivec-8.C execution test Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail Tue Jul 29 18:46:19 2008 @@ -11,6 +11,7 @@ ### ###------------------------------------------------------------------ 5066141: gcc.dg/pr30643.c scan-assembler-not undefined +5951276: gcc.target/i386/20020616-1.c execution test # # ppc only 3906375: gcc.dg/debug/debug-1.c -gstabs -fast scan-assembler xyzzy @@ -74,12 +75,6 @@ 5275911: gcc.dg/invalid-call-1.c non-compatible type (test for warnings, line 18) 0000000: compiler driver --coverage option(s) (compiler options) # -# -mmacosx-version-min=10.4 only -5342828: gcc.dg/pie-link.c (test for excess errors) -# -# -m64 -mmacosx-version-min=10.4 only -5342857: gcc.apple/objcpp.c (test for excess errors) -# # -fasm-blocks only 5087183: gcc.dg/cpp/19951227-1.c (test for errors, line 2) 5087183: gcc.dg/cpp/direct2.c non-include (test for errors, line 13) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/libstdc++-v3.xfail URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/libstdc%2B%2B-v3.xfail?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/libstdc++-v3.xfail (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/libstdc++-v3.xfail Tue Jul 29 18:46:19 2008 @@ -22,3 +22,15 @@ # # ppc only 4227568: 26_numerics/complex/13450.cc execution test +## +# the following failures are for SnowLeopard only +5713011: 22_locale/num_get/get/char/12.cc execution test +5713011: 22_locale/num_get/get/wchar_t/12.cc execution test +5713011: 27_io/basic_istream/extractors_arithmetic/char/07.cc execution test +5713011: 27_io/basic_istream/extractors_arithmetic/wchar_t/07.cc execution test +5713011: 27_io/basic_istream/extractors_other/char/1.cc execution test +5713011: 27_io/basic_istream/extractors_other/wchar_t/1.cc execution test +5713011: 27_io/basic_stringbuf/in_avail/char/1.cc execution test +5713011: 27_io/basic_stringbuf/in_avail/wchar_t/1.cc execution test +5713011: 27_io/basic_stringbuf/str/char/1.cc execution test +5713011: 27_io/basic_stringbuf/str/wchar_t/1.cc execution test Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/objc.xfail URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/objc.xfail?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/objc.xfail (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/objc.xfail Tue Jul 29 18:46:19 2008 @@ -15,34 +15,6 @@ 5405050: objc.dg/encode-8.m (test for excess errors) 5405050: objc.dg/gnu-runtime-3.m (test for excess errors) 5405050: objc.dg/type-stream-1.m (test for excess errors) -4943900: objc/execute/string1.m compilation, -O0 -fnext-runtime -4943900: objc/execute/string1.m compilation, -O1 -fnext-runtime -4943900: objc/execute/string1.m compilation, -O2 -fnext-runtime -4943900: objc/execute/string1.m compilation, -O3 -fomit-frame-pointer -fnext-runtime -4943900: objc/execute/string1.m compilation, -O3 -g -fnext-runtime -4943900: objc/execute/string1.m compilation, -Os -fnext-runtime -4943900: objc/execute/string1.m compilation, -fast -fnext-runtime -4943900: objc/execute/string2.m compilation, -O0 -fnext-runtime -4943900: objc/execute/string2.m compilation, -O1 -fnext-runtime -4943900: objc/execute/string2.m compilation, -O2 -fnext-runtime -4943900: objc/execute/string2.m compilation, -O3 -fomit-frame-pointer -fnext-runtime -4943900: objc/execute/string2.m compilation, -O3 -g -fnext-runtime -4943900: objc/execute/string2.m compilation, -Os -fnext-runtime -4943900: objc/execute/string2.m compilation, -fast -fnext-runtime -4943900: objc/execute/string3.m compilation, -O0 -fnext-runtime -4943900: objc/execute/string3.m compilation, -O1 -fnext-runtime -4943900: objc/execute/string3.m compilation, -O2 -fnext-runtime -4943900: objc/execute/string3.m compilation, -O3 -fomit-frame-pointer -fnext-runtime -4943900: objc/execute/string3.m compilation, -O3 -g -fnext-runtime -4943900: objc/execute/string3.m compilation, -Os -fnext-runtime -4943900: objc/execute/string3.m compilation, -fast -fnext-runtime -4943900: objc/execute/string4.m compilation, -O0 -fnext-runtime -4943900: objc/execute/string4.m compilation, -O1 -fnext-runtime -4943900: objc/execute/string4.m compilation, -O2 -fnext-runtime -4943900: objc/execute/string4.m compilation, -O3 -fomit-frame-pointer -fnext-runtime -4943900: objc/execute/string4.m compilation, -O3 -g -fnext-runtime -4943900: objc/execute/string4.m compilation, -Os -fnext-runtime -4943900: objc/execute/string4.m compilation, -fast -fnext-runtime 5095016: objc.dg-struct-layout-encoding-1/t001_main.m (test for excess errors) 5095016: objc.dg-struct-layout-encoding-1/t002_main.m (test for excess errors) 5095016: objc.dg-struct-layout-encoding-1/t003_main.m (test for excess errors) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-13.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/asm-block-13.C?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-13.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-13.C Tue Jul 29 18:46:19 2008 @@ -17,6 +17,8 @@ add eax, eax add fool, eax add eax, fool + addpd xmm0, xmm0 + addpd xmm0, fool addps xmm0, xmm0 addps xmm0, fool addsd xmm0, xmm0 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/pubtypes.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/pubtypes.C?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/pubtypes.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/pubtypes.C Tue Jul 29 18:46:19 2008 @@ -2,10 +2,12 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-O0 -gdwarf-2 -dA -fno-eliminate-unused-debug-types" } */ /* { dg-final { scan-assembler "__debug_pubtypes" } } */ -/* { dg-final { scan-assembler "long+\[ \t\]+0x\[0-9a-f]+\[ \t\]+\[#;]+\[ \t\]+Length of Public Type Names Info" } } */ -/* { dg-final { scan-assembler "\"empty\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */ -/* { dg-final { scan-assembler "\"A\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */ -/* { dg-final { scan-assembler "\"B\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */ +/* APPLE LOCAL begin ARM assembler uses @ for comments */ +/* { dg-final { scan-assembler "long+\[ \t\]+\(0x\)?\[0-9a-f]+\[ \t\n\]+\[#;@]+\[ \t\]+Length of Public Type Names Info" } } */ +/* { dg-final { scan-assembler "\"empty\\\\0\"+\[ \t\]+\[#;@]+\[ \t\]+external name" } } */ +/* { dg-final { scan-assembler "\"A\\\\0\"+\[ \t\]+\[#;@]+\[ \t\]+external name" } } */ +/* { dg-final { scan-assembler "\"B\\\\0\"+\[ \t\]+\[#;@]+\[ \t\]+external name" } } */ +/* APPLE LOCAL end ARM assembler uses @ for comments */ struct A Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/eh/table.C?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C Tue Jul 29 18:46:19 2008 @@ -3,11 +3,21 @@ void needed(); void unneeded(); +/* APPLE LOCAL begin omit calls to empty destructors 5559195 */ +int n = 0; +/* APPLE LOCAL end omit calls to empty destructors 5559195 */ + class Bar { public: Bar() {} - virtual ~Bar() {} + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + virtual ~Bar() { + // Without this nontrivial operation, destructor is optimized away and + // GCC_except_table0 is not generated. + n = 1; + } + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ void unneeded(); }; Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/complex2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/ext/complex2.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/complex2.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/complex2.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,5 @@ +// PR c++/31388 +// { dg-options "" } + +bool b = !0i; + Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/ext/interface4.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,13 @@ +/* https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227376 */ + +/* { dg-do compile } */ +/* { dg-options "-g2" } */ + +/* We used to crash when emitting debug info for type N::A because its + context was a namespace, not a function. */ + +#include "interface4.h" + +void f ( ) { + g ( ); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/pr31748.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/gomp/pr31748.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/pr31748.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/pr31748.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,10 @@ +// PR c++/31748 + +struct A; + +void +foo () +{ +#pragma omp parallel private(A) // { dg-error "struct A.*is not a variable" } + ; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/covariant15.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/inherit/covariant15.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/covariant15.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/covariant15.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,18 @@ +/* This used to ICE (PR c++/27492) */ +/* { dg-do "compile" } */ + +struct A {}; + +class B : A +{ + virtual A* foo(); /* { dg-error "overriding" } */ +}; + +struct C : virtual B +{ + virtual C* foo(); /* { dg-error "invalid covariant return type" } */ +}; + +C* C::foo() { return 0; } + +struct D : C {}; Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/virtual4.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/inherit/virtual4.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/virtual4.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inherit/virtual4.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,24 @@ +// PR c++/31027 + +struct A {}; + +template +struct C: virtual A { + C() {} + template C(const C&) {} + C func(const class C&) const; + operator bool() const; +}; + +template +struct D: C { + void func2() { + Ca; + a.func(a); + } +}; + +void func3() { + Ca; + a.func(a); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/new21.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/init/new21.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/new21.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/new21.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,10 @@ +// PR c++/32251 + +struct A { + A(); + void operator delete(void *, ...); +}; + +void foo () { + new A; // { dg-warning "deallocation" } +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/ptrmem4.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/init/ptrmem4.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/ptrmem4.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/ptrmem4.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,13 @@ +// PR c++/32245 +// { dg-do run } + +struct foo { + int mem1; + int foo::* mem2; +}; + +int main () { + foo x = { 0 } ; + if (x.mem2 != foo().mem2) + return 1; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/overload9.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/template/overload9.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/overload9.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/overload9.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,18 @@ +// PR c++/32232 + +template struct A; +template struct B {}; +template A& operator<<(A&, const B&); + +template +struct A +{ + A& operator<<(A& (*)(A&)); // { dg-error "candidate" } +}; + +template A& foo(A&); +extern A c; + +int main () { + c << (1, foo); // { dg-error "no match" } +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/static30.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/template/static30.C?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/static30.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/template/static30.C Tue Jul 29 18:46:19 2008 @@ -0,0 +1,10 @@ +// PR c++/31992 + +template struct A +{ + static const int i1; + static const int i2; +}; + +template const int A::i1(A::i); +template const int A::i2(3, A::i); Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4641942.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4641942.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4641942.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4641942.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,21 @@ +/* APPLE LOCAL file 4641942 */ +/* { dg-do compile } */ +/* { dg-options "-fstrict-aliasing -Wstrict-aliasing" } */ + +typedef struct rec { + unsigned long hi; + unsigned long lo; +} rec; + +typedef struct data +{ + unsigned long long s; + unsigned long long t; +} data; + +void foo (void) +{ + data* eng; + unsigned long long next = eng->t + eng->s; + rec m = *((rec*)&next); /* { dg-warning "dereferencing type-punned pointer will break strict-aliasing rules" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5814283.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5814283.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5814283.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5814283.c Tue Jul 29 18:46:19 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file 5814283 */ -/* { dg-do compile } */ +/* { dg-do compile { target "i?86-*-darwin*" } } */ /* { dg-options "-O2 -mssse3" } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c Tue Jul 29 18:46:19 2008 @@ -13,7 +13,7 @@ /* { dg-final { scan-assembler "vspltisw v11, *10" } } */ /* { dg-final { scan-assembler "vspltisw v12, *11" } } */ /* { dg-final { scan-assembler "vspltisw v13, *12" } } */ - + void foo (vector signed int v0, vector signed int v1, vector signed int v2, vector signed int v3, vector signed int v4, vector signed int v5, Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c Tue Jul 29 18:46:19 2008 @@ -16,6 +16,8 @@ add eax, eax add fool, eax add eax, fool + addpd xmm0, xmm0 + addpd xmm0, fool addps xmm0, xmm0 addps xmm0, fool addsd xmm0, xmm0 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pragma-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pragma-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pragma-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pragma-1.c Tue Jul 29 18:46:19 2008 @@ -7,21 +7,3 @@ #if 1 #error Don't? /* { dg-error "Don't?" } */ #endif -/* { dg-options "" } */ - -#warning Don't? /* { dg-warning "Don't?" } */ -#if 0 -#error Don't? /* { dg-bogus "Don't?" } */ -#endif -#if 1 -#error Don't? /* { dg-error "Don't?" } */ -#endif -/* { dg-options "" } */ - -#warning Don't? /* { dg-warning "Don't?" } */ -#if 0 -#error Don't? /* { dg-bogus "Don't?" } */ -#endif -#if 1 -#error Don't? /* { dg-error "Don't?" } */ -#endif Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-1.c Tue Jul 29 18:46:19 2008 @@ -3,10 +3,11 @@ /* { dg-options "-O0 -gdwarf-2 -dA -fno-eliminate-unused-debug-types" } */ /* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */ /* { dg-final { scan-assembler "__debug_pubtypes" } } */ -/* { dg-final { scan-assembler "long\[ \t]+0x\[0-9a-f]+\[ \t]+\[#;]\[ \t]+Length of Public Type Names Info" } } */ -/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler "unused_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ - +/* APPLE LOCAL begin ARM assembler uses @ for comments */ +/* { dg-final { scan-assembler "long\[ \t]+\(0x\)?\[0-9a-f]+\[ \t\n]+\[#;@]\[ \t]+Length of Public Type Names Info" } } */ +/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler "unused_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* APPLE LOCAL end ARM assembler uses @ for comments */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-2.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-2.c Tue Jul 29 18:46:19 2008 @@ -3,9 +3,11 @@ /* { dg-options "-O0 -gdwarf-2 -dA" } */ /* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */ /* { dg-final { scan-assembler "__debug_pubtypes" } } */ -/* { dg-final { scan-assembler "long\[ \t]+0x6a+\[ \t]+\[#;]\[ \t]+Length of Public Type Names Info" } } */ -/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;]\[ \t\]+external name" } } */ -/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ +/* APPLE LOCAL begin ARM assembler uses @ for comments */ +/* { dg-final { scan-assembler "long\[ \t]+\(0x6a|106\)+\[ \t\n]+\[#;@]\[ \t]+Length of Public Type Names Info" } } */ +/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;@]\[ \t\]+external name" } } */ +/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* APPLE LOCAL end ARM assembler uses @ for comments */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-3.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-3.c Tue Jul 29 18:46:19 2008 @@ -3,10 +3,12 @@ /* { dg-options "-O0 -gdwarf-2 -dA" } */ /* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */ /* { dg-final { scan-assembler "__debug_pubtypes" } } */ -/* { dg-final { scan-assembler "long\[ \t]+0x6a+\[ \t]+\[#;]\[ \t\]+Length of Public Type Names Info" } } */ -/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler-not "\"list_name_type\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ +/* APPLE LOCAL begin ARM assembler uses @ for comments */ +/* { dg-final { scan-assembler "long\[ \t]+\(0x6a|106\)+\[ \t\n]+\[#;@]\[ \t\]+Length of Public Type Names Info" } } */ +/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler-not "\"list_name_type\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* APPLE LOCAL end ARM assembler uses @ for comments */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-4.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-4.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-4.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/pubtypes-4.c Tue Jul 29 18:46:19 2008 @@ -90,9 +90,11 @@ } /* { dg-final { scan-assembler "__debug_pubtypes" } } */ -/* { dg-final { scan-assembler "long\[ \t]+0xa1+\[ \t]+\[#;]\[ \t]+Length of Public Type Names Info" } } */ -/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler "\"list_name_type\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler "\"enum_list_array\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ -/* { dg-final { scan-assembler "\"field_union\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ +/* APPLE LOCAL begin ARM assembler uses @ for comments */ +/* { dg-final { scan-assembler "long\[ \t]+\(0xa1|161\)+\[ \t\n]+\[#;@]\[ \t]+Length of Public Type Names Info" } } */ +/* { dg-final { scan-assembler "used_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler-not "unused_struct\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler "\"list_name_type\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler "\"enum_list_array\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* { dg-final { scan-assembler "\"field_union\\\\0\"\[ \t]+\[#;@]\[ \t]+external name" } } */ +/* APPLE LOCAL end ARM assembler uses @ for comments */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/qnan-eq-inf.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/qnan-eq-inf.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/qnan-eq-inf.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/qnan-eq-inf.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,27 @@ +/* APPLE LOCAL file 5752613 */ +/* { dg-options "-std=c99" } */ +/* { dg-do run { target arm-*-darwin* } } */ +#include +#include +#include + +int main (int argc, const char *argv[]) +{ + volatile union{ double d; unsigned long long u; }u; + volatile int fred; + unsigned invalid; + + feclearexcept (FE_ALL_EXCEPT); + + /* Create a QNaN */ + u.u = 0xffffffffffffffffULL; + + /* Comparing to inf should not set 'invalid'. testing > DBL_MAX will. + testing == inf will not. */ + fred = (u.d == __builtin_inf()) ; + + invalid = fetestexcept (FE_INVALID); + if (invalid) + abort(); + exit (0); +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/uninit-test-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/uninit-test-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/uninit-test-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/uninit-test-1.c Tue Jul 29 18:46:19 2008 @@ -1,6 +1,7 @@ /* Radar 4964532 */ /* { dg-do compile } */ -/* { dg-options "-O2 -gdwarf-2 -dA -mmacosx-version-min=10.4" } */ +/* { dg-options "-O2 -gdwarf-2 -dA -mmacosx-version-min=10.4" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-O2 -gdwarf-2 -dA" { target arm*-*-darwin* } } */ /* { dg-final { scan-assembler "DW_OP_APPLE_uninit" } } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/zerofill-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/zerofill-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/zerofill-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/zerofill-1.c Tue Jul 29 18:46:19 2008 @@ -2,11 +2,3 @@ /* { dg-final { scan-assembler "foo,bar" } } */ int foo __attribute__((section("foo,bar"))); -/* { dg-do compile { target *-*-darwin* } } */ -/* { dg-final { scan-assembler "foo,bar" } } */ - -int foo __attribute__((section("foo,bar"))); -/* { dg-do compile { target *-*-darwin* } } */ -/* { dg-final { scan-assembler "foo,bar" } } */ - -int foo __attribute__((section("foo,bar"))); Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x Tue Jul 29 18:46:19 2008 @@ -0,0 +1,6 @@ +# APPLE LOCAL file ARM no hw subnormal support +if [istarget "arm*-apple-darwin*"] { + lappend additional_flags "-msoft-float" +} + +return 0 Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/pr32500.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/pr32500.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/pr32500.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/pr32500.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,26 @@ +extern void abort(void); +extern void exit(int); +void foo(int) __attribute__((noinline)); +void bar(void) __attribute__((noinline)); + +/* Make sure foo is not inlined or considered pure/const. */ +int x; +void foo(int i) { x = i; } +void bar(void) { exit(0); } + +int +main(int argc, char *argv[]) +{ + int i; + int numbers[4] = { 0xdead, 0xbeef, 0x1337, 0x4242 }; + + for (i = 1; i <= 12; i++) { + if (i <= 4) + foo(numbers[i]); + else if (i >= 7 && i <= 9) + bar(); + } + + abort(); +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/arm-mmx-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/arm-mmx-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/arm-mmx-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/arm-mmx-1.c Tue Jul 29 18:46:19 2008 @@ -5,6 +5,8 @@ /* { dg-skip-if "" { *-*-* } { "-mfloat-abi=softfp" } { "" } } */ /* { dg-require-effective-target arm32 } */ /* { dg-final { scan-assembler "ldmfd\[ ]sp!.*ip,\[ ]*pc" } } */ +/* APPLE LOCAL alternate frame layout */ +/* { dg-skip-if "" { arm*-apple-darwin* } { "*" } { "" } } */ /* This function uses all the call-saved registers, namely r4, r5, r6, r7, r8, r9, sl, fp. Since we also save lr, that leaves an odd Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-1.c Tue Jul 29 18:46:19 2008 @@ -1,5 +1,6 @@ /* Test for MS structure sizes. */ -/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */ +/* APPLE LOCAL 5946347 ms_struct support */ +/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* arm*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ /* { dg-options "-std=gnu99" } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-2.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-ms_struct-2.c Tue Jul 29 18:46:19 2008 @@ -1,5 +1,6 @@ /* Test for MS structure sizes. */ -/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */ +/* APPLE LOCAL 5946347 ms_struct support */ +/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* arm*-*-darwin*} } */ /* { dg-require-effective-target ilp32 } */ /* { dg-options "-std=gnu99" } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ /* APPLE LOCAL end mainline 4.3 2007-06-14 */ \ // { dg-require-weak "" } // { dg-options "-O2" } -// { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } } +/* APPLE LOCAL begin 5817940 */ +/* APPLE LOCAL end special options for ppc no longer needed */ // { dg-additional-sources "attr-weakref-1a.c attr-weakref-1b.c" } // Copyright 2005 Free Software Foundation, Inc. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout-2.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout-2.c Tue Jul 29 18:46:19 2008 @@ -5,7 +5,8 @@ posted to GCC-patches http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */ -/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */ +/* APPLE LOCAL 5946347 ms_struct support */ +/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* arm*-*-darwin*} } */ /* { dg-options "-D_TEST_MS_LAYOUT" } */ /* This test uses the attribute instead of the command line option. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-ms-layout.c Tue Jul 29 18:46:19 2008 @@ -6,7 +6,7 @@ posted to GCC-patches http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */ -/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */ +/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* arm*-*-darwin*} } */ /* { dg-options "-mms-bitfields -D_TEST_MS_LAYOUT" } */ #include @@ -178,6 +178,29 @@ #else /* testing -mno-ms-bitfields */ +#ifdef __arm__ + size_t exp_sizeof_one = 8; + size_t exp_sizeof_two = 8; + size_t exp_sizeof_three = 6; + size_t exp_sizeof_four = 8; + size_t exp_sizeof_five = 8; + size_t exp_sizeof_six = 8; + size_t exp_sizeof_seven = 8; + size_t exp_sizeof_eight = 2; + size_t exp_sizeof_nine = 1; + size_t exp_sizeof_ten = 2; + + unsigned short exp_one_c = 6; + unsigned int exp_two_c = 6; + unsigned char exp_three_c = 64; + unsigned char exp_four_c = 4; + char exp_five_c = 5; + char exp_six_c = 5; + char exp_seven_c = 5; + char exp_eight_c = 1; + char exp_nine_c = 0; + char exp_ten_c = 1; +#else size_t exp_sizeof_one = 8; size_t exp_sizeof_two = 8; size_t exp_sizeof_three = 6; @@ -199,7 +222,7 @@ char exp_eight_c = 1; char exp_nine_c = 0; char exp_ten_c = 1; - +#endif #endif unsigned char i; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-no-ms-layout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-no-ms-layout.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-no-ms-layout.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bf-no-ms-layout.c Tue Jul 29 18:46:19 2008 @@ -6,7 +6,7 @@ posted to GCC-patches http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */ -/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin } } */ +/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin arm*-*-darwin*} } */ /* { dg-options "-mno-ms-bitfields" } */ #include @@ -178,6 +178,29 @@ #else /* testing -mno-ms-bitfields */ +#ifdef __arm__ + size_t exp_sizeof_one = 8; + size_t exp_sizeof_two = 8; + size_t exp_sizeof_three = 6; + size_t exp_sizeof_four = 8; + size_t exp_sizeof_five = 8; + size_t exp_sizeof_six = 8; + size_t exp_sizeof_seven = 8; + size_t exp_sizeof_eight = 2; + size_t exp_sizeof_nine = 1; + size_t exp_sizeof_ten = 2; + + unsigned short exp_one_c = 6; + unsigned int exp_two_c = 6; + unsigned char exp_three_c = 64; + unsigned char exp_four_c = 4; + char exp_five_c = 5; + char exp_six_c = 5; + char exp_seven_c = 5; + char exp_eight_c = 1; + char exp_nine_c = 0; + char exp_ten_c = 1; +#else size_t exp_sizeof_one = 8; size_t exp_sizeof_two = 8; size_t exp_sizeof_three = 6; @@ -199,7 +222,7 @@ char exp_eight_c = 1; char exp_nine_c = 0; char exp_ten_c = 1; - +#endif #endif unsigned char i; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-version-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-version-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-version-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-version-1.c Tue Jul 29 18:46:19 2008 @@ -1,7 +1,8 @@ /* Basic test of the -mmacosx-version-min option. */ /* { dg-options "-mmacosx-version-min=10.1" } */ -/* { dg-do link { target *-*-darwin* } } */ +/* APPLE LOCAL ARM */ +/* { dg-do link { target powerpc*-*-darwin* i?86*-*-darwin* } } */ int main() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/framework-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/framework-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/framework-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/framework-1.c Tue Jul 29 18:46:19 2008 @@ -1,4 +1,5 @@ -/* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM no Carbon support */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-F." } */ #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/pr32468-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/pr32468-1.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/pr32468-1.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/pr32468-1.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,100 @@ +/* PR libgomp/32468 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */ + +extern int printf (const char *, ...); +extern int omp_get_thread_num (void), omp_get_num_threads (void); +extern int bar (void); +extern int baz (const char *, ...); + +void +f1 (void) +{ +#pragma omp parallel + { + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + } +} + +void +f2 (void) +{ +#pragma omp parallel + { + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f3 (void) +{ +#pragma omp parallel + { + int bb = bar (); + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + } +} + +void +f4 (void) +{ + int i; +#pragma omp parallel + { + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp for schedule (dynamic, 15) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f5 (void) +{ + int i; +#pragma omp parallel + { + #pragma omp for schedule (dynamic, 15) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f6 (void) +{ + int i; +#pragma omp parallel + { + int bb = bar (); + #pragma omp for schedule (runtime) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +/* There should not be a GOMP_parallel_{loop,sections}* call. */ +/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop" 0 "ompexp"} } */ +/* { dg-final { scan-tree-dump-times "GOMP_parallel_sections" 0 "ompexp"} } */ +/* { dg-final { cleanup-tree-dump "ompexp" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/pch.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/pch.exp?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/pch.exp (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/pch.exp Tue Jul 29 18:46:19 2008 @@ -28,8 +28,14 @@ # APPLE LOCAL begin # Test MACOSX_DEPLOYMENT_TARGET -set macosx_deployment_target env(MACOSX_DEPLOYMENT_TARGET) -setenv MACOSX_DEPLOYMENT_TARGET 10.2 +# Due to a TCL bug (Radar 5823211), unsetenv() does not work properly. +# The var will be set to empty, not unset, and then the linker complains. +#set macosx_deployment_target_saved 0 +#if [info exists env(MACOSX_DEPLOYMENT_TARGET)] { +# set macosx_deployment_target "$env(MACOSX_DEPLOYMENT_TARGET)" +# set macosx_deployment_target_saved 1 +#} +#setenv MACOSX_DEPLOYMENT_TARGET 10.4 set test "cfstring-1.c" set f [open $test w] set v 0 @@ -44,7 +50,13 @@ puts $f "" close $f dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h" -set MACOSX_DEPLOYMENT_TARGET $macosx_deployment_target +# Due to a TCL bug (Radar 5823211), unsetenv() does not work properly. +# The var will be set to empty, not unset, and then the linker complains. +#if { ${macosx_deployment_target_saved} == 1 } { +# setenv MACOSX_DEPLOYMENT_TARGET "$macosx_deployment_target" +#} else { +# unsetenv MACOSX_DEPLOYMENT_TARGET +#} file delete $test file delete $testh # APPLE LOCAL end Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pr32450.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pr32450.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pr32450.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pr32450.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,33 @@ +/* Contributed by Joost VandeVondele */ + +/* { dg-do run } */ +/* { dg-require-profiling "-pg" } */ +/* { dg-options "-O2 -pg" } */ +/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */ + +extern void abort (void); + +int stack_pointer; + +void +__attribute__((noinline)) +mystop () +{ + abort (); +} + +void +__attribute__((noinline)) +add () +{ + if (stack_pointer + 1 > 10) + mystop (); + + stack_pointer = stack_pointer + 1; +} + +int main () +{ + add (); + return stack_pointer - 1; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-3.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-3.c Tue Jul 29 18:46:19 2008 @@ -7,6 +7,8 @@ /* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ +/* APPLE LOCAL ARM 5798689 sibcalls not implemented for Thumb mode */ +/* { dg-skip-if "" { arm-*-darwin* } { "-mthumb" } { "" } } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. This test is xfailed on targets without sibcall patterns Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-4.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-4.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-4.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/sibcall-4.c Tue Jul 29 18:46:19 2008 @@ -7,6 +7,8 @@ /* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ +/* APPLE LOCAL ARM 5798689 sibcalls not implemented for Thumb mode */ +/* { dg-skip-if "" { arm-*-darwin* } { "-mthumb" } { "" } } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. This test is xfailed on targets without sibcall patterns Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/trampoline-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/trampoline-1.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/trampoline-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/trampoline-1.c Tue Jul 29 18:46:19 2008 @@ -6,7 +6,8 @@ /* { dg-options "-O2 -fnested-functions" } */ /* APPLE LOCAL testsuite nested functions */ /* Weird, if one adds -lgcc, then it works, seems like ar isn't pulling all it needs to out of a single .a file (libgcc.a. */ - +/* APPLE LOCAL ARM stack not executable */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* This used to fail on various versions of Solaris 2 because the trampoline couldn't be made executable. */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,50 @@ +/* Contributed by Jack Lloyd */ + +/* { dg-options "-O2 -ftree-vectorize" } */ +/* { dg-options "-O2 -ftree-vectorize -march=nocona" { target { i?86-*-* x86_64-*-* } } } */ + +typedef unsigned long long word; + +const unsigned int MP_WORD_BITS = 64; +const word MP_WORD_MASK = ~((word)0); +const word MP_WORD_TOP_BIT = (word)1 << (8*sizeof(word) - 1); + +extern void abort (void); + +word do_div(word n1, word n0, word d) +{ + word high = n1 % d, quotient = 0; + unsigned int j; + + for(j = 0; j != MP_WORD_BITS; ++j) + { + word high_top_bit = (high & MP_WORD_TOP_BIT); + + high <<= 1; + high |= (n0 >> (MP_WORD_BITS-1-j)) & 1; + quotient <<= 1; + + if(high_top_bit || high >= d) + { + high -= d; + quotient |= 1; + } + } + + return quotient; +} + +int main() +{ + word result; + + result = do_div(0x0000000000200000ll, + 0x0000000000000000ll, + 0x86E53497CE000000ll); + + + if (result != 0x3CBA83) + abort (); + + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c Tue Jul 29 18:46:19 2008 @@ -50,6 +50,5 @@ return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_compare_double } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_compare_double } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/vect-70.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/vect-70.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/vect-70.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vect/vect-70.c Tue Jul 29 18:46:19 2008 @@ -3,7 +3,7 @@ #include #include "tree-vect.h" -#define N 12 +#define N 16 struct s{ int m; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vmx/varargs-4.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vmx/varargs-4.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vmx/varargs-4.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/vmx/varargs-4.c Tue Jul 29 18:46:19 2008 @@ -1,4 +1,3 @@ -/* { dg-require-holes-deterministic "" } */ #include "harness.h" #include #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/arm/stack-corruption.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/arm/stack-corruption.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/arm/stack-corruption.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/arm/stack-corruption.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mthumb -fno-omit-frame-pointer" } */ + +int main() { + return 0; +} + +/* { dg-final { scan-assembler-not "\tadd\tr7, sp, #8\n" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/pr32389.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/pr32389.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/pr32389.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/pr32389.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,10 @@ +/* Testcase by Mike Frysinger */ + +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-options "-msse" } */ + +double f1(); +int f2() { + __builtin_ia32_stmxcsr(); + return f1(); +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/rotate.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/rotate.c?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/rotate.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/rotate.c Tue Jul 29 18:46:19 2008 @@ -1,4 +1,3 @@ -/* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-final { scan-assembler-not "slwi" } } */ unsigned int foo (unsigned int x) Added: llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/fmt_p_1.f90 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/fmt_p_1.f90?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/fmt_p_1.f90 (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/fmt_p_1.f90 Tue Jul 29 18:46:19 2008 @@ -0,0 +1,12 @@ +! { dg-do run } +! PR32554 Bug in P formatting +! Test case from the bug reporter +program gfcbug66 + real(8) :: x = 1.0e-100_8 + character(50) :: outstr + write (outstr,'(1X,2E12.3)') x, 2 * x + if (outstr.ne." 0.100E-99 0.200E-99") call abort + write (outstr,'(1X,1P,2E12.3)') x, 2 * x ! Second printed number is wrong + if (outstr.ne." 1.000-100 2.000-100") call abort +end program gfcbug66 + Added: llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/pr32533.f90 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/pr32533.f90?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/pr32533.f90 (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gfortran.dg/pr32533.f90 Tue Jul 29 18:46:19 2008 @@ -0,0 +1,18 @@ +! { dg-do run } +! { dg-options "-O2 -ftree-vectorize -ffast-math" } +! +! Contributed by Joost VandeVondele +! +SUBROUTINE T(nsubcell,sab_max,subcells) + INTEGER, PARAMETER :: dp=KIND(0.0D0) + REAL(dp) :: sab_max(3), subcells,nsubcell(3) + nsubcell(:) = MIN(MAX(1,NINT(0.5_dp*subcells/sab_max(:))),20) +END SUBROUTINE T + +INTEGER, PARAMETER :: dp=KIND(0.0D0) +REAL(dp) :: sab_max(3), subcells,nsubcell(3) +subcells=2.0_dp +sab_max=0.590060749244805_dp +CALL T(nsubcell,sab_max,subcells) +IF (ANY(nsubcell.NE.2.0_dp)) CALL ABORT() +END Modified: llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports.exp?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports.exp (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports.exp Tue Jul 29 18:46:19 2008 @@ -126,48 +126,6 @@ return $value } -# APPLE LOCAL begin 5612787 sse4 -# Implement an effective-target check for property PROP by invoking -# the compiler and seeing if it prints any messages. Assume that the -# property holds if the compiler doesn't print anything. The other -# arguments are as for get_compiler_messages, starting with TYPE. -proc check_no_compiler_messages {prop args} { - global et_cache - - set target [current_target_name] - if {![info exists et_cache($prop,target)] - || $et_cache($prop,target) != $target} { - verbose "check_no_compiler_messages $prop: compiling source for $target" 2 - set et_cache($prop,target) $target - set et_cache($prop,value) \ - [string match "" [eval get_compiler_messages $prop 0 $args]] - } - set value $et_cache($prop,value) - verbose "check_no_compiler_messages $prop: returning $value for $target" 2 - return $value -} - -# Similar to check_no_compiler_messages, but also verify that the regular -# expression PATTERN matches the compiler's output. -proc check_no_messages_and_pattern {prop pattern args} { - global et_cache - - set target [current_target_name] - if {![info exists et_cache($prop,target)] - || $et_cache($prop,target) != $target} { - verbose "check_no_messages_and_pattern $prop: compiling source for $target" 2 - set et_cache($prop,target) $target - set results [eval get_compiler_messages $prop 1 $args] - set et_cache($prop,value) \ - [expr [string match "" [lindex $results 0]] \ - && [regexp $pattern [lindex $results 1]]] - } - set value $et_cache($prop,value) - verbose "check_no_messages_and_pattern $prop: returning $value for $target" 2 - return $value -} -# APPLE LOCAL end 5612787 sse4 - ############################### # proc check_weak_available { } ############################### Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/5599048.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/5599048.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/5599048.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/5599048.mm Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file radar 5599048 */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-options "-O -framework Cocoa" } */ -#import +/* { dg-options "-O -framework Foundation" } */ +#import const NSPoint orig = NSMakePoint(20, 8); @interface foo:NSObject Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/bitfield-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm Tue Jul 29 18:46:19 2008 @@ -9,6 +9,8 @@ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include /* APPLE LOCAL radar 4894756 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/bitfield-4.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm Tue Jul 29 18:46:19 2008 @@ -6,6 +6,8 @@ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-cfstring-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-1.mm Tue Jul 29 18:46:19 2008 @@ -7,6 +7,8 @@ /* { dg-do run { target *-*-darwin* } } */ /* { dg-options "-fconstant-cfstrings -framework Cocoa" } */ +/* APPLE LOCAL ARM Cocoa not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #import #import Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-10.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm Tue Jul 29 18:46:19 2008 @@ -4,7 +4,7 @@ /* Contributed by Ziemowit Laski */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-11.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm Tue Jul 29 18:46:19 2008 @@ -4,7 +4,7 @@ /* Contributed by Ziemowit Laski */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -fconstant-string-class=XStr" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-9.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ /* Contributed by Ziemowit Laski */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM radar 5804096 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/cxx-ivars-2.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm Tue Jul 29 18:46:19 2008 @@ -2,7 +2,9 @@ // and if they perform their desired function. // { dg-do run } -// { dg-options "-fobjc-call-cxx-cdtors" } +/* APPLE LOCAL begin 5809596 */ +/* Removed option */ +/* APPLE LOCAL end 5809596 */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/cxx-ivars-3.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm Tue Jul 29 18:46:19 2008 @@ -1,8 +1,9 @@ // APPLE LOCAL file mainline // Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata. -// { dg-do run { target *-*-darwin* } } +// APPLE LOCAL ARM radar 5804096 - radar 5706927 +// { dg-do run { target powerpc*-*-darwin* } } // APPLE LOCAL radar 4842158 -// { dg-options "-fobjc-call-cxx-cdtors -fnext-runtime -mmacosx-version-min=10.3" } +// { dg-options "-fnext-runtime -mmacosx-version-min=10.3" } /* APPLE LOCAL radar 4280641 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/defs-warn-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm Tue Jul 29 18:46:19 2008 @@ -4,6 +4,8 @@ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/defs.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm Tue Jul 29 18:46:19 2008 @@ -5,6 +5,8 @@ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/disambiguate-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/disambiguate-1.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/disambiguate-1.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/disambiguate-1.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,19 @@ +/* APPLE LOCAL file radar 5355344 */ +/* Test that parser can disambiguate a conditional expression from a protocol type use. */ + +/* { dg-do run } */ +int m_nMinID, m_nMaxID; +extern "C" void abort (void); + +int MyFunction(int id) +{ + return (id < m_nMinID || id > m_nMaxID) ; +} + +int main() +{ + if (!MyFunction (100)) + abort (); + return 0; +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/encode-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/encode-3.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/encode-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/encode-3.mm Tue Jul 29 18:46:19 2008 @@ -18,12 +18,19 @@ int main(void) { const char *encode = @encode(long); -#if __OBJC2__ - if (strcmp (encode, "q")) -#else - if (strcmp (encode, "l")) -#endif - abort(); + /* APPLE LOCAL begin ARM 5804096 */ + switch (sizeof (long)) + { + case 4: + if (strcmp (encode, "l")) + abort (); + break; + case 8: + if (strcmp (encode, "q")) + abort (); + break; + } + /* APPLE LOCAL end ARM 5804096 */ if (strcmp (enc, "{Vec=ffiq}")) abort(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/message-metadata-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/message-metadata-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/message-metadata-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/message-metadata-1.mm Tue Jul 29 18:46:19 2008 @@ -1,7 +1,9 @@ /* APPLE LOCAL file radar 4582204 */ /* Test that message_ref_t meta-data is generated for for objc and obj-c++ */ -/* { dg-options "-fobjc-abi-version=2 -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-fobjc-abi-version=2 -mmacosx-version-min=10.5" } */ /* { dg-do compile } */ +/* APPLE LOCAL ARM hybrid ABI */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ @interface Foo +class; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/method-11.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm Tue Jul 29 18:46:19 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-5.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/newproperty-5.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-5.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-5.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,35 @@ +/* APPLE LOCAL file radar 5285911 */ +/* Test that can have a 'setter' method only without a property or the corresponding + 'getter' method. */ +/* { dg-options "-mmacosx-version-min=10.5 -framework Foundation" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-framework Foundation" { target arm*-*-darwin* } } */ +/* { dg-do run { target *-*-darwin* } } */ + +#import + +/* { dg-do run } */ + +static int g_val; + + at interface Subclass : NSObject +{ + int setterOnly; +} +- (void) setSetterOnly:(int)value; + at end + + at implementation Subclass +- (void) setSetterOnly:(int)value { + setterOnly = value; + g_val = setterOnly; +} + at end + +int main (void) { + Subclass *x = [[Subclass alloc] init]; + + x.setterOnly = 4; + if (g_val != 4) + abort (); + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/newproperty-class-method-1.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-1.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-1.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,66 @@ +/* APPLE LOCAL file radar 5277239 */ +/* Test use of class method calls using property dot-syntax used for + property 'getter' and 'setter' messaging. */ +/* { dg-options "-mmacosx-version-min=10.5 -framework Foundation" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-framework Foundation" { target arm*-*-darwin* } } */ +/* { dg-do run { target *-*-darwin* } } */ + +#import + +/* { dg-do run } */ + + at interface Subclass : NSObject ++ (int)magicNumber; ++ (void)setMagicNumber:(int)value; ++ (void)setFakeSetterNumber:(int)value; + at end + + at implementation Subclass +int _magicNumber = 0; ++ (int)magicNumber { + return _magicNumber; +} + ++ (void)setMagicNumber:(int)value { + _magicNumber = value; +} + ++ (void)setFakeSetterNumber:(int)value { + _magicNumber = value; +} + ++ (void) classMeth +{ + self.magicNumber = 10; + if (self.magicNumber != 10) + abort (); +} + at end + +int main (void) { + + if (Subclass.magicNumber != 0) + abort (); + Subclass.magicNumber = 2 /*[Subclass setMagicNumber:2]*/; + if (Subclass.magicNumber != 2) + abort (); + + Subclass.magicNumber += 3; + if (Subclass.magicNumber != 5) + abort (); + Subclass.magicNumber -= 5; + if (Subclass.magicNumber != 0) + abort (); + /* We only have a setter in the following case. */ + Subclass.fakeSetterNumber = 123; + /* We read it using the other getter. */ + if (Subclass.magicNumber != 123) + abort (); + Subclass.fakeSetterNumber = Subclass.magicNumber; + if (Subclass.magicNumber != 123) + abort (); + + /* Test class methods using the new syntax. */ + [Subclass classMeth]; + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/newproperty-class-method-2.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-2.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-class-method-2.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,27 @@ +/* APPLE LOCAL file radar 5277239 */ +/* Test use of class method calls using property dot-syntax used for + property 'getter' and 'setter' messaging. */ +/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-do compile { target *-*-darwin* } } */ + + at interface INTF +- (int) METH; +- (void)setMETH:(int)value; ++ (void) c_method; + at end + + at implementation INTF ++ (void) c_method +{ + int j = self.METH; /* { dg-error "accessing unknown" } */ + self.METH = 2; /* { dg-error "accessing unknown" } */ +} + +- (int) METH { return 1; } +- (void)setMETH:(int)value { } + at end + +int main() { + int i = INTF.METH ; /* { dg-error "accessing unknown" } */ + INTF.METH = 1; /* { dg-error "accessing unknown" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-copy-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/newproperty-copy-3.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-copy-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-copy-3.mm Tue Jul 29 18:46:19 2008 @@ -2,7 +2,7 @@ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-new-property" } */ /* { dg-do compile { target *-*-darwin* } } */ -#include +#include @interface NamedObject : NSObject @property(copy) NSString *name; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-neg-ivar-check-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/newproperty-neg-ivar-check-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-neg-ivar-check-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/newproperty-neg-ivar-check-1.mm Tue Jul 29 18:46:19 2008 @@ -9,9 +9,9 @@ @end @implementation Moe - at synthesize ivar; + at synthesize ivar; /* { dg-error "synthesized property 'ivar' must either be named the same as a compatible ivar or must explicitly name an ivar" } */ - (void)setIvar:(int)arg{} - at end /* { dg-error "synthesized property 'ivar' must either be named the same as a compatible ivar or must explicitly name an ivar" } */ + at end @interface Fred @property int ivar; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/no-offsetof-warn.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/no-offsetof-warn.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/no-offsetof-warn.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/no-offsetof-warn.mm Tue Jul 29 18:46:19 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 4783068 */ /* Don't issue error when objctive-c internally synthesizes dereferencing of a null object. */ -/* { dg-options "-Werror -fobjc-gc -fobjc-call-cxx-cdtors" } */ +/* { dg-options "-Werror -fobjc-gc" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-require-effective-target objc_gc } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-bycopy-return-warn-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-bycopy-return-warn-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-bycopy-return-warn-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-bycopy-return-warn-1.mm Tue Jul 29 18:46:19 2008 @@ -2,6 +2,8 @@ /* Check that an instance method with 'bycopy' return type issues a warning when the object it is returning does not conform to NSCoding protocol. */ /* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM Cocoa not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include @interface MyClass : NSObject Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-4.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm Tue Jul 29 18:46:19 2008 @@ -1,7 +1,8 @@ /* APPLE LOCAL file ObjC GC */ /* A run-time test for insertion of write barriers. */ -/* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* APPLE LOCAL radar 5706927 */ +/* { dg-do run { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -mmacosx-version-min=10.3" } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-aggr-assign-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-aggr-assign-1.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-aggr-assign-1.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-aggr-assign-1.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,127 @@ +/* APPLE LOCAL file radar 3742561 */ +/* Test that we generate void * objc_memmove_collectable(void *dst, const void *src, size_t size) + API when struct has a 'strong' object pointer in a variety of situations. */ +/* { dg-options "-fobjc-gc -mmacosx-version-min=10.5 -framework Cocoa" } */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-require-effective-target objc_gc } */ + +#define objc_copyStruct X_objc_copyStruct +#define objc_memmove_collectable X_objc_memmove_collectable +#include +#undef objc_memmove_collectable +#undef objc_copyStruct + +static int count; + +/* Only ppc32 API for property assignment makes the call to objc_copyStruct. */ +static void +objc_copyStruct (void *dst, const void * src, size_t size, bool arg, bool arg2) +{ + memcpy (dst, src, size); + count++; +} + +typedef struct S { + int ii; +} SS; + +struct type_s { + SS may_recurse; + id id_val; +}; + +struct nono { + nono & operator = (const nono & arg) + { + memcpy (this, &arg, sizeof(nono)); + return *this; + } + struct type_s nono_val; + id id_nono; + nono (int val) + { + nono_val.may_recurse.ii = val; + } +}; + + at interface NamedObject : NSObject +{ + struct type_s type_s_ivar; +} +- (void) setSome : (struct type_s) arg; +- (struct type_s) getSome; + at property(assign) struct type_s aggre_prop; + at end + + at implementation NamedObject +- (void) setSome : (struct type_s) arg + { + type_s_ivar = arg; + } +- (struct type_s) getSome + { + return type_s_ivar; + } + at synthesize aggre_prop = type_s_ivar; + at end + +struct type_s some = {{1234}, (id)0}; + +struct type_s get(void) +{ + return some; +} + +struct type_s GlobalVariable; + +static void * +objc_memmove_collectable(void *dst, const void *src, size_t size) +{ + memcpy (dst, src, size); + count++; +} + +int main(void) { + struct type_s local; + struct type_s *p; + int old_count; + + NamedObject *object = [[NamedObject alloc] init]; + + /* Assigning into a global */ + GlobalVariable = get(); + if (count != 1 || GlobalVariable.may_recurse.ii != 1234) + abort (); + + /* Assigning into a local */ + local = GlobalVariable; + if (count != 2 || local.may_recurse.ii != 1234) + abort (); + + p = (struct type_s *) malloc (sizeof (struct type_s)); + /* Assigning thourgh a pointer */ + *p = local; + if (count != 3 || p->may_recurse.ii != 1234) + abort (); + + /* Assigning to an ivar */ + [object setSome:GlobalVariable]; + if (count != 4 || [object getSome].may_recurse.ii != 1234) + abort (); + + local.may_recurse.ii = 6578; + object.aggre_prop = local; + if (count != 5 || object.aggre_prop.may_recurse.ii != 6578) + abort (); + + /* class assignment with overloaded '=' operator must NOT call the new API. */ + old_count = count; + nono nono_rhs (89); + nono nono_lhs (100); + nono_lhs = nono_rhs; + if (count != old_count || nono_lhs.nono_val.may_recurse.ii != 89) + abort (); + + return 0; +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-section-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm Tue Jul 29 18:46:19 2008 @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ @interface INTF @end Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-instantiate-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-instantiate-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-instantiate-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-instantiate-1.mm Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file radar 4439126 */ /* Test to see if instantiation occurs before meta-data is generated. */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-options "-framework Cocoa" } */ +/* { dg-options "-framework Foundation" } */ #import class Base Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-passby-ref-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-passby-ref-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-passby-ref-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-passby-ref-1.mm Tue Jul 29 18:46:19 2008 @@ -1,8 +1,8 @@ /* APPLE LOCAL file radar 4476365 */ /* This that pass-by-referencong workd in obj-c++ */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-options "-framework Cocoa" } */ -#include +/* { dg-options "-framework Foundation" } */ +#include @interface Test : NSObject - (void) process: (int)r3 :(int)r4 :(int)r5 :(int)r6 :(int)r7 :(int)r8 :(int)r9 :(int)r10 :(int &)i; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-visibility-hidden-1.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm Tue Jul 29 18:46:19 2008 @@ -3,6 +3,7 @@ /* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ __attribute__((visibility("hidden"))) @interface Foo { Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-instanceSizeStart-1.mm?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm Tue Jul 29 18:46:19 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file radar 5333233 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5 -m64" } */ + + at interface Super { id isa; } @end + at implementation Super @end + + at interface SubNoIvars : Super + at end + + at implementation SubNoIvars @end + +int main() { return 0; } +/* { dg-final { scan-assembler "L_ZL27_OBJC_CLASS_RO_\\\$_SubNoIvars:\n\t.long\t0\n\t.long\t8\n\t.long\t8" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-13.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-13.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-13.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-13.mm Tue Jul 29 18:46:19 2008 @@ -1,7 +1,9 @@ /* APPLE LOCAL file radar 4660569 */ /* No warning here because accessor methods are INHERITED from NSButton */ /* APPLE LOCAL radar 4899595 */ -/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5" } */ +/* AppKit not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include @interface NSButton (Properties) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-4.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-4.mm Tue Jul 29 18:46:19 2008 @@ -3,7 +3,9 @@ /* Program should compile with no error or warning. */ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4899595 */ -/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5" } */ +/* Cocoa not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #import @interface NSWindow (Properties) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/template-4.mm?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm Tue Jul 29 18:46:19 2008 @@ -1,8 +1,10 @@ /* APPLE LOCAL file mainline */ /* Author: Ziemowit Laski . */ -/* APPLE LOCAL radar 4842177 */ -/* { dg-options "-fnext-runtime -mmacosx-version-min=10.3 -fno-constant-cfstrings" } */ -/* { dg-do run } */ +/* APPLE LOCAL radar 4842177 , radar 5706927 */ +/* { dg-options "-fnext-runtime -mmacosx-version-min=10.3 -fno-constant-cfstrings" { target powerpc*-*-darwin* } } */ +/* { dg-options "-fnext-runtime -fno-constant-cfstrings" { target arm*-*-darwin* } } */ +/* APPLE LOCAL Radar 5706927 */ +/* { dg-do run { target powerpc*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m Tue Jul 29 18:46:19 2008 @@ -3,8 +3,10 @@ /* Contributed by Ziemowit Laski . */ /* { dg-options "-lobjc -Wpadded" } */ /* { dg-do run } */ -/* APPLE LOCAL objc2 */ +/* APPLE LOCAL begin objc2 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ +/* APPLE LOCAL end objc2 */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m Tue Jul 29 18:46:19 2008 @@ -6,8 +6,10 @@ /* Contributed by Ziemowit Laski . */ /* { dg-options "-Wpadded" } */ /* { dg-do run } */ -/* APPLE LOCAL objc2 */ +/* APPLE LOCAL begin objc2 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ +/* APPLE LOCAL end objc2 */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-1.m Tue Jul 29 18:46:19 2008 @@ -6,7 +6,8 @@ /* Developed by Ziemowit Laski . */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-options "-fconstant-cfstrings -framework Cocoa" } */ +/* { dg-options "-fconstant-cfstrings -framework Cocoa" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-fconstant-cfstrings -framework Foundation" { target arm*-*-darwin* } } */ #import #import Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10-64bit.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10-64bit.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10-64bit.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10-64bit.m Tue Jul 29 18:46:19 2008 @@ -2,7 +2,7 @@ /* Test if ObjC constant string layout is checked properly, regardless of how constant string classes get derived. */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -m64 -fobjc-abi-version=1" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m Tue Jul 29 18:46:19 2008 @@ -4,7 +4,7 @@ /* APPLE LOCAL file 4149909 */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11-64bit.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11-64bit.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11-64bit.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11-64bit.m Tue Jul 29 18:46:19 2008 @@ -2,7 +2,7 @@ /* Test if ObjC constant string layout is checked properly, regardless of how constant string classes get derived. */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -fconstant-string-class=XStr -m64 -fobjc-abi-version=1" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m Tue Jul 29 18:46:19 2008 @@ -4,7 +4,7 @@ /* APPLE LOCAL file 4149909 */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -fconstant-string-class=XStr" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m Tue Jul 29 18:46:19 2008 @@ -3,7 +3,7 @@ /* Author: Ziemowit Laski */ /* { dg-options "-fno-constant-cfstrings -fwritable-strings -fconstant-string-class=Foo -mmacosx-version-min=10.4" } */ -/* { dg-do run { target *-*-darwin* } } */ +/* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9-64bit.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9-64bit.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9-64bit.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9-64bit.m Tue Jul 29 18:46:19 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file 4492976 */ /* Test if ObjC constant strings get placed in the correct section. */ /* { dg-options "-fnext-runtime -m64 -fobjc-abi-version=1 -fno-constant-cfstrings" } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-9.m Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ /* APPLE LOCAL constant cfstrings */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* APPLE LOCAL radar 4492976 */ /* { dg-require-effective-target ilp32 } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file radar 4441551 */ /* Issue warning wherevr @defs is used. */ /* { dg-options "-lobjc -Wobjc2" } */ -/* { dg-do run } */ +/* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m Tue Jul 29 18:46:19 2008 @@ -3,8 +3,10 @@ /* Contributed by Ziemowit Laski . */ /* { dg-options "-lobjc" } */ /* { dg-do run } */ -/* APPLE LOCAL objc2 */ +/* APPLE LOCAL begin objc2 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ +/* APPLE LOCAL end objc2 */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7.m Tue Jul 29 18:46:19 2008 @@ -1,5 +1,7 @@ /* { dg-options "-fgnu-runtime" } */ /* { dg-do run } */ +/* APPLE LOCAL ARM not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* LLVM LOCAL */ /* { dg-xfail-if "" { *-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-8.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-8.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-8.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-8.m Tue Jul 29 18:46:19 2008 @@ -1,5 +1,7 @@ /* { dg-options "-fgnu-runtime" } */ /* { dg-do run } */ +/* APPLE LOCAL ARM not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* LLVM LOCAL */ /* { dg-xfail-if "" { *-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/format-arg-attribute-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/format-arg-attribute-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/format-arg-attribute-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/format-arg-attribute-1.m Tue Jul 29 18:46:19 2008 @@ -3,6 +3,7 @@ format strings. */ /* { dg-options "-Wformat -Wformat-security -Wformat-nonliteral -mmacosx-version-min=10.5" } */ /* { dg-do compile { target *-*-darwin* } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ usable on MacOS X 10.3 and later. */ /* Contributed by Ziemowit Laski . */ /* { dg-options "-freplace-objc-classes" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/message-metadata-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/message-metadata-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/message-metadata-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/message-metadata-1.m Tue Jul 29 18:46:19 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file radar 4582204 */ /* Test that message_ref_t meta-data is generated for for objc and obj-c++ */ /* { dg-options "-fobjc-abi-version=2 -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-fno-objc-legacy-dispatch" { target arm*-*-darwin* } } */ /* { dg-do compile } */ @interface Foo Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m Tue Jul 29 18:46:19 2008 @@ -3,8 +3,10 @@ /* Author: Ziemowit Laski . */ /* { dg-options "-fnext-runtime" } */ /* { dg-do compile } */ -/* APPLE LOCAL objc2 */ +/* APPLE LOCAL begin objc2 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ +/* APPLE LOCAL end objc2 */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-5.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-5.m?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-5.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-5.m Tue Jul 29 18:46:19 2008 @@ -0,0 +1,35 @@ +/* APPLE LOCAL file radar 5285911 */ +/* Test that can have a 'setter' method only without a property or the corresponding + 'getter' method. */ +/* { dg-options "-mmacosx-version-min=10.5 -framework Foundation" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-framework Foundation" { target arm*-*-darwin* } } */ +/* { dg-do run { target *-*-darwin* } } */ + +#import + +/* { dg-do run } */ + +static int g_val; + + at interface Subclass : NSObject +{ + int setterOnly; +} +- (void) setSetterOnly:(int)value; + at end + + at implementation Subclass +- (void) setSetterOnly:(int)value { + setterOnly = value; + g_val = setterOnly; +} + at end + +int main (void) { + Subclass *x = [[Subclass alloc] init]; + + x.setterOnly = 4; + if (g_val != 4) + abort (); + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-1.m?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-1.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-1.m Tue Jul 29 18:46:19 2008 @@ -0,0 +1,66 @@ +/* APPLE LOCAL file radar 5277239 */ +/* Test use of class method calls using property dot-syntax used for + property 'getter' and 'setter' messaging. */ +/* { dg-options "-mmacosx-version-min=10.5 -framework Foundation" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-framework Foundation" { target arm*-*-darwin* } } */ +/* { dg-do run { target *-*-darwin* } } */ + +#import + +/* { dg-do run } */ + + at interface Subclass : NSObject ++ (int)magicNumber; ++ (void)setMagicNumber:(int)value; ++ (void)setFakeSetterNumber:(int)value; + at end + + at implementation Subclass +int _magicNumber = 0; ++ (int)magicNumber { + return _magicNumber; +} + ++ (void)setMagicNumber:(int)value { + _magicNumber = value; +} + ++ (void)setFakeSetterNumber:(int)value { + _magicNumber = value; +} + ++ (void) classMeth +{ + self.magicNumber = 10; + if (self.magicNumber != 10) + abort (); +} + at end + +int main (void) { + + if (Subclass.magicNumber != 0) + abort (); + Subclass.magicNumber = 2 /*[Subclass setMagicNumber:2]*/; + if (Subclass.magicNumber != 2) + abort (); + + Subclass.magicNumber += 3; + if (Subclass.magicNumber != 5) + abort (); + Subclass.magicNumber -= 5; + if (Subclass.magicNumber != 0) + abort (); + /* We only have a setter in the following case. */ + Subclass.fakeSetterNumber = 123; + /* We read it using the other getter. */ + if (Subclass.magicNumber != 123) + abort (); + Subclass.fakeSetterNumber = Subclass.magicNumber; + if (Subclass.magicNumber != 123) + abort (); + + /* Test class methods using the new syntax. */ + [Subclass classMeth]; + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-2.m?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-2.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-class-method-2.m Tue Jul 29 18:46:19 2008 @@ -0,0 +1,27 @@ +/* APPLE LOCAL file radar 5277239 */ +/* Test use of class method calls using property dot-syntax used for + property 'getter' and 'setter' messaging. */ +/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-do compile { target *-*-darwin* } } */ + + at interface INTF +- (int) METH; +- (void)setMETH:(int)value; ++ (void) c_method; + at end + + at implementation INTF ++ (void) c_method +{ + int j = self.METH; /* { dg-error "accessing unknown" } */ + self.METH = 2; /* { dg-error "accessing unknown" } */ +} + +- (int) METH { return 1; } +- (void)setMETH:(int)value { } + at end + +int main() { + int i = INTF.METH ; /* { dg-error "accessing unknown" } */ + INTF.METH = 1; /* { dg-error "accessing unknown" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-copy-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-copy-3.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-copy-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-copy-3.m Tue Jul 29 18:46:19 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file radar 4805321 */ /* { dg-options "-fobjc-new-property -mmacosx-version-min=10.5" } */ /* { dg-do compile { target *-*-darwin* } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m Tue Jul 29 18:46:19 2008 @@ -9,9 +9,10 @@ @end @implementation Moe - at synthesize ivar; + at synthesize ivar; /* { dg-error "synthesized property 'ivar' must either be named the same as a compatible ivar or must explicitly name an ivar" } */ + - (void)setIvar:(int)arg{} - at end /* { dg-error "synthesized property 'ivar' must either be named the same as a compatible ivar or must explicitly name an ivar" } */ + at end @interface Fred @property int ivar; Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-setter-name.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-setter-name.m?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-setter-name.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/newproperty-setter-name.m Tue Jul 29 18:46:19 2008 @@ -0,0 +1,21 @@ +/* APPLE LOCAL file radar 5338634 */ +/* Check that no error is issued when setter name is the prefix for property name. */ +/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-do run { target *-*-darwin* } } */ + + at interface Foo +{ + int intSetter; +} + at property(setter=intSet:) int intSetter; + at end + + at implementation Foo + at synthesize intSetter; + at end + +int main() +{ + return 0; +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1-64bit.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1-64bit.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1-64bit.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1-64bit.m Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file 4492976 */ /* Test that the correct version number (7) is set in the module descriptor when compiling for the NeXT runtime. */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fnext-runtime -m64 -fobjc-abi-version=1" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ when compiling for the NeXT runtime. */ /* Author: Ziemowit Laski */ -/* { dg-do compile { target *-*-darwin* } } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fnext-runtime" } */ /* APPLE LOCAL 64-bit 4492976 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-bycopy-return-warn-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-bycopy-return-warn-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-bycopy-return-warn-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-bycopy-return-warn-1.m Tue Jul 29 18:46:19 2008 @@ -2,6 +2,7 @@ /* Check that an instance method with 'bycopy' return type issues a warning when the object it is returning does not conform to NSCoding protocol. */ /* { dg-do compile { target *-*-darwin* } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #include @interface MyClass : NSObject Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-assign-ivar-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-assign-ivar-2.m?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-assign-ivar-2.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-assign-ivar-2.m Tue Jul 29 18:46:19 2008 @@ -0,0 +1,17 @@ +/* APPLE LOCAL file 5675908 */ +/* A write barrier should not be generated if garbage collection is + disabled. */ +/* { dg-do compile } */ +/* { dg-options "-fno-objc-gc -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-fno-objc-gc" { target arm*-*-darwin* } } */ + at interface Foo +{ + id x; +} + at property(assign) id x; + at end + + at implementation Foo + at synthesize x; + at end +/* { dg-final { scan-assembler-not "objc_assign_ivar" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m Tue Jul 29 18:46:19 2008 @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ @interface INTF @end Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file radar 5142207 */ /* Test for visibility 'hidden' flag inserted in 32bit objc class's meta-data. */ -/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5" } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ __attribute__((visibility("hidden"))) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-ivar-offset.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-ivar-offset.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-ivar-offset.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-ivar-offset.m Tue Jul 29 18:46:19 2008 @@ -1,5 +1,6 @@ /* APPLE LOCAL file 5724385 */ /* { dg-options "-std=c99 -mmacosx-version-min=10.5 -m64 -lobjc" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-std=c99 -lobjc" { target arm*-*-darwin* } } */ /* { dg-do run { target *-*-darwin* } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-no-category-name.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-no-category-name.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-no-category-name.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-no-category-name.m Tue Jul 29 18:46:19 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 5774213 */ /* We must not generate global symbol for category names in the ObjC2 ABI. */ -/* { dg-options "-mmacosx-version-min=10.5 -m64" } */ +/* { dg-options "-mmacosx-version-min=10.5 -m64" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @interface Foo Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2.c?rev=54182&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2.c Tue Jul 29 18:46:19 2008 @@ -0,0 +1,9 @@ +/* APPLE LOCAL file 5726269 */ +/* Verify that __OBJC2__ is not defined on arm when compiling a C file. */ +/* { dg-do compile { target arm*-*-darwin* } } */ + +#ifdef __OBJC2__ +error __OBJC2__ +#else +int i = 3; +#endif Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/optional-property.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/optional-property.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/optional-property.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/optional-property.m Tue Jul 29 18:46:19 2008 @@ -3,6 +3,8 @@ setter/getters. Program should compile and run with no errors. */ /* { dg-options "-mmacosx-version-min=10.5 -framework Foundation" } */ /* { dg-do run { target *-*-darwin* } } */ +/* APPLE LOCAL ARM not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #import Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-4.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-4.m Tue Jul 29 18:46:19 2008 @@ -3,7 +3,8 @@ /* Program should compile with no error or warning. */ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4899595 */ -/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ #import @interface NSWindow (Properties) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/pubtypes-id-test.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/pubtypes-id-test.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/pubtypes-id-test.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/pubtypes-id-test.m Tue Jul 29 18:46:19 2008 @@ -6,6 +6,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-O0 -g -c -save-temps -dA --no-warn" } */ /* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */ +/* APPLE LOCAL ARM AppKit not available on darwin-arm */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* { dg-final { scan-assembler "__debug_pubtypes" } } */ /* { dg-final { scan-assembler "long\[ \t]+0x\[0-9a-f]+\[ \t]+\[#;]\[ \t]+Length of Public Type Names Info" } } */ /* { dg-final { scan-assembler "id\\\\0\"\[ \t]+\[#;]\[ \t]+external name" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m Tue Jul 29 18:46:19 2008 @@ -44,9 +44,12 @@ return [foo_obj stret]; } +/* APPLE LOCAL begin ARM hybrid ABI */ /* { dg-final { scan-assembler "objc_msgSend_stret" } } */ -/* { dg-final { scan-assembler "objc_msgSendSuper_stret" } } */ +/* { dg-final { scan-assembler "objc_msgSendSuper2_stret" { target arm*-*-darwin* } } } */ +/* { dg-final { scan-assembler "objc_msgSendSuper_stret" { target { ! arm*-*-darwin* } } } } */ -/* { dg-final { scan-assembler-not "objc_msgSend\[^_S\]" } } */ -/* { dg-final { scan-assembler-not "objc_msgSendSuper\[^_\]" } } */ +/* { dg-final { scan-assembler-not "objc_msgSend\[^_S\]" { target { ! arm*-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not "objc_msgSendSuper\[^_\]" { target { ! arm*-*-darwin* } } } } */ +/* APPLE LOCAL end ARM hybrid ABI */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1-64bit.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1-64bit.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1-64bit.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1-64bit.m Tue Jul 29 18:46:19 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file 4492976 */ /* Check if the objc_symtab descriptor is being laid out correctly. */ /* { dg-options "-fnext-runtime -m64 -fobjc-abi-version=1" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m Tue Jul 29 18:46:19 2008 @@ -4,6 +4,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4492976 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL ARM not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m Tue Jul 29 18:46:19 2008 @@ -2,7 +2,8 @@ /* Any exception usage should generate a warning when -mmacosx-version-min < 10.3 (since use of the feature depends on 10.3 specific API's) */ /* { dg-options "-mmacosx-version-min=10.2" } */ -/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* APPLE LOCAL radar 5706927 */ +/* { dg-do compile { target powerpc*-*-darwin* } } */ /* APPLE LOCAL begin radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/type-stream-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/type-stream-1.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/type-stream-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/type-stream-1.m Tue Jul 29 18:46:19 2008 @@ -1,5 +1,7 @@ /* { dg-options "-fgnu-runtime" } */ /* { dg-do run } */ +/* APPLE LOCAL ARM not available on arm-darwin targets */ +/* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* LLVM LOCAL */ /* { dg-xfail-if "" { *-*-darwin* } { "*" } { "" } } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m Tue Jul 29 18:46:19 2008 @@ -1,7 +1,8 @@ /* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */ /* Contributed by Ziemowit Laski . */ /* { dg-options "-fnext-runtime -fno-zero-link" } */ -/* { dg-do compile } */ +/* APPLE LOCAL ARM objc2 */ +/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string1.x URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string1.x?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string1.x (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string1.x Tue Jul 29 18:46:19 2008 @@ -1,5 +1,5 @@ # APPLE LOCAL file string workaround 4943900 -if { [istarget "*-*-darwin9*"] } { +if { [istarget "*-*-darwin\[9123\]*"] } { set additional_flags "-framework Foundation -fconstant-cfstrings" } return 0 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string2.x URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string2.x?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string2.x (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string2.x Tue Jul 29 18:46:19 2008 @@ -1,5 +1,5 @@ # APPLE LOCAL file string workaround 4943900 -if { [istarget "*-*-darwin9*"] } { +if { [istarget "*-*-darwin\[9123\]*"] } { set additional_flags "-framework Foundation -fconstant-cfstrings" } return 0 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string3.x URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string3.x?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string3.x (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string3.x Tue Jul 29 18:46:19 2008 @@ -1,5 +1,5 @@ # APPLE LOCAL file string workaround 4943900 -if { [istarget "*-*-darwin9*"] } { +if { [istarget "*-*-darwin\[9123\]*"] } { set additional_flags "-framework Foundation -fconstant-cfstrings" } return 0 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string4.x URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string4.x?rev=54182&r1=54181&r2=54182&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string4.x (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc/execute/string4.x Tue Jul 29 18:46:19 2008 @@ -1,5 +1,5 @@ # APPLE LOCAL file string workaround 4943900 -if { [istarget "*-*-darwin9*"] } { +if { [istarget "*-*-darwin\[9123\]*"] } { set additional_flags "-framework Foundation -fconstant-cfstrings" } return 0 From isanbard at gmail.com Tue Jul 29 17:54:46 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 22:54:46 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54178 - in /llvm-gcc-4.2/trunk/gcc: config/arm/arm.md config/arm/cirrus.md config/arm/constraints.md config/arm/predicates.md config/i386/i386.md config/i386/sse.md testsuite/g++.dg/ext/interface4.h Message-ID: <200807292254.m6TMskKj012475@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 17:54:46 2008 New Revision: 54178 URL: http://llvm.org/viewvc/llvm-project?rev=54178&view=rev Log: Merge .md files from Apple GCC's 4.2 branch. Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.md llvm-gcc-4.2/trunk/gcc/config/arm/cirrus.md llvm-gcc-4.2/trunk/gcc/config/arm/constraints.md llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md llvm-gcc-4.2/trunk/gcc/config/i386/i386.md llvm-gcc-4.2/trunk/gcc/config/i386/sse.md Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.md Tue Jul 29 17:54:46 2008 @@ -95,6 +95,8 @@ ; instruction stream. ; APPLE LOCAL ARM setjmp/longjmp interworking (UNSPEC_JMP_XCHG 22) ; Indirect jump with possible change in ARM/Thumb state. + ; APPLE LOCAL ARM UXTB support + (UNSPEC_UXTB16 27) ; The UXTB16 instruction (ARM only) ] ) @@ -127,6 +129,10 @@ (VUNSPEC_WCMP_GT 13) ; Used by the iwMMXT WCMPGT instructions (VUNSPEC_EH_RETURN 20); Use to override the return address for exception ; handling. + ; APPLE LOCAL begin ARM strings in code + (VUNSPEC_POOL_STRING 21) ; `pool-entry(string)'. An entry in the constant + ; pool for a string. + ; APPLE LOCAL end ARM strings in code ] ) @@ -352,11 +358,12 @@ ;; Cirrus 64bit additions should not be split because we have a native ;; 64bit addition instructions. +;; APPLE LOCAL begin 5831562 long long constants (define_expand "adddi3" [(parallel [(set (match_operand:DI 0 "s_register_operand" "") (plus:DI (match_operand:DI 1 "s_register_operand" "") - (match_operand:DI 2 "s_register_operand" ""))) + (match_operand:DI 2 "arm_add64_operand" ""))) (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " @@ -377,8 +384,19 @@ if (GET_CODE (operands[2]) != REG) operands[2] = force_reg (SImode, operands[2]); } + + if (TARGET_ARM + && (GET_CODE (operands[2]) == CONST_INT + || GET_CODE (operands[2]) == CONST_DOUBLE) + && !const64_ok_for_arm_immediate (operands[2])) + { + emit_insn (gen_subdi3 (operands[0], operands[1], + negate_rtx (DImode, operands[2]))); + DONE; + } " ) +;; APPLE LOCAL end 5831562 long long constants (define_insn "*thumb_adddi3" [(set (match_operand:DI 0 "register_operand" "=l") @@ -391,10 +409,11 @@ [(set_attr "length" "4")] ) +;; APPLE LOCAL begin 5831562 long long constants (define_insn_and_split "*arm_adddi3" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") - (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0") - (match_operand:DI 2 "s_register_operand" "r, 0"))) + [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r") + (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0, r, 0") + (match_operand:DI 2 "arm_rhs64_operand" "r, 0, Dd,Dd"))) (clobber (reg:CC CC_REGNUM))] "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" @@ -411,12 +430,13 @@ operands[0] = gen_lowpart (SImode, operands[0]); operands[4] = gen_highpart (SImode, operands[1]); operands[1] = gen_lowpart (SImode, operands[1]); - operands[5] = gen_highpart (SImode, operands[2]); + operands[5] = gen_highpart_mode (SImode, DImode, operands[2]); operands[2] = gen_lowpart (SImode, operands[2]); }" [(set_attr "conds" "clob") (set_attr "length" "8")] ) +;; APPLE LOCAL end 5831562 long long constants (define_insn_and_split "*adddi_sesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") @@ -573,6 +593,22 @@ "" ) +;; APPLE LOCAL begin ARM peephole +;; And sometimes greg will generate the same thing this way... + +(define_peephole2 + [(set (match_operand:SI 0 "arm_general_register_operand" "") + (reg:SI SP_REGNUM)) + (set (match_dup 0) + (plus:SI (match_dup 0) (match_operand:SI 1 "const_int_operand" "")))] + "TARGET_THUMB + && (unsigned HOST_WIDE_INT) (INTVAL (operands[1])) < 1024 + && (INTVAL (operands[1]) & 3) == 0" + [(set (match_dup 0) (plus:SI (reg:SI SP_REGNUM) (match_dup 1)))] + "" +) +;; APPLE LOCAL end ARM peephole + (define_insn "*addsi3_compare0" [(set (reg:CC_NOOV CC_REGNUM) (compare:CC_NOOV @@ -830,11 +866,12 @@ operands[2] = force_reg (DFmode, operands[2]); ") +;; APPLE LOCAL begin 5831562 long long constants (define_expand "subdi3" [(parallel [(set (match_operand:DI 0 "s_register_operand" "") (minus:DI (match_operand:DI 1 "s_register_operand" "") - (match_operand:DI 2 "s_register_operand" ""))) + (match_operand:DI 2 "arm_add64_operand" ""))) (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " @@ -854,19 +891,38 @@ if (GET_CODE (operands[2]) != REG) operands[2] = force_reg (SImode, operands[2]); } - " + + if (TARGET_ARM + && (GET_CODE (operands[2]) == CONST_INT + || GET_CODE (operands[2]) == CONST_DOUBLE) + && !const64_ok_for_arm_immediate (operands[2])) + { + emit_insn (gen_adddi3 (operands[0], operands[1], + negate_rtx (DImode, operands[2]))); + DONE; + } + " ) (define_insn "*arm_subdi3" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r") - (minus:DI (match_operand:DI 1 "s_register_operand" "0,r,0") - (match_operand:DI 2 "s_register_operand" "r,0,0"))) + [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r,&r") + (minus:DI (match_operand:DI 1 "s_register_operand" "0, r, 0, r ,0") + (match_operand:DI 2 "arm_rhs64_operand" "r, 0, 0,Dd,Dd"))) (clobber (reg:CC CC_REGNUM))] "TARGET_ARM" - "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2" + "* + if (which_alternative <= 2) + return \"subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2\"; + else + { + operands[3] = gen_lowpart (SImode, operands[2]); + operands[2] = gen_highpart_mode (SImode, DImode, operands[2]); + return \"subs\\t%Q0, %Q1, %3\;sbc\\t%R0, %R1, %2\"; + }" [(set_attr "conds" "clob") (set_attr "length" "8")] ) +;; APPLE LOCAL end 5831562 long long constants (define_insn "*thumb_subdi3" [(set (match_operand:DI 0 "register_operand" "=l") @@ -1336,6 +1392,57 @@ [(set_attr "insn" "smlalxy") (set_attr "predicable" "yes")]) +;; APPLE LOCAL begin DImode multiply enhancement +;; No DI * DI instruction exists (except on Cirrus), but leave this in +;; the RTL stream through the early optimization phases +;; to give them a chance to generate the mulsidi3, etc., patterns. + +(define_expand "muldi3" + [(parallel + [(set (match_operand:DI 0 "s_register_operand" "") + (mult:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:DI 2 "s_register_operand" ""))) + (clobber (match_scratch:SI 3 "")) + (clobber (match_scratch:SI 4 ""))])] + "TARGET_ARM" + " + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) + { + if (!cirrus_fp_register (operands[0], DImode)) + operands[0] = force_reg (DImode, operands[0]); + if (!cirrus_fp_register (operands[1], DImode)) + operands[1] = force_reg (DImode, operands[1]); + emit_insn (gen_cirrus_muldi3 (operands[0], operands[1], operands[2])); + DONE; + } + " +) + +; Input and output registers cannot overlap in this pattern. + +(define_insn_and_split "*soft_muldi3" + [(set (match_operand:DI 0 "s_register_operand" "=&r") + (mult:DI (match_operand:DI 1 "s_register_operand" "%0") + (match_operand:DI 2 "s_register_operand" "r"))) + (clobber (match_scratch:SI 3 "=&r")) + (clobber (match_scratch:SI 4 "=&r"))] + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" + "" + "&& reload_completed" + [(set (match_dup 3) (subreg:SI (match_dup 1) 0)) + (set (match_dup 4) (subreg:SI (match_dup 1) 4)) + (set (match_dup 0) (mult:DI (zero_extend:DI (match_dup 3)) + (zero_extend:DI (subreg:SI (match_dup 2) 0)))) + (set (subreg:SI (match_dup 0) 4) (plus:SI + (mult:SI (match_dup 4) (subreg:SI (match_dup 2) 0)) + (subreg:SI (match_dup 0) 4))) + (set (subreg:SI (match_dup 0) 4) (plus:SI + (mult:SI (match_dup 3) (subreg:SI (match_dup 2) 4)) + (subreg:SI (match_dup 0) 4)))] + "" +) +;; APPLE LOCAL end DImode multiply enhancement + (define_expand "mulsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mult:SF (match_operand:SF 1 "s_register_operand" "") @@ -1394,13 +1501,14 @@ ;; Split up double word logical operations +;; APPLE LOCAL begin 5831562 long long constants ;; Split up simple DImode logical operations. Simply perform the logical ;; operation on the upper and lower halves of the registers. (define_split [(set (match_operand:DI 0 "s_register_operand" "") (match_operator:DI 6 "logical_binary_operator" [(match_operand:DI 1 "s_register_operand" "") - (match_operand:DI 2 "s_register_operand" "")]))] + (match_operand:DI 2 "arm_rhs64_operand" "")]))] "TARGET_ARM && reload_completed && ! IS_IWMMXT_REGNUM (REGNO (operands[0]))" [(set (match_dup 0) (match_op_dup:SI 6 [(match_dup 1) (match_dup 2)])) (set (match_dup 3) (match_op_dup:SI 6 [(match_dup 4) (match_dup 5)]))] @@ -1410,10 +1518,11 @@ operands[0] = gen_lowpart (SImode, operands[0]); operands[4] = gen_highpart (SImode, operands[1]); operands[1] = gen_lowpart (SImode, operands[1]); - operands[5] = gen_highpart (SImode, operands[2]); + operands[5] = gen_highpart_mode (SImode, DImode, operands[2]); operands[2] = gen_lowpart (SImode, operands[2]); }" ) +;; APPLE LOCAL end 5831562 long long constants (define_split [(set (match_operand:DI 0 "s_register_operand" "") @@ -1474,14 +1583,17 @@ }" ) +;; APPLE LOCAL begin 5831562 long long constants (define_insn "anddi3" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") - (and:DI (match_operand:DI 1 "s_register_operand" "%0,r") - (match_operand:DI 2 "s_register_operand" "r,r")))] + [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r") + (and:DI (match_operand:DI 1 "s_register_operand" "%0,r, 0, r") + (match_operand:DI 2 "arm_rhs64_operand" "r,r,Dd,Dd")))] "TARGET_ARM && ! TARGET_IWMMXT" "#" - [(set_attr "length" "8")] + [(set_attr "length" "8") + (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end 5831562 long long constants (define_insn_and_split "*anddi_zesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") @@ -1576,28 +1688,19 @@ " ) -(define_insn_and_split "*arm_andsi3_insn" - [(set (match_operand:SI 0 "s_register_operand" "=r,r,r") - (and:SI (match_operand:SI 1 "s_register_operand" "r,r,r") - (match_operand:SI 2 "reg_or_int_operand" "rI,K,?n")))] +;; APPLE LOCAL begin ARM 4673027 suboptimal loop codegen +(define_insn "*arm_andsi3_insn" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (and:SI (match_operand:SI 1 "s_register_operand" "r,r") + (match_operand:SI 2 "arm_not_operand" "rI,K")))] "TARGET_ARM" "@ and%?\\t%0, %1, %2 - bic%?\\t%0, %1, #%B2 - #" - "TARGET_ARM - && GET_CODE (operands[2]) == CONST_INT - && !(const_ok_for_arm (INTVAL (operands[2])) - || const_ok_for_arm (~INTVAL (operands[2])))" - [(clobber (const_int 0))] - " - arm_split_constant (AND, SImode, curr_insn, - INTVAL (operands[2]), operands[0], operands[1], 0); - DONE; - " - [(set_attr "length" "4,4,16") + bic%?\\t%0, %1, #%B2" + [(set_attr "length" "4,4") (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end ARM 4673027 suboptimal loop codegen (define_insn "*thumb_andsi3_insn" [(set (match_operand:SI 0 "register_operand" "=l") @@ -1867,21 +1970,22 @@ ;;; bit-field insert instruction, we would have to emit code here to truncate ;;; the value before we insert. This loses some of the advantage of having ;;; this insv pattern, so this pattern needs to be reevalutated. +;;; APPLE LOCAL begin ARM insv for Thumb (define_expand "insv" [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "") (match_operand:SI 1 "general_operand" "") (match_operand:SI 2 "general_operand" "")) (match_operand:SI 3 "reg_or_int_operand" ""))] - "TARGET_ARM" + "TARGET_EITHER" " { int start_bit = INTVAL (operands[2]); int width = INTVAL (operands[1]); HOST_WIDE_INT mask = (((HOST_WIDE_INT)1) << width) - 1; - rtx target, subtarget; + rtx target, subtarget, orig_target; - target = operands[0]; + target = orig_target = operands[0]; /* Avoid using a subreg as a subtarget, and avoid writing a paradoxical subreg as the final target. */ if (GET_CODE (target) == SUBREG) @@ -1912,7 +2016,8 @@ emit_insn (gen_iorsi3 (subtarget, op1, gen_int_mode (op3_value << start_bit, SImode))); } - else if (start_bit == 0 + else if (TARGET_ARM + && start_bit == 0 && !(const_ok_for_arm (mask) || const_ok_for_arm (~mask))) { @@ -1925,21 +2030,24 @@ rtx op0 = gen_reg_rtx (SImode); rtx op1 = gen_reg_rtx (SImode); - emit_insn (gen_ashlsi3 (op0, operands[3], GEN_INT (32 - width))); + emit_insn (gen_ashlsi3 (op0, operands[3], + gen_int_mode (32 - width, SImode))); emit_insn (gen_lshrsi3 (op1, operands[0], operands[1])); emit_insn (gen_iorsi3 (op1, op1, op0)); emit_insn (gen_rotlsi3 (subtarget, op1, operands[1])); } - else if ((width + start_bit == 32) - && !(const_ok_for_arm (mask) - || const_ok_for_arm (~mask))) + else if (width + start_bit == 32 + && (TARGET_THUMB + || !(const_ok_for_arm (mask) + || const_ok_for_arm (~mask)))) { /* Similar trick, but slightly less efficient. */ rtx op0 = gen_reg_rtx (SImode); rtx op1 = gen_reg_rtx (SImode); - emit_insn (gen_ashlsi3 (op0, operands[3], GEN_INT (32 - width))); + emit_insn (gen_ashlsi3 (op0, operands[3], + gen_int_mode (32 - width, SImode))); emit_insn (gen_ashlsi3 (op1, operands[0], operands[1])); emit_insn (gen_lshrsi3 (op1, op1, operands[1])); emit_insn (gen_iorsi3 (subtarget, op1, op0)); @@ -1950,7 +2058,8 @@ rtx op1 = gen_reg_rtx (SImode); rtx op2 = gen_reg_rtx (SImode); - if (!(const_ok_for_arm (mask) || const_ok_for_arm (~mask))) + if (TARGET_THUMB + || !(const_ok_for_arm (mask) || const_ok_for_arm (~mask))) { rtx tmp = gen_reg_rtx (SImode); @@ -1959,6 +2068,7 @@ } /* Mask out any bits in operand[3] that are not needed. */ + if (!TARGET_THUMB) emit_insn (gen_andsi3 (op1, operands[3], op0)); if (GET_CODE (op0) == CONST_INT @@ -1984,9 +2094,33 @@ emit_insn (gen_andsi_notsi_si (op2, operands[0], op0)); } - if (start_bit != 0) + if (!TARGET_THUMB && start_bit != 0) emit_insn (gen_ashlsi3 (op1, op1, operands[2])); + /* The default code uses AND with constant which is an extra insn on thumb. */ + if (TARGET_THUMB) + { + /* If we only want a low subreg, we don't need to worry about + bits beyond that. */ + if (GET_CODE (orig_target) == SUBREG + && SUBREG_BYTE (orig_target) == 0 + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (orig_target))) + < GET_MODE_SIZE (SImode) + && width + start_bit + >= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (orig_target)))) + emit_insn (gen_ashlsi3 (op1, operands[3], + gen_int_mode (start_bit, SImode))); + else + { + /* Mask unneeded bits in operand[3], and simultaneously move + input to the right place in the word. */ + emit_insn (gen_ashlsi3 (op1, operands[3], + gen_int_mode (32 - width, SImode))); + emit_insn (gen_lshrsi3 (op1, op1, + gen_int_mode (32 - width - start_bit, SImode))); + } + } + emit_insn (gen_iorsi3 (subtarget, op1, op2)); } @@ -2003,6 +2137,7 @@ DONE; }" ) +;;; APPLE LOCAL end ARM insv for Thumb ; constants for op 2 will never be given to these patterns. (define_insn_and_split "*anddi_notdi_di" @@ -2135,15 +2270,17 @@ [(set_attr "conds" "set")] ) +;; APPLE LOCAL begin 5831562 long long constants (define_insn "iordi3" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") - (ior:DI (match_operand:DI 1 "s_register_operand" "%0,r") - (match_operand:DI 2 "s_register_operand" "r,r")))] + [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r") + (ior:DI (match_operand:DI 1 "s_register_operand" "%0,r, 0, r") + (match_operand:DI 2 "arm_rhs64_operand" "r,r,Dd,Dd")))] "TARGET_ARM && ! TARGET_IWMMXT" "#" [(set_attr "length" "8") (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end 5831562 long long constants (define_insn "*iordi_zesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") @@ -2190,26 +2327,17 @@ " ) -(define_insn_and_split "*arm_iorsi3" - [(set (match_operand:SI 0 "s_register_operand" "=r,r") - (ior:SI (match_operand:SI 1 "s_register_operand" "r,r") - (match_operand:SI 2 "reg_or_int_operand" "rI,?n")))] +;; APPLE LOCAL begin ARM 4673027 suboptimal loop codegen +(define_insn "*arm_iorsi3" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (ior:SI (match_operand:SI 1 "s_register_operand" "r") + (match_operand:SI 2 "arm_rhs_operand" "rI")))] "TARGET_ARM" - "@ - orr%?\\t%0, %1, %2 - #" - "TARGET_ARM - && GET_CODE (operands[2]) == CONST_INT - && !const_ok_for_arm (INTVAL (operands[2]))" - [(clobber (const_int 0))] - " - arm_split_constant (IOR, SImode, curr_insn, - INTVAL (operands[2]), operands[0], operands[1], 0); - DONE; - " - [(set_attr "length" "4,16") + "orr%?\\t%0, %1, %2" + [(set_attr "length" "4") (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end ARM 4673027 suboptimal loop codegen (define_insn "*thumb_iorsi3" [(set (match_operand:SI 0 "register_operand" "=l") @@ -2256,15 +2384,17 @@ [(set_attr "conds" "set")] ) +;; APPLE LOCAL begin 5831562 long long constants (define_insn "xordi3" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") - (xor:DI (match_operand:DI 1 "s_register_operand" "%0,r") - (match_operand:DI 2 "s_register_operand" "r,r")))] + [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r") + (xor:DI (match_operand:DI 1 "s_register_operand" "%0,r, 0, r") + (match_operand:DI 2 "arm_rhs64_operand" "r,r,Dd,Dd")))] "TARGET_ARM && !TARGET_IWMMXT" "#" [(set_attr "length" "8") (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end 5831562 long long constants (define_insn "*xordi_zesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") @@ -3335,7 +3465,8 @@ }" ) -(define_insn "*thumb_zero_extendhisi2" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "=l") (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] "TARGET_THUMB && !arm_arch6" @@ -3377,7 +3508,8 @@ (set_attr "pool_range" "60")] ) -(define_insn "*thumb_zero_extendhisi2_v6" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_zero_extendhisi2_v6" [(set (match_operand:SI 0 "register_operand" "=l,l") (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))] "TARGET_THUMB && arm_arch6" @@ -3694,7 +3826,8 @@ ;; we try to verify the operands. Fortunately, we don't really need ;; the early-clobber: we can always use operand 0 if operand 2 ;; overlaps the address. -(define_insn "*thumb_extendhisi2_insn_v6" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_extendhisi2_insn_v6" [(set (match_operand:SI 0 "register_operand" "=l,l") (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m"))) (clobber (match_scratch:SI 2 "=X,l"))] @@ -3925,7 +4058,8 @@ (set_attr "predicable" "yes")] ) -(define_insn "*thumb_extendqisi2" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_extendqisi2" [(set (match_operand:SI 0 "register_operand" "=l,l") (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))] "TARGET_THUMB && !arm_arch6" @@ -4003,7 +4137,8 @@ (set_attr "pool_range" "32,32")] ) -(define_insn "*thumb_extendqisi2_v6" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_extendqisi2_v6" [(set (match_operand:SI 0 "register_operand" "=l,l,l") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,V,m")))] "TARGET_THUMB && arm_arch6" @@ -4218,12 +4353,14 @@ ; offsets in a LDR which means we get better chances of sharing the pool ; entries. Finally, we can normally do a better job of scheduling ; LDR instructions than we can with LDM. -; This pattern will only match if the one above did not. +;; APPLE LOCAL begin ARM split 64-bit constants on Thumb +; On ARM, This pattern will only match if the one above did not. +; On Thumb, use this form always; don't try to do inline expansions. (define_split [(set (match_operand:ANY64 0 "arm_general_register_operand" "") (match_operand:ANY64 1 "const_double_operand" ""))] - "TARGET_ARM && reload_completed - && arm_const_double_by_parts (operands[1])" + "TARGET_EITHER && reload_completed + && (TARGET_THUMB || arm_const_double_by_parts (operands[1]))" [(set (match_dup 0) (match_dup 1)) (set (match_dup 2) (match_dup 3))] " @@ -4234,6 +4371,7 @@ operands[1] = gen_lowpart (SImode, operands[1]); " ) +;; APPLE LOCAL end ARM split 64-bit constants on Thumb (define_split [(set (match_operand:ANY64 0 "arm_general_register_operand" "") @@ -4281,11 +4419,12 @@ " ) +;; APPLE LOCAL begin compact switch tables ;;; ??? This should have alternatives for constants. ;;; ??? This was originally identical to the movdf_insn pattern. ;;; ??? The 'i' constraint looks funny, but it should always be replaced by ;;; thumb_reorg with a memory reference. -(define_insn "*thumb_movdi_insn" +(define_insn "adjustable_thumb_movdi_insn" [(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r") (match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))] "TARGET_THUMB @@ -4323,10 +4462,11 @@ return \"mov\\t%H0, %H1\;mov\\t%0, %1\"; } }" - [(set_attr "length" "4,4,6,2,2,6,4,4") + [(set_attr "length" "4,4,6,2,2,4,4,4") (set_attr "type" "*,*,*,load2,store2,load2,store2,*") - (set_attr "pool_range" "*,*,*,*,*,1020,*,*")] + (set_attr "pool_range" "*,*,*,*,*,1018,*,*")] ) +;; APPLE LOCAL end compact switch tables (define_expand "movsi" [(set (match_operand:SI 0 "general_operand" "") @@ -4506,7 +4646,7 @@ "TARGET_THUMB && (flag_pic || (TARGET_MACHO && MACHO_DYNAMIC_NO_PIC_P))" "ldr\\t%0, %1" [(set_attr "type" "load1") - (set (attr "pool_range") (const_int 1024)) + (set (attr "pool_range") (const_int 1022)) (set_attr "length" "2")] ) ;; APPLE LOCAL end ARM pic support @@ -4520,6 +4660,7 @@ "operands[2] = cfun->machine->pic_reg;" ) +;; APPLE LOCAL begin ARM compact switch tables (define_insn "*pic_load_addr_based_insn" [(set (match_operand:SI 0 "s_register_operand" "=r") (unspec:SI [(match_operand 1 "" "") @@ -4536,13 +4677,18 @@ [(set_attr "type" "load1") (set (attr "pool_range") (if_then_else (eq_attr "is_thumb" "yes") - (const_int 1024) + (const_int 1020) (const_int 4096))) (set (attr "neg_pool_range") (if_then_else (eq_attr "is_thumb" "yes") (const_int 0) - (const_int 4084)))] + (const_int 4084))) + (set (attr "length") + (if_then_else (eq_attr "is_thumb" "yes") + (const_int 2) + (const_int 4)))] ) +;; APPLE LOCAL end ARM compact switch tables ;; APPLE LOCAL begin ARM pic support (define_insn "pic_add_dot_plus_four" @@ -4611,6 +4757,42 @@ "" ) +;; APPLE LOCAL begin ARM 4224487 +;; These short forms work for addresses of scalar globals. They +;; are produced by combine. There is no Thumb counterpart, as +;; [Rn+PC] is not a valid addressing mode on Thumb. + +(define_insn "*arm_pic_ldrsi" + [(set (match_operand:SI 0 "register_operand" "=r") + (mem:SI (unspec:SI [(label_ref (match_operand 1 "" "")) + (plus:SI (match_operand:SI 2 "register_operand" "r") + (const (plus:SI (pc) (const_int 8))))] + UNSPEC_PIC_BASE)))] + "TARGET_ARM && (flag_pic || (TARGET_MACHO && MACHO_DYNAMIC_NO_PIC_P))" + "* + (*targetm.asm_out.internal_label) (asm_out_file, \"L\", + CODE_LABEL_NUMBER (operands[1])); + return \"ldr%?\\t%0, [%|pc, %2]\"; + " + [(set_attr "predicable" "yes")] +) + +(define_insn "*arm_pic_strsi" + [(set (mem:SI (unspec:SI [(label_ref (match_operand 1 "" "")) + (plus:SI (match_operand:SI 2 "register_operand" "r") + (const (plus:SI (pc) (const_int 8))))] + UNSPEC_PIC_BASE)) + (match_operand:SI 0 "register_operand" "r"))] + "TARGET_ARM && (flag_pic || (TARGET_MACHO && MACHO_DYNAMIC_NO_PIC_P))" + "* + (*targetm.asm_out.internal_label) (asm_out_file, \"L\", + CODE_LABEL_NUMBER (operands[1])); + return \"str%?\\t%0, [%|pc, %2]\"; + " + [(set_attr "predicable" "yes")] +) +;; APPLE LOCAL end ARM 4224487 + ;; APPLE LOCAL begin ARM setjmp/longjmp interworking ;; If we'll be returning to thumb code, we need to set the low-order ;; bit of the resume address. builtin_setjmp_setup doesn't handle all @@ -4979,7 +5161,8 @@ " ) -(define_insn "*thumb_movhi_insn" +;; APPLE LOCAL ARM compact switch tables +(define_insn "adjustable_thumb_movhi_insn" [(set (match_operand:HI 0 "nonimmediate_operand" "=l,l,m,*r,*h,l") (match_operand:HI 1 "general_operand" "l,m,l,*h,*r,I"))] "TARGET_THUMB @@ -5409,6 +5592,7 @@ (set_attr "neg_pool_range" "1008")] ) +;; APPLE LOCAL begin ARM compact switch tables ;;; ??? This should have alternatives for constants. ;;; ??? This was originally identical to the movdi_insn pattern. ;;; ??? The 'F' constraint looks funny, but it should always be replaced by @@ -5444,10 +5628,11 @@ return \"mov\\t%H0, %H1\;mov\\t%0, %1\"; } " - [(set_attr "length" "4,2,2,6,4,4") + [(set_attr "length" "4,2,2,4,4,4") (set_attr "type" "*,load2,store2,load2,store2,*") - (set_attr "pool_range" "*,*,*,1020,*,*")] + (set_attr "pool_range" "*,*,*,1018,*,*")] ) +;; APPLE LOCAL end ARM compact switch tables (define_expand "movxf" [(set (match_operand:XF 0 "general_operand" "") @@ -5531,6 +5716,7 @@ (set_attr "predicable" "yes")] ) +;; APPLE LOCAL begin ARM compact switch tables (define_insn "*ldmsi_postinc4_thumb" [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 1 "s_register_operand" "=l") @@ -5546,8 +5732,10 @@ (mem:SI (plus:SI (match_dup 2) (const_int 12))))])] "TARGET_THUMB && XVECLEN (operands[0], 0) == 5" "ldmia\\t%1!, {%3, %4, %5, %6}" - [(set_attr "type" "load4")] + [(set_attr "type" "load4") + (set_attr "length" "2")] ) +;; APPLE LOCAL end ARM compact switch tables (define_insn "*ldmsi_postinc3" [(match_parallel 0 "load_multiple_operation" @@ -5670,6 +5858,7 @@ (set_attr "type" "store4")] ) +;; APPLE LOCAL begin ARM compact switch tables (define_insn "*stmsi_postinc4_thumb" [(match_parallel 0 "store_multiple_operation" [(set (match_operand:SI 1 "s_register_operand" "=l") @@ -5685,8 +5874,10 @@ (match_operand:SI 6 "arm_hard_register_operand" ""))])] "TARGET_THUMB && XVECLEN (operands[0], 0) == 5" "stmia\\t%1!, {%3, %4, %5, %6}" - [(set_attr "type" "store4")] + [(set_attr "type" "store4") + (set_attr "length" "2")] ) +;; APPLE LOCAL end ARM compact switch tables (define_insn "*stmsi_postinc3" [(match_parallel 0 "store_multiple_operation" @@ -5787,6 +5978,17 @@ || INTVAL (operands[2]) > 48) FAIL; + /* APPLE LOCAL begin ARM use memcpy more at -Os */ + if (optimize_size + && INTVAL (operands[2]) != 1 + && INTVAL (operands[2]) != 2 + && INTVAL (operands[2]) != 4 + && INTVAL (operands[2]) != 8 + && INTVAL (operands[2]) != 12 + && INTVAL (operands[2]) != 16) + FAIL; + /* APPLE LOCAL end ARM use memcpy more at -Os */ + thumb_expand_movmemqi (operands); DONE; } @@ -6013,6 +6215,32 @@ (const_int 10)))))] ) +;; APPLE LOCAL begin ARM add this peephole +;; The above pattern is produced by combine in some cases, but not +;; when one of the regs involved is hard, e.g. a function return value. +;; This peephole catches that case. Valid only for low regs. + +(define_peephole2 + [(set (match_operand:SI 0 "thumb_low_register_operand" "") + (match_operand:SI 1 "thumb_low_register_operand" "")) + (set (pc) (if_then_else + (match_operator 2 "arm_comparison_operator" + [(match_dup 0) (const_int 0)]) + (label_ref (match_operand 3 "" "")) + (pc)))] + "TARGET_THUMB" + [(parallel + [(set (pc) + (if_then_else + (match_op_dup 2 + [(match_dup 1) (const_int 0)]) + (label_ref (match_dup 3 )) + (pc))) + (set (match_dup 0) (match_dup 1))])] + "" +) +;; APPLE LOCAL end ARM add this peephole + (define_insn "*negated_cbranchsi4" [(set (pc) (if_then_else @@ -6998,6 +7226,7 @@ " ) +;; APPLE LOCAL begin ARM enhance conditional insn generation (define_insn "*arm_cmpsi_insn" [(set (reg:CC CC_REGNUM) (compare:CC (match_operand:SI 0 "s_register_operand" "r,r") @@ -7006,8 +7235,10 @@ "@ cmp%?\\t%0, %1 cmn%?\\t%0, #%n1" - [(set_attr "conds" "set")] + [(set_attr "conds" "set") + (set_attr "predicable" "yes")] ) +;; APPLE LOCAL end ARM enhance conditional insn generation (define_insn "*cmpsi_shiftsi" [(set (reg:CC CC_REGNUM) @@ -7715,16 +7946,16 @@ rtx callee; /* APPLE LOCAL begin ARM dynamic */ -#if TARGET_MACHO - if (MACHOPIC_INDIRECT) - operands[0] = machopic_indirect_call_target (operands[0]); -#endif - /* APPLE LOCAL end ARM dynamic */ - /* In an untyped call, we can get NULL for operand 2. */ if (operands[2] == NULL_RTX) operands[2] = const0_rtx; +#if TARGET_MACHO + if (MACHOPIC_INDIRECT + && !arm_is_longcall_p (operands[0], INTVAL (operands[2]), 0)) + operands[0] = machopic_indirect_call_target (operands[0]); +#endif + /* This is to decide if we should generate indirect calls by loading the 32 bit address of the callee into a register before performing the branch and link. operand[2] encodes the long_call/short_call @@ -7736,6 +7967,7 @@ parameter to arm_is_longcall_p is used to tell it which pattern invoked it. */ callee = XEXP (operands[0], 0); + /* APPLE LOCAL end ARM dynamic */ if ((GET_CODE (callee) == SYMBOL_REF && arm_is_longcall_p (operands[0], INTVAL (operands[2]), 0)) @@ -7745,6 +7977,7 @@ }" ) +;; APPLE LOCAL begin 5831528 make calls predicable (define_insn "*call_reg_armv5" [(call (mem:SI (match_operand:SI 0 "s_register_operand" "r")) (match_operand 1 "" "")) @@ -7752,7 +7985,8 @@ (clobber (reg:SI LR_REGNUM))] "TARGET_ARM && arm_arch5" "blx%?\\t%0" - [(set_attr "type" "call")] + [(set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_reg_arm" @@ -7766,7 +8000,8 @@ " ;; length is worst case, normally it is only two [(set_attr "length" "12") - (set_attr "type" "call")] + (set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_mem" @@ -7779,7 +8014,8 @@ return output_call_mem (operands); " [(set_attr "length" "12") - (set_attr "type" "call")] + (set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_reg_thumb_v5" @@ -7825,18 +8061,19 @@ /* APPLE LOCAL begin ARM dynamic */ rtx callee; + /* In an untyped call, we can get NULL for operand 2. */ + if (operands[3] == 0) + operands[3] = const0_rtx; + #if TARGET_MACHO - if (MACHOPIC_INDIRECT) + if (MACHOPIC_INDIRECT + && !arm_is_longcall_p (operands[1], INTVAL (operands[3]), 0)) operands[1] = machopic_indirect_call_target (operands[1]); #endif callee = XEXP (operands[1], 0); /* APPLE LOCAL end ARM dynamic */ - /* In an untyped call, we can get NULL for operand 2. */ - if (operands[3] == 0) - operands[3] = const0_rtx; - /* See the comment in define_expand \"call\". */ if ((GET_CODE (callee) == SYMBOL_REF && arm_is_longcall_p (operands[1], INTVAL (operands[3]), 0)) @@ -7854,7 +8091,8 @@ (clobber (reg:SI LR_REGNUM))] "TARGET_ARM && arm_arch5" "blx%?\\t%1" - [(set_attr "type" "call")] + [(set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_value_reg_arm" @@ -7868,7 +8106,8 @@ return output_call (&operands[1]); " [(set_attr "length" "12") - (set_attr "type" "call")] + (set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_value_mem" @@ -7882,7 +8121,8 @@ return output_call_mem (&operands[1]); " [(set_attr "length" "12") - (set_attr "type" "call")] + (set_attr "type" "call") + (set_attr "predicable" "yes")] ) (define_insn "*call_value_reg_thumb_v5" @@ -7927,12 +8167,30 @@ ;; of questionnable value, as these patterns are not generally used ;; for dynamic code anyway (see rdar://4514281 for an example of what it ;; takes to get here). -(define_insn "*call_symbol" +(define_insn "*call_symbol_predicable" [(call (mem:SI (match_operand:SI 0 "arm_branch_target" "")) (match_operand 1 "" "")) (use (match_operand 2 "" "")) (clobber (reg:SI LR_REGNUM))] "TARGET_ARM + && !TARGET_INTERWORK + && (GET_CODE (operands[0]) == SYMBOL_REF) + && !arm_is_longcall_p (operands[0], INTVAL (operands[2]), 1)" + "* + { + return NEED_PLT_RELOC ? \"bl%?\\t%a0(PLT)\" : \"bl%?\\t%a0\"; + }" + [(set_attr "type" "call") + (set_attr "predicable" "yes")] +) + +(define_insn "*call_symbol" + [(call (mem:SI (match_operand:SI 0 "arm_branch_target" "")) + (match_operand 1 "" "")) + (use (match_operand 2 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_ARM + && TARGET_INTERWORK && (GET_CODE (operands[0]) == SYMBOL_REF) && !arm_is_longcall_p (operands[0], INTVAL (operands[2]), 1)" "* @@ -7942,13 +8200,32 @@ [(set_attr "type" "call")] ) -(define_insn "*call_value_symbol" +(define_insn "*call_value_symbol_predicable" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:SI 1 "arm_branch_target" "")) (match_operand:SI 2 "" ""))) (use (match_operand 3 "" "")) (clobber (reg:SI LR_REGNUM))] "TARGET_ARM + && !TARGET_INTERWORK + && (GET_CODE (operands[1]) == SYMBOL_REF) + && !arm_is_longcall_p (operands[1], INTVAL (operands[3]), 1)" + "* + { + return NEED_PLT_RELOC ? \"bl%?\\t%a1(PLT)\" : \"bl%?\\t%a1\"; + }" + [(set_attr "type" "call") + (set_attr "predicable" "yes")] +) + +(define_insn "*call_value_symbol" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:SI 1 "arm_branch_target" "")) + (match_operand:SI 2 "" ""))) + (use (match_operand 3 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_ARM + && TARGET_INTERWORK && (GET_CODE (operands[1]) == SYMBOL_REF) && !arm_is_longcall_p (operands[1], INTVAL (operands[3]), 1)" "* @@ -7957,6 +8234,7 @@ }" [(set_attr "type" "call")] ) +;; APPLE LOCAL end 5831528 make calls predicable ;; APPLE LOCAL end ARM pic support ;; APPLE LOCAL begin ARM dynamic @@ -8046,30 +8324,38 @@ }" ) +;; APPLE LOCAL begin ARM indirect sibcalls (define_insn "*sibcall_insn" - [(call (mem:SI (match_operand:SI 0 "" "X")) - (match_operand 1 "" "")) + [(call (mem:SI (match_operand:SI 0 "arm_branch_target" "X")) + (match_operand 1 "" "")) (return) (use (match_operand 2 "" ""))] - "TARGET_ARM && GET_CODE (operands[0]) == SYMBOL_REF" + "TARGET_ARM && (GET_CODE (operands[0]) == SYMBOL_REF || GET_CODE (operands[0]) == REG)" "* - return NEED_PLT_RELOC ? \"b%?\\t%a0(PLT)\" : \"b%?\\t%a0\"; + if (GET_CODE (operands[0]) == REG) + return \"bx%?\\t%0\"; + else + return NEED_PLT_RELOC ? \"b%?\\t%a0(PLT)\" : \"b%?\\t%a0\"; " [(set_attr "type" "call")] ) (define_insn "*sibcall_value_insn" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "" "X")) - (match_operand 2 "" ""))) + (call (mem:SI (match_operand:SI 1 "arm_branch_target" "X")) + (match_operand 2 "" ""))) (return) (use (match_operand 3 "" ""))] - "TARGET_ARM && GET_CODE (operands[1]) == SYMBOL_REF" + "TARGET_ARM && (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == REG)" "* - return NEED_PLT_RELOC ? \"b%?\\t%a1(PLT)\" : \"b%?\\t%a1\"; + if (GET_CODE (operands[1]) == REG) + return \"bx%?\\t%1\"; + else + return NEED_PLT_RELOC ? \"b%?\\t%a1(PLT)\" : \"b%?\\t%a1\"; " [(set_attr "type" "call")] ) +;; APPLE LOCAL end ARM indirect sibcalls ;; Often the return insn will be the same as loading from memory, so set attr (define_insn "return" @@ -8296,7 +8582,8 @@ (match_operand:SI 2 "const_int_operand" "") ; total range (match_operand:SI 3 "" "") ; table label (match_operand:SI 4 "" "")] ; Out of range label - "TARGET_ARM" +;; APPLE LOCAL compact switch tables + "TARGET_EITHER" " { rtx reg; @@ -8309,12 +8596,33 @@ operands[0] = reg; } + /* APPLE LOCAL begin compact switch tables */ + if (TARGET_ARM) + { + /* APPLE LOCAL end compact switch tables */ if (!const_ok_for_arm (INTVAL (operands[2]))) operands[2] = force_reg (SImode, operands[2]); emit_jump_insn (gen_casesi_internal (operands[0], operands[2], operands[3], operands[4])); DONE; + /* APPLE LOCAL begin compact switch tables */ + } + else + { + /* Containing function must be 4-byte aligned, else we won't know what the + various .align directives do, e.g. around constant tables. */ + cfun->needs_4byte_alignment = 1; + /* This is a function call, but the semantics are not the same as a normal + function call, so we put the parameter in R0 explicitly and hide the + call as a casesi node. The USE of R0 in the casesi_internal pattern + causes the value to be retained. */ + emit_move_insn (gen_rtx_REG (Pmode, 0), operands[0]); + emit_jump_insn (gen_thumb_casesi_internal (operands[0], operands[2], operands[3], + operands[4])); + DONE; + } + /* APPLE LOCAL end compact switch tables */ }" ) @@ -8340,6 +8648,86 @@ (set_attr "length" "12")] ) +;; APPLE LOCAL begin compact switch tables +;; This pattern represents the library call for Thumb switch tables. +;; The functions' (sparse) register usage is recorded as clobbers. + +(define_insn "thumb_casesi_internal" + [(parallel [(set (pc) + (if_then_else + (leu (match_operand:SI 0 "s_register_operand" "l") + (match_operand:SI 1 "const_int_operand" "i")) + (mem:SI (plus:SI (mult:SI (match_dup 0) (const_int 2)) + (label_ref (match_operand 2 "" "")))) + (label_ref (match_operand 3 "" "")))) + (clobber (reg:CC CC_REGNUM)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (use (reg:SI 0)) + (use (label_ref (match_dup 2)))])] + "TARGET_THUMB" + "* + { + rtx body = PATTERN (next_real_insn (insn)); + static char buf[255]; + gcc_assert (GET_CODE (body) == ADDR_DIFF_VEC); + strcpy(buf, \"bl\\t\"); + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + strcat(buf, \"L\"); + if (GET_MODE (body) == QImode + && ADDR_DIFF_VEC_FLAGS (body).offset_unsigned) + { + register_switchu8_libfunc (); + strcat(buf, \"___switchu8\"); + } + else if (GET_MODE (body) == QImode) + { + register_switch8_libfunc (); + strcat(buf, \"___switch8\"); + } + else if (GET_MODE (body) == HImode) + { + register_switch16_libfunc (); + strcat(buf, \"___switch16\"); + } + else + { + register_switch32_libfunc (); + /* The table is 4-byte aligned, and the call should + immediately precede the table. To do this, align + here; as it happens, 0x0000 is a NOP insn. The + insn_length is still 4 even if a NOP is inserted; + however, the computation in shorten_branches + comes out right because that 4 is counted against + the following label, which is marked as 4-byte + aligned. I.e. the shorten_branch code thinks it's + going to looks like + call + .align 2 + zero padding + label: + when in fact it is + .align 2 + NOP + call + .align 2 + never any padding here + label: + and it gets the right address for the label. + Yes, this is overly tricky. */ + assemble_align (32); + strcat(buf, \"___switch32\"); + } + if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + strcat(buf, \"$stub\"); + return buf; + } + " + [(set_attr "conds" "clob") + (set_attr "length" "4")] +) +;; APPLE LOCAL end compact switch tables + ;; APPLE LOCAL begin ARM setjmp/longjmp interworking ;; Indirect jump with possible change between ARM/Thumb state (define_expand "indirect_jump_exchange" @@ -10200,6 +10588,7 @@ ;; Special patterns for dealing with the constant pool +;; APPLE LOCAL begin ARM compact switch tables (define_insn "align_4" [(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN)] "TARGET_EITHER" @@ -10207,6 +10596,7 @@ assemble_align (32); return \"\"; " + [(set (attr "length") (const_int 0))] ) (define_insn "align_8" @@ -10216,6 +10606,7 @@ assemble_align (64); return \"\"; " + [(set (attr "length") (const_int 0))] ) (define_insn "consttable_end" @@ -10225,7 +10616,9 @@ making_const_table = FALSE; return \"\"; " + [(set_attr "length" "0")] ) +;; APPLE LOCAL end ARM compact switch tables (define_insn "consttable_1" [(unspec_volatile [(match_operand 0 "" "")] VUNSPEC_POOL_1)] @@ -10395,11 +10788,14 @@ "" ) +;; APPLE LOCAL begin ARM compact switch tables (define_insn "prologue_use" [(unspec:SI [(match_operand:SI 0 "register_operand" "")] UNSPEC_PROLOGUE_USE)] "" "%@ %0 needed for prologue" + [(set_attr "length" "0")] ) +;; APPLE LOCAL end ARM compact switch tables ;; Patterns for exception handling @@ -10448,6 +10844,86 @@ }" ) +;; APPLE LOCAL begin ARM 4382996 improve assignments of NE + +;; Handle ((x op y) != 0) +(define_insn_and_split "*arm_binary_ne_0" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (ne:SI (match_operator:SI 3 "binary_cc_noclobber_operator" + [(match_operand:SI 1 "s_register_operand" "r,r") + (match_operand:SI 2 "arm_not_operand" "rI,K")]) + (const_int 0))) + (clobber (reg:CC_NOOV CC_REGNUM))] + "TARGET_ARM" + "#" + "TARGET_ARM && reload_completed" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV + (match_op_dup:SI 3 [(match_dup 1) (match_dup 2)]) + (const_int 0))) + (set (match_dup 0) + (match_op_dup:SI 3 [(match_dup 1) (match_dup 2)]))]) + (set (match_dup 0) + (if_then_else:SI + (ne:SI (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (const_int 1) (match_dup 0)))] + "" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + +;; A special pattern for ADD, because compare_scc gets recognized first, +;; preventing the above form from being tried. + +(define_insn_and_split "*arm_add_ne_0" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (ne:SI (neg:SI (match_operand:SI 1 "s_register_operand" "r,r")) + (match_operand:SI 2 "arm_not_operand" "rI,K"))) + (clobber (reg:CC_NOOV CC_REGNUM))] + "TARGET_ARM" + "#" + "TARGET_ARM && reload_completed" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV + (plus:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) + (plus:SI (match_dup 1) (match_dup 2)))]) + (set (match_dup 0) + (if_then_else:SI + (ne:SI (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (const_int 1) (match_dup 0)))] + "" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + +;; A special pattern for MULT, since it requires early clobber semantics. + +(define_insn_and_split "*arm_mul_ne_0" + [(set (match_operand:SI 0 "s_register_operand" "=&r,&r,r,r") + (ne:SI (mult:SI (match_operand:SI 2 "s_register_operand" "r,r,r,r") + (match_operand:SI 1 "arm_not_operand" "%?r,0,I,K")) + (const_int 0))) + (clobber (reg:CC_NOOV CC_REGNUM))] + "TARGET_ARM" + "#" + "TARGET_ARM && reload_completed" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV + (mult:SI (match_dup 2) (match_dup 1)) + (const_int 0))) + (set (match_dup 0) + (mult:SI (match_dup 2) (match_dup 1)))]) + (set (match_dup 0) + (if_then_else:SI + (ne:SI (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (const_int 1) (match_dup 0)))] + "" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) +;; APPLE LOCAL end ARM 4382996 improve assignments of NE ;; TLS support @@ -10479,7 +10955,65 @@ "" "trap") ;; APPLE LOCAL end ARM builtin_trap - + +;; APPLE LOCAL begin bswap UXTB16 support +(define_expand "bswapsi2" + [(set (match_operand:SI 0 "s_register_operand" "") + (bswap:SI (match_operand:SI 1 "s_register_operand" "")))] + "TARGET_EITHER && arm_arch6" + "" +) + +(define_insn "*arm_bswapsi2" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "rev%?\\t%0, %1" + [(set_attr "predicable" "yes")] +) + +(define_insn "*thumb_bswapsi2" + [(set (match_operand:SI 0 "register_operand" "=l") + (bswap:SI (match_operand:SI 1 "register_operand" "l")))] + "TARGET_THUMB && arm_arch6" + "rev\\t%0, %1" + [(set_attr "length" "2")] +) + +(define_expand "bswapdi2" + [(set (match_operand:DI 0 "s_register_operand" "") + (bswap:DI (match_operand:DI 1 "s_register_operand" "")))] + "TARGET_EITHER && arm_arch6" + "" +) + +(define_insn "*arm_bswapdi2" + [(set (match_operand:DI 0 "s_register_operand" "=&r") + (bswap:DI (match_operand:DI 1 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "rev%?\\t%Q0, %R1\;rev%?\\t%R0, %Q1" + [(set_attr "predicable" "yes") + (set_attr "length" "8")] +) + +(define_insn "*thumb_bswapdi2" + [(set (match_operand:DI 0 "register_operand" "=&l") + (bswap:DI (match_operand:DI 1 "register_operand" "l")))] + "TARGET_THUMB && arm_arch6" + "rev\\t%Q0, %R1\;rev\\t%R0, %Q1" + [(set_attr "length" "4")] +) + +(define_insn "uxtb16" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (unspec:SI [(match_operand:SI 1 "s_register_operand" "r") + (match_operand:SI 2 "const_int_operand" "M")] UNSPEC_UXTB16))] + "TARGET_ARM && arm_arch6" + "uxtb16%?\\t%0, %1, ror %2" + [(set_attr "predicable" "yes")] +) +;; APPLE LOCAL end bswap UXTB16 support + ;; Load the FPA co-processor patterns (include "fpa.md") ;; Load the Maverick co-processor patterns Modified: llvm-gcc-4.2/trunk/gcc/config/arm/cirrus.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/cirrus.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/cirrus.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/cirrus.md Tue Jul 29 17:54:46 2008 @@ -120,7 +120,8 @@ (set_attr "cirrus" "normal")] ) -(define_insn "muldi3" +;; APPLE LOCAL DImode multiply enhancement +(define_insn "cirrus_muldi3" [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (mult:DI (match_operand:DI 2 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] Modified: llvm-gcc-4.2/trunk/gcc/config/arm/constraints.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/constraints.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/constraints.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/constraints.md Tue Jul 29 17:54:46 2008 @@ -30,7 +30,8 @@ ;; in Thumb state: I, J, K, L, M, N, O ;; The following multi-letter normal constraints have been used: -;; in ARM state: Da, Db, Dc +;; APPLE LOCAL 5831562 long long constants +;; in ARM state: Da, Db, Dc, Dd ;; The following memory constraints have been used: ;; in ARM state: Q, Uq, Uv, Uy @@ -152,6 +153,15 @@ (match_test "TARGET_ARM && arm_const_double_inline_cost (op) == 4 && !(optimize_size || arm_ld_sched)"))) +;; APPLE LOCAL begin 5831562 long long constants +(define_constraint "Dd" + "@internal + In ARM state a const_int, const_double or const_vector that can + used directly in arithmetic instructions as two 32-bit immediates." + (and (match_code "const_double,const_int,const_vector") + (match_test "TARGET_ARM && const64_ok_for_arm_immediate (op)"))) +;; APPLE LOCAL end 5831562 long long constants + (define_memory_constraint "Uv" "@internal In ARM state a valid VFP load/store address." Modified: llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/predicates.md Tue Jul 29 17:54:46 2008 @@ -51,6 +51,19 @@ || REGNO (op) >= FIRST_PSEUDO_REGISTER)); }) +;; APPLE LOCAL begin ARM add this peephole +;; Any Thumb low register. +(define_predicate "thumb_low_register_operand" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return (GET_CODE (op) == REG + && REGNO (op) <= LAST_LO_REGNUM); +}) +;; APPLE LOCAL end ARM add this peephole + (define_predicate "f_register_operand" (match_code "reg,subreg") { @@ -73,6 +86,16 @@ (and (match_code "const_int") (match_test "const_ok_for_arm (INTVAL (op))"))) +;; APPLE LOCAL begin 5831562 long long constants +(define_predicate "arm_immediate64_operand" + (and (match_code "const_int,const_double") + (match_test "const64_ok_for_arm_immediate (op)"))) + +(define_predicate "arm_add_immediate64_operand" + (and (match_code "const_int,const_double") + (match_test "const64_ok_for_arm_add (op)"))) +;; APPLE LOCAL end 5831562 long long constants + (define_predicate "arm_neg_immediate_operand" (and (match_code "const_int") (match_test "const_ok_for_arm (-INTVAL (op))"))) @@ -86,6 +109,16 @@ (ior (match_operand 0 "s_register_operand") (match_operand 0 "arm_immediate_operand"))) +;; APPLE LOCAL begin 5831562 long long constants +(define_predicate "arm_rhs64_operand" + (ior (match_operand 0 "s_register_operand") + (match_operand 0 "arm_immediate64_operand"))) + +(define_predicate "arm_add64_operand" + (ior (match_operand 0 "s_register_operand") + (match_operand 0 "arm_add_immediate64_operand"))) +;; APPLE LOCAL end 5831562 long long constants + (define_predicate "arm_rhsm_operand" (ior (match_operand 0 "arm_rhs_operand") (match_operand 0 "memory_operand"))) @@ -159,6 +192,14 @@ (and (match_code "plus,minus,ior,xor,and") (match_test "mode == GET_MODE (op)"))) +;; APPLE LOCAL begin ARM 4382996 improve assignments of NE +;; True for binary operators that can set the condition codes as a side effect, +;; and that don't have early clobber semantics. +(define_special_predicate "binary_cc_noclobber_operator" + (and (match_code "plus,minus,ior,xor,and,ashift,ashiftrt,lshiftrt") + (match_test "mode == GET_MODE (op)"))) +;; APPLE LOCAL end ARM 4382996 improve assignments of NE + ;; True for logical binary operators. (define_special_predicate "logical_binary_operator" (and (match_code "ior,xor,and") Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.md Tue Jul 29 17:54:46 2008 @@ -12137,6 +12137,24 @@ "#" [(set_attr "type" "multi")]) +;; APPLE LOCAL begin mainline 5951842 +;; This pattern must be defined before *lshrti3_2 to prevent +;; combine pass from converting sse2_lshrti3 to *lshrti3_2. + +(define_insn "sse2_lshrti3" + [(set (match_operand:TI 0 "register_operand" "=x") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))] + "TARGET_SSE2" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) / 8); + return "psrldq\t{%2, %0|%0, %2}"; +} + [(set_attr "type" "sseishft") + (set_attr "prefix_data16" "1") + (set_attr "mode" "TI")]) +;; APPLE LOCAL end mainline 5951842 + (define_insn "*lshrti3_2" [(set (match_operand:TI 0 "register_operand" "=r") (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") @@ -19236,7 +19254,7 @@ (define_insn "x86_movdicc_0_m1_rex64" [(set (match_operand:DI 0 "register_operand" "=r") - (if_then_else:DI (match_operand:DI 1 "ix86_carry_flag_operator" "") + (if_then_else:DI (match_operand 1 "ix86_carry_flag_operator" "") (const_int -1) (const_int 0))) (clobber (reg:CC FLAGS_REG))] @@ -19279,7 +19297,7 @@ (define_insn "x86_movsicc_0_m1" [(set (match_operand:SI 0 "register_operand" "=r") - (if_then_else:SI (match_operand:SI 1 "ix86_carry_flag_operator" "") + (if_then_else:SI (match_operand 1 "ix86_carry_flag_operator" "") (const_int -1) (const_int 0))) (clobber (reg:CC FLAGS_REG))] Modified: llvm-gcc-4.2/trunk/gcc/config/i386/sse.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/sse.md?rev=54178&r1=54177&r2=54178&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/sse.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/sse.md Tue Jul 29 17:54:46 2008 @@ -3069,17 +3069,9 @@ operands[1] = gen_lowpart (TImode, operands[1]); }) -(define_insn "sse2_lshrti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") - (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))] - "TARGET_SSE2" -{ - operands[2] = GEN_INT (INTVAL (operands[2]) / 8); - return "psrldq\t{%2, %0|%0, %2}"; -} - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) +;; APPLE LOCAL begin mainline 5951842 +;; moved sse2_lshrti3 to i386.md +;; APPLE LOCAL end mainline 5951842 (define_expand "vec_shr_" [(set (match_operand:SSEMODEI 0 "register_operand" "") Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/ext/interface4.h?rev=54178&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.h (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/ext/interface4.h Tue Jul 29 17:54:46 2008 @@ -0,0 +1,8 @@ +#pragma interface +namespace N { + typedef int A; +} +inline void g ( ) { + static N :: A a = 0; + a = a; +} From resistor at mac.com Tue Jul 29 16:17:09 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 29 Jul 2008 21:17:09 -0000 Subject: [llvm-commits] [llvm] r54174 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200807292117.m6TLH9SC008656@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 29 16:17:08 2008 New Revision: 54174 URL: http://llvm.org/viewvc/llvm-project?rev=54174&view=rev Log: When merging a PHI operand's live interval into the PHI's live interval, we need to merge over all liveranges in the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54174&r1=54173&r2=54174&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Jul 29 16:17:08 2008 @@ -786,21 +786,29 @@ LiveInterval& RHS = LI.getOrCreateInterval(secondary); LI.computeNumbering(); - const LiveRange* RangeMergingIn = RHS.getLiveRangeContaining(LI.getMBBEndIdx(pred)); + VNInfo* RHSVN = RangeMergingIn->valno; VNInfo* NewVN = LHS.getNextValue(RangeMergingIn->valno->def, RangeMergingIn->valno->copy, LI.getVNInfoAllocator()); - NewVN->hasPHIKill = true; - LiveRange NewRange(RangeMergingIn->start, RangeMergingIn->end, NewVN); + + for (LiveInterval::iterator RI = RHS.begin(), RE = RHS.end(); + RI != RE; ) + if (RI->valno == RHSVN) { + NewVN->hasPHIKill = true; + LiveRange NewRange(RI->start, RI->end, NewVN); + LHS.addRange(NewRange); + + unsigned start = RI->start; + unsigned end = RI->end; + ++RI; + RHS.removeRange(start, end, true); + } else + ++RI; - if (RHS.containsOneValue()) + if (RHS.begin() == RHS.end()) LI.removeInterval(RHS.reg); - else - RHS.removeRange(RangeMergingIn->start, RangeMergingIn->end, true); - - LHS.addRange(NewRange); } bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) { From resistor at mac.com Tue Jul 29 16:15:45 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 29 Jul 2008 21:15:45 -0000 Subject: [llvm-commits] [llvm] r54173 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200807292115.m6TLFjNX008609@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 29 16:15:44 2008 New Revision: 54173 URL: http://llvm.org/viewvc/llvm-project?rev=54173&view=rev Log: Don't decrement the BB remap when we don't need to. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54173&r1=54172&r2=54173&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Jul 29 16:15:44 2008 @@ -144,8 +144,7 @@ std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), LI->start); // Take the pair containing the index std::vector::const_iterator J = - ((I != OldI2MBB.end() && I->first > index) || - (I == OldI2MBB.end() && OldI2MBB.size()>0)) ? (I-1): I; + (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; LI->start = getMBBStartIdx(J->second); } else { @@ -162,8 +161,7 @@ std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), LI->end); // Take the pair containing the index std::vector::const_iterator J = - ((I != OldI2MBB.end() && I->first > index) || - (I == OldI2MBB.end() && OldI2MBB.size()>0)) ? (I-1): I; + (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; LI->end = getMBBEndIdx(J->second) + 1; } else { @@ -186,8 +184,7 @@ std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), vni->def); // Take the pair containing the index std::vector::const_iterator J = - ((I != OldI2MBB.end() && I->first > index) || - (I == OldI2MBB.end() && OldI2MBB.size()>0)) ? (I-1): I; + (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; vni->def = getMBBStartIdx(J->second); @@ -205,8 +202,7 @@ std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), vni->kills[i]); // Take the pair containing the index std::vector::const_iterator J = - ((I != OldI2MBB.end() && I->first > index) || - (I == OldI2MBB.end() && OldI2MBB.size()>0)) ? (I-1): I; + (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; vni->kills[i] = getMBBEndIdx(J->second) + 1; } else { From isanbard at gmail.com Tue Jul 29 17:09:11 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 22:09:11 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54175 - in /llvm-gcc-4.2/trunk/gcc: ./ config/ config/arm/ config/i386/ config/rs6000/ cp/ ginclude/ Message-ID: <200807292209.m6TM9Cto010937@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 17:09:10 2008 New Revision: 54175 URL: http://llvm.org/viewvc/llvm-project?rev=54175&view=rev Log: Update the header, opt, and def files to Apple GCC's 4.2 TOT. Modified: llvm-gcc-4.2/trunk/gcc/c-common.h llvm-gcc-4.2/trunk/gcc/c-objc-common.h llvm-gcc-4.2/trunk/gcc/c-pretty-print.h llvm-gcc-4.2/trunk/gcc/c-tree.h llvm-gcc-4.2/trunk/gcc/c.opt llvm-gcc-4.2/trunk/gcc/common.opt llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h llvm-gcc-4.2/trunk/gcc/config/arm/arm.h llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt llvm-gcc-4.2/trunk/gcc/config/arm/bpabi.h llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h llvm-gcc-4.2/trunk/gcc/config/arm/elf.h llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h llvm-gcc-4.2/trunk/gcc/config/darwin.h llvm-gcc-4.2/trunk/gcc/config/darwin.opt llvm-gcc-4.2/trunk/gcc/config/freebsd.h llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h llvm-gcc-4.2/trunk/gcc/config/i386/darwin64.h llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h llvm-gcc-4.2/trunk/gcc/config/i386/i386.h llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h llvm-gcc-4.2/trunk/gcc/convert.h llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.h llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h llvm-gcc-4.2/trunk/gcc/cp/decl.h llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h llvm-gcc-4.2/trunk/gcc/defaults.h llvm-gcc-4.2/trunk/gcc/dwarf2.h llvm-gcc-4.2/trunk/gcc/except.h llvm-gcc-4.2/trunk/gcc/flags.h llvm-gcc-4.2/trunk/gcc/function.h llvm-gcc-4.2/trunk/gcc/gcc.h llvm-gcc-4.2/trunk/gcc/ginclude/tgmath.h llvm-gcc-4.2/trunk/gcc/gsyslimits.h llvm-gcc-4.2/trunk/gcc/gthr-win32.h llvm-gcc-4.2/trunk/gcc/hard-reg-set.h llvm-gcc-4.2/trunk/gcc/langhooks-def.h llvm-gcc-4.2/trunk/gcc/langhooks.h llvm-gcc-4.2/trunk/gcc/libfuncs.h llvm-gcc-4.2/trunk/gcc/limitx.h llvm-gcc-4.2/trunk/gcc/limity.h llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/longlong.h llvm-gcc-4.2/trunk/gcc/rtl.h llvm-gcc-4.2/trunk/gcc/sched-int.h llvm-gcc-4.2/trunk/gcc/target-def.h llvm-gcc-4.2/trunk/gcc/tree.def Modified: llvm-gcc-4.2/trunk/gcc/c-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.h Tue Jul 29 17:09:10 2008 @@ -781,8 +781,6 @@ /* APPLE LOCAL begin IMA built-in decl merging fix (radar 3645899) */ extern bool builtin_function_disabled_p (const char *); /* APPLE LOCAL end */ -/* APPLE LOCAL define this sensibly in all languages */ -extern bool c_flag_no_builtin (void); /* This is the basic parsing function. */ extern void c_parse_file (void); @@ -1067,6 +1065,8 @@ tree objc_build_property_reference_expr (tree, tree); bool objc_property_reference_expr (tree); /* APPLE LOCAL end radar 5285911 */ +/* APPLE LOCAL radar 5802025 */ +tree objc_build_property_getter_func_call (tree); tree objc_build_setter_call (tree, tree); /* APPLE LOCAL end C* property (Radar 4436866) */ /* APPLE LOCAL radar 4712269 */ @@ -1094,8 +1094,6 @@ bool objc_check_format_nsstring (tree, unsigned HOST_WIDE_INT, bool *); /* APPLE LOCAL end 4985544 */ -/* APPLE LOCAL radar 2996215 */ -tree objc_create_init_utf16_var (const unsigned char *, size_t, size_t *); /* APPLE LOCAL radar 5202926 */ bool objc_anonymous_local_objc_name (const char *); /* APPLE LOCAL begin radar 5195402 */ @@ -1121,6 +1119,90 @@ extern tree vector_constructor_from_expr (tree, tree); /* APPLE LOCAL end AltiVec */ +/* APPLE LOCAL begin radar 5732232 - blocks */ +enum { + BLOCK_NEEDS_FREE = (1 << 24), + BLOCK_HAS_COPY_DISPOSE = (1 << 25), + BLOCK_NO_COPY = (1 << 26), /* interim byref: no copies allowed */ + BLOCK_IS_GC = (1 << 27) +}; + +struct block_sema_info { + tree helper_func_decl; + tree copy_helper_func_decl; + tree destroy_helper_func_decl; + tree block_arg_ptr_type; + /* This is for C. */ + struct c_arg_info * arg_info; + tree block_ref_decl_list; + tree block_byref_decl_list; + /* APPLE LOCAL radar 5803600 */ + tree block_byref_global_decl_list; + tree block_original_ref_decl_list; + tree block_original_byref_decl_list; + tree block_body; + bool hasPrototype; + bool isVariadic; + bool BlockHasCopyDispose; + bool BlockHasByrefVar; + + /* the_scope - This is the scope for the block itself, which + contains arguments etc. Use only for C. */ + struct c_scope *the_scope; + /* Same as the above, only for C++. */ + struct cp_binding_level *cp_the_scope; + + /* return_type - This will get set to block result type, by looking + at return types, if any, in the block body. */ + tree return_type; + + /* prev_block_info - If this is nested inside another block, this points + to the outer block. */ + struct block_sema_info *prev_block_info; +}; + +extern struct block_sema_info *cur_block; +extern tree build_helper_func_decl (tree, tree); +extern bool building_block_byref_decl; +extern tree invoke_impl_ptr_type; +extern tree build_block_byref_decl (tree, tree, tree); +extern tree build_block_ref_decl (tree, tree); +extern tree begin_block (void); +extern struct block_sema_info *finish_block (tree); +extern bool in_imm_block (void); +extern bool lookup_name_in_block (tree, tree*); +extern void build_block_internal_types (void); +extern void push_to_top_level (void); +extern void pop_from_top_level (void); +extern void start_block_helper_function (tree func_decl, bool add_result_decl); +extern void block_build_prologue (struct block_sema_info *block_impl); +extern tree c_finish_return (tree); +extern tree copy_in_object (tree); +extern bool block_requires_copying (tree); +extern tree retain_block_component (tree); +extern tree release_block_component (tree); +/* APPLE LOCAL begin radar 5803600 */ +extern void add_block_global_byref_list (tree); +extern bool in_block_global_byref_list (tree); +/* APPLE LOCAL end radar 5803600 */ +/* APPLE LOCAL end radar 5732232 - blocks */ +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +extern tree build_byref_local_var_access (tree, tree); +extern tree do_digest_init (tree, tree); +extern tree cast_to_pointer_to_id (tree); +/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + +/* APPLE LOCAL begin radar 6083129 - byref escapes */ +extern void gen_block_byref_release_exp (tree); +extern tree build_block_byref_release_exp (tree); +extern tree build_block_byref_release_decl (void); +extern void release_all_local_byrefs_at_return (void); +void diagnose_byref_var_in_current_scope (void); +extern void release_local_byrefs_at_break (void); +extern void in_bc_stmt_block (void); +extern void outof_bc_stmt_block (void); +/* APPLE LOCAL end radar 6083129 - byref escapes */ + /* In c-omp.c */ extern tree c_finish_omp_master (tree); extern tree c_finish_omp_critical (tree, tree); Modified: llvm-gcc-4.2/trunk/gcc/c-objc-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-objc-common.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-objc-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-objc-common.h Tue Jul 29 17:09:10 2008 @@ -115,10 +115,6 @@ #define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE #define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type -/* APPLE LOCAL begin define this sensibly in all languages */ -#undef LANG_HOOKS_FLAG_NO_BUILTIN -#define LANG_HOOKS_FLAG_NO_BUILTIN c_flag_no_builtin -/* APPLE LOCAL end define this sensibly in all languages */ #undef LANG_HOOKS_TO_TARGET_CHARSET #define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset #undef LANG_HOOKS_EXPR_TO_DECL Modified: llvm-gcc-4.2/trunk/gcc/c-pretty-print.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-pretty-print.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-pretty-print.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-pretty-print.h Tue Jul 29 17:09:10 2008 @@ -167,6 +167,8 @@ void pp_c_dot (c_pretty_printer *); void pp_c_ampersand (c_pretty_printer *); void pp_c_star (c_pretty_printer *); +/* APPLE LOCAL blocks */ +void pp_c_caret (c_pretty_printer *); void pp_c_arrow (c_pretty_printer *); void pp_c_semicolon (c_pretty_printer *); void pp_c_complement (c_pretty_printer *); Modified: llvm-gcc-4.2/trunk/gcc/c-tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-tree.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-tree.h Tue Jul 29 17:09:10 2008 @@ -304,6 +304,8 @@ cdk_array, /* A pointer. */ cdk_pointer, + /* APPLE LOCAL blocks (C++ ch) */ + cdk_block_pointer, /* Parenthesized declarator with nested attributes. */ cdk_attrs }; @@ -509,6 +511,10 @@ extern struct c_declarator *build_id_declarator (tree); extern struct c_declarator *make_pointer_declarator (struct c_declspecs *, struct c_declarator *); +/* APPLE LOCAL begin radar 5814025 - blocks (C++ cg) */ +extern struct c_declarator *make_block_pointer_declarator (struct c_declspecs *, + struct c_declarator *); +/* APPLE LOCAL end radar 5814025 - blocks (C++ cg) */ extern struct c_declspecs *build_null_declspecs (void); extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree); extern struct c_declspecs *declspecs_add_type (struct c_declspecs *, Modified: llvm-gcc-4.2/trunk/gcc/c.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c.opt?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c.opt (original) +++ llvm-gcc-4.2/trunk/gcc/c.opt Tue Jul 29 17:09:10 2008 @@ -751,6 +751,12 @@ ObjC ObjC++ Var(flag_objc_exceptions) Enable Objective-C exception and synchronization syntax +; APPLE LOCAL begin ARM hybrid objc-2.0 +fobjc-legacy-dispatch +ObjC ObjC++ Var(flag_objc_legacy_dispatch) Init(-1) +Use Objective-C v1 message dispatching +; APPLE LOCAL end ARM hybrid objc-2.0 + ; APPLE LOCAL begin radar 2848255 fobjc-zerocost-exceptions ObjC ObjC++ Var(flag_objc_zerocost_exceptions) Init(0) @@ -773,6 +779,12 @@ ObjC ObjC++ Var(flag_objc_gc) Enable garbage collection (GC) in Objective-C/Objective-C++ programs +; APPLE LOCAL begin radar 5811887 - blocks +fblocks +C ObjC C++ ObjC++ Var(flag_blocks) Init(-1) +Program supports c/objc extension blocks +; APPLE LOCAL end radar 5811887 - blocks + ; Nonzero means that we generate NeXT setjmp based exceptions. fobjc-sjlj-exceptions ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1) @@ -965,6 +977,12 @@ C ObjC C++ ObjC++ Joined Separate -iwithprefixbefore Add to the end of the main include path +; APPLE LOCAL begin ARM iwithsysroot 4917039 +iwithsysroot +C ObjC C++ ObjC++ Joined Separate +-iwithsysroot Add / to the start of the system include path +; APPLE LOCAL end ARM iwithsysroot 4917039 + lang-asm C Undocumented Modified: llvm-gcc-4.2/trunk/gcc/common.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/common.opt?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/common.opt (original) +++ llvm-gcc-4.2/trunk/gcc/common.opt Tue Jul 29 17:09:10 2008 @@ -560,6 +560,19 @@ Common Report Var(flag_function_sections) Place each function into its own section +;; APPLE LOCAL begin 5695218 +fglobal-alloc-prefer-bytes +Common Report Var(flag_global_alloc_prefer_bytes) Init(1) PerFunc +Prefer to allocate byte and short candidates before word candidates (x86_32 only) + +;; APPLE LOCAL end 5695218 + +;; APPLE LOCAL begin ARM conditionally disable local RA +flocal-alloc +Common Report Var(flag_local_alloc) Init(1) PerFunc +Run the local register allocator +;; APPLE LOCAL end ARM conditionally disable local RA + ; APPLE LOCAL begin optimization pragmas 3124235/3420242 fgcse Common Report Var(flag_gcse) PerFunc Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm-protos.h Tue Jul 29 17:09:10 2008 @@ -26,6 +26,15 @@ /* APPLE LOCAL ARM darwin optimization defaults */ extern void optimization_options (int, int); +/* APPLE LOCAL begin ARM compact switch tables */ +extern void arm_adjust_insn_length (rtx, int *); +extern void register_switch8_libfunc (void); +extern void register_switchu8_libfunc (void); +extern void register_switch16_libfunc (void); +extern void register_switch32_libfunc (void); +extern int count_thumb_unexpanded_prologue (void); +extern int arm_label_align (rtx); +/* APPLE LOCAL end ARM compact switch tables */ /* APPLE LOCAL ARM prefer SP to FP */ extern HOST_WIDE_INT arm_local_debug_offset (rtx); extern void arm_override_options (void); @@ -54,6 +63,10 @@ extern bool arm_vector_mode_supported_p (enum machine_mode); extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode); extern int const_ok_for_arm (HOST_WIDE_INT); +/* APPLE LOCAL begin 5831562 long long constants */ +extern bool const64_ok_for_arm_immediate (rtx); +extern bool const64_ok_for_arm_add (rtx); +/* APPLE LOCAL end 5831562 long long constants */ extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx, HOST_WIDE_INT, rtx, rtx, int); extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode, @@ -177,6 +190,12 @@ extern void thumb_set_return_address (rtx, rtx); #endif +/* APPLE LOCAL begin ARM enhance conditional insn generation */ +#ifdef BB_HEAD +extern void arm_ifcvt_modify_multiple_tests (ce_if_block_t *, basic_block, rtx *, rtx*); +#endif +/* APPLE LOCAL end ARM enhance conditional insn generation */ + /* Defined in pe.c. */ extern int arm_dllexport_name_p (const char *); extern int arm_dllimport_name_p (const char *); @@ -193,5 +212,7 @@ extern void arm_pr_long_calls (struct cpp_reader *); extern void arm_pr_no_long_calls (struct cpp_reader *); extern void arm_pr_long_calls_off (struct cpp_reader *); +/* APPLE LOCAL 5946347 ms_struct support */ +extern int arm_field_ms_struct_align (tree); #endif /* ! GCC_ARM_PROTOS_H */ Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Tue Jul 29 17:09:10 2008 @@ -31,9 +31,6 @@ #ifndef TARGET_MACHO #define TARGET_MACHO 0 #endif -#ifndef MACHO_DYNAMIC_NO_PIC_P -#define MACHO_DYNAMIC_NO_PIC_P 0 -#endif /* APPLE LOCAL end ARM darwin target */ /* APPLE LOCAL ARM interworking */ @@ -469,7 +466,10 @@ #define PREFERRED_STACK_BOUNDARY \ (arm_abi == ARM_ABI_ATPCS ? 64 : STACK_BOUNDARY) -#define FUNCTION_BOUNDARY 32 +/* APPLE LOCAL begin ARM 6008578 */ +#define FUNCTION_BOUNDARY arm_function_boundary () +extern int arm_function_boundary (void); +/* APPLE LOCAL end ARM 6008578 */ /* The lowest bit is used to indicate Thumb-mode functions, so the vbit must go into the delta field of pointers to member @@ -480,6 +480,11 @@ #define BIGGEST_ALIGNMENT (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32) +/* APPLE LOCAL begin 5946347 ms_struct support */ +#define TARGET_FIELD_MS_STRUCT_ALIGN(FIELD) arm_field_ms_struct_align (FIELD) +#define BIGGEST_MS_STRUCT_ALIGNMENT 128 +/* APPLE LOCAL end 5946347 ms_struct support */ + /* XXX Blah -- this macro is used directly by libobjc. Since it supports no vector modes, cut out the complexity and fall back on BIGGEST_FIELD_ALIGNMENT. */ @@ -967,6 +972,26 @@ 95 \ } +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#define DIMODE_REG_ALLOC_ORDER \ +{ \ + 2, 3, 1, 0, 12, 14, 4, 5, \ + 6, 7, 8, 10, 9, 11, 13, 15, \ + 16, 17, 18, 19, 20, 21, 22, 23, \ + 27, 28, 29, 30, 31, 32, 33, 34, \ + 35, 36, 37, 38, 39, 40, 41, 42, \ + 43, 44, 45, 46, 47, 48, 49, 50, \ + 51, 52, 53, 54, 55, 56, 57, 58, \ + 59, 60, 61, 62, \ + 24, 25, 26, \ + 78, 77, 76, 75, 74, 73, 72, 71, \ + 70, 69, 68, 67, 66, 65, 64, 63, \ + 79, 80, 81, 82, 83, 84, 85, 86, \ + 87, 88, 89, 90, 91, 92, 93, 94, \ + 95 \ +} +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ + /* Interrupt functions can only use registers that have already been saved by the prologue, even if they would normally be call-clobbered. */ @@ -1833,15 +1858,9 @@ #define SHORT_CALL_FLAG_CHAR '^' #define LONG_CALL_FLAG_CHAR '#' -#define ENCODED_SHORT_CALL_ATTR_P(SYMBOL_NAME) \ - (*(SYMBOL_NAME) == SHORT_CALL_FLAG_CHAR) - #define SYMBOL_SHORT_CALL_ATTR_P(SYMBOL) \ (SYMBOL_REF_FLAGS (SYMBOL) & SYMBOL_SHORT_CALL) -#define ENCODED_LONG_CALL_ATTR_P(SYMBOL_NAME) \ - (*(SYMBOL_NAME) == LONG_CALL_FLAG_CHAR) - #define SYMBOL_LONG_CALL_ATTR_P(SYMBOL) \ (SYMBOL_REF_FLAGS (SYMBOL) & SYMBOL_LONG_CALL) @@ -2070,6 +2089,111 @@ for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE Pmode +/* APPLE LOCAL begin ARM compact switch tables */ +#define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB) + +#define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ +(TARGET_ARM ? SImode \ + : (MIN_OFFSET) >= -256 && (MAX_OFFSET) <= 254 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \ + : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 510 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \ + : (MIN_OFFSET) >= -65536 && (MAX_OFFSET) <= 65534 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \ + : SImode) + +/* This macro uses variable "file" that exists at + the single place it is invoked, in final.c. INSN_ADDRESSES + and INSN_UID also expand to variables visible at that point, + but not everywhere. Ewww. + Table in RTL includes default target as the last element (via + local change in stmt.c). Table in .s file additionally includes + count as first element, count does not include the last element. + All that is dealt with here. */ + + +#define ASM_OUTPUT_ADDR_DIFF_VEC(LABEL, BODY) \ +do { \ + int idx, size = GET_MODE_SIZE (GET_MODE (BODY)); \ + int pack = (TARGET_THUMB) ? 2 : 4; \ + /* APPLE LOCAL 5837498 assembler expr for (L1-L2)/2 */ \ + /* removed unused variable "base_addr" */ \ + int base_label_no = CODE_LABEL_NUMBER (LABEL); \ + int vlen = XVECLEN (BODY, 1); /*includes trailing default */ \ + const char* directive; \ + if (GET_MODE (BODY) == QImode) \ + directive = ".byte"; \ + else if (GET_MODE (BODY) == HImode) \ + directive = ".short"; \ + else \ + { \ + pack = 1; \ + directive = ".long"; \ + } \ + /* Alignment of table was handled by aligning its label, \ + in final_scan_insn. */ \ + targetm.asm_out.internal_label (file, "L", base_label_no); \ + /* Default is not included in output count */ \ + if (TARGET_THUMB) \ + asm_fprintf (file, "\t%s\t%d @ size\n", directive, vlen - 1); \ + for (idx = 0; idx < vlen; idx++) \ + { \ + rtx target_label = XEXP (XVECEXP (BODY, 1, idx), 0); \ + /* APPLE LOCAL begin 5837498 assembler expr for (L1-L2)/2 */ \ + if (GET_MODE (BODY) != SImode) \ + { \ + /* ARM mode is always SImode bodies */ \ + gcc_assert (!TARGET_ARM); \ + /* APPLE LOCAL 5903944 */ \ + asm_fprintf (file, "\t%s\t(L%d-L%d)/%d\n", \ + directive, \ + CODE_LABEL_NUMBER (target_label), base_label_no, pack); \ + } \ + /* APPLE LOCAL end 5837498 assembler expr for (L1-L2)/2 */ \ + else if (!TARGET_THUMB) \ + asm_fprintf (file, "\tb\tL%d\n", \ + CODE_LABEL_NUMBER (target_label)); \ + else \ + /* Let the assembler do the computation here; one case that \ + uses is this is when there are asm's, which makes \ + compile time computations unreliable. */ \ + asm_fprintf (file, "\t%s\tL%d-L%d\n", \ + directive, \ + CODE_LABEL_NUMBER (target_label), base_label_no); \ + } \ + /* Pad to instruction boundary. */ \ + vlen = (vlen + 1/*count*/) * size; \ + while (vlen % pack != 0) \ + { \ + asm_fprintf (file, "\t%s\t0 @ pad\n", directive); \ + vlen += size; \ + } \ +} while (0) + +/* This is identical to the default code when ASM_OUTPUT_ADDR_VEC is + not defined; however, final_scan_insn() will not invoke that + code when ASM_OUTPUT_ADDR_DIFF_VEC is defined. In other words + if one of these is defined the other must be also, assuming you + want to use both kinds of tables in different circumstances. + Grr. This requirement is undocumented. */ + +#define ASM_OUTPUT_ADDR_VEC(LABEL, BODY) \ +do \ + { \ + int vlen = XVECLEN (BODY, 0); \ + int idx; \ + if (GET_CODE (BODY) != ADDR_VEC) \ + gcc_unreachable (); \ + for (idx = 0; idx < vlen; idx++) \ + { \ + ASM_OUTPUT_ADDR_VEC_ELT \ + (file, CODE_LABEL_NUMBER (XEXP \ + (XVECEXP (BODY, 0, idx), 0))); \ + } \ + } \ +while (0) +/* APPLE LOCAL end ARM compact switch tables */ + /* signed 'char' is most compatible, but RISC OS wants it unsigned. unsigned is probably best, but may break some code. */ #ifndef DEFAULT_SIGNED_CHAR @@ -2118,10 +2242,26 @@ /* Calling from registers is a massive pain. */ #define NO_FUNCTION_CSE 1 +/* APPLE LOCAL begin DImode multiply enhancement */ +/* Enable a new optimization in combine.c, see there. */ +#define COMBINE_TRY_RETAIN 1 +/* APPLE LOCAL end DImode multiply enhancement */ + /* The machine modes of pointers and functions */ #define Pmode SImode #define FUNCTION_MODE Pmode +/* APPLE LOCAL begin ARM enhance conditional insn generation */ +/* A C expression to modify the code described by the conditional if + information CE_INFO, for the basic block BB, possibly updating the tests in + TRUE_EXPR, and FALSE_EXPR for converting the && and || parts of if-then or + if-then-else code to conditional instructions. OLD_TRUE and OLD_FALSE are + the previous tests. Set either TRUE_EXPR or FALSE_EXPR to a null pointer if + the tests cannot be converted. */ +#define IFCVT_MODIFY_MULTIPLE_TESTS(CE_INFO, BB, TRUE_EXPR, FALSE_EXPR) \ +arm_ifcvt_modify_multiple_tests (CE_INFO, BB, &TRUE_EXPR, &FALSE_EXPR) +/* APPLE LOCAL end ARM enhance conditional insn generation */ + #define ARM_FRAME_RTX(X) \ ( (X) == frame_pointer_rtx || (X) == stack_pointer_rtx \ || (X) == arg_pointer_rtx) @@ -2499,10 +2639,49 @@ optimization_options ((LEVEL), (SIZE)) /* APPLE LOCAL end ARM darwin optimization defaults */ +/* APPLE LOCAL begin 5831562 ARM pseudo-pseudo tying */ +#define TIE_PSEUDOS 1 +/* APPLE LOCAL end 5831562 ARM pseudo-pseudo tying */ + +/* APPLE LOCAL begin ARM strings in code */ +/* APPLE LOCAL begin ARM compact switch tables */ +/* length for consttable_string needs to be done in code */ +#define ADJUST_INSN_LENGTH(INSN, LENGTH) \ + arm_adjust_insn_length ((INSN), &(LENGTH)) +/* APPLE LOCAL end ARM compact switch tables */ +/* APPLE LOCAL end ARM strings in code */ + /* APPLE LOCAL begin ARM prefer SP to FP */ #define DEBUGGER_AUTO_OFFSET(X) arm_local_debug_offset (X) #define ALLOW_ELIMINATION_TO_SP /* APPLE LOCAL end ARM prefer SP to FP */ + +/* APPLE LOCAL begin ARM compact switch tables */ +#define LABEL_ALIGN(LABEL) arm_label_align(LABEL) +#define TARGET_EXTRA_CASES (TARGET_THUMB ? 1 : 0) + +/* Don't take shortcuts which may compromise preciseness of + address/alignment calculations. */ +#define TARGET_EXACT_SIZE_CALCULATIONS + +/* Count size of prologue */ +#define TARGET_UNEXPANDED_PROLOGUE_SIZE \ + (TARGET_THUMB ? count_thumb_unexpanded_prologue () : 0) + +/* Align labels in ADDR_DIFF_VECs with the same alignment as + the table they are a part of. */ +#define TARGET_ALIGN_ADDR_DIFF_VEC_LABEL +/* APPLE LOCAL end ARM compact switch tables */ + +/* APPLE LOCAL begin ARM 4-byte align stack objects */ +/* In Thumb mode align stack objects on 4 bytes, so we can use + the %sp+N form of ADD to compute their addresses rather than + having to break this into 2 insns. */ +#if TARGET_MACHO +#define LOCAL_ALIGNMENT(TYPE, BASIC_ALIGN) \ + (TARGET_THUMB ? (MAX (BASIC_ALIGN, 4 * BITS_PER_UNIT)) : BASIC_ALIGN) +#endif +/* APPLE LOCAL end ARM 4-byte align stack objects */ enum arm_builtins { @@ -2672,6 +2851,7 @@ }; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #define LLVM_TARGET_INTRINSIC_PREFIX "arm" /* Turn -march=xx into a CPU type. @@ -2734,7 +2914,7 @@ else if ((ESCAPED_CHAR) == '@') { \ (RESULT) += ASM_COMMENT_START; \ } - +#endif /* LLVM LOCAL end */ #endif /* ! GCC_ARM_H */ Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.opt Tue Jul 29 17:09:10 2008 @@ -98,17 +98,23 @@ Target Report RejectNegative InverseMask(BIG_END) Assume target CPU is configured as little endian +; APPLE LOCAL begin mlong-branch for arm mlong-branch Target Mask(LONG_CALLS) Alias for -mlong-calls +; APPLE LOCAL end mlong-branch for arm +; APPLE LOCAL begin mlong-branch for arm mlong-calls Target Report Mask(LONG_CALLS) MaskExists Generate call insns as indirect calls, if necessary +; APPLE LOCAL end mlong-branch for arm +; APPLE LOCAL begin mlong-branch for arm mlongcall Target Mask(LONG_CALLS) MaskExists Alias for -mlong-calls +; APPLE LOCAL end mlong-branch for arm mpic-register= Target RejectNegative Joined Var(arm_pic_register_string) @@ -163,3 +169,9 @@ mwords-little-endian Target Report RejectNegative Mask(LITTLE_WORDS) Assume big endian bytes, little endian words + +; APPLE LOCAL begin 5946347 ms_struct support +mms-bitfields +Target Report Mask(MS_BITFIELD_LAYOUT) +Use Microsoft structure layout +; APPLE LOCAL end 5946347 ms_struct support Modified: llvm-gcc-4.2/trunk/gcc/config/arm/bpabi.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/bpabi.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/bpabi.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/bpabi.h Tue Jul 29 17:09:10 2008 @@ -35,9 +35,13 @@ /* EABI targets should enable interworking by default. */ #undef TARGET_DEFAULT -/* LLVM Local begin */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #define TARGET_DEFAULT (0) -/* LLVM Local end */ +#else +#define TARGET_DEFAULT MASK_INTERWORK +#endif +/* LLVM LOCAL end */ /* The ARM BPABI functions return a boolean; they use no special calling convention. */ Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Tue Jul 29 17:09:10 2008 @@ -28,14 +28,15 @@ #undef CC1_SPEC #define CC1_SPEC "% 10.5 mmacosx-version-min= -lgcc_s.10.4) \ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \ @@ -491,19 +550,27 @@ { "darwin_dylib1", DARWIN_DYLIB1_SPEC }, \ { "darwin_minversion", DARWIN_MINVERSION_SPEC }, \ /* APPLE LOCAL end mainline */ \ -/* APPLE LOCAL begin ARM 5342595 */ \ - { "darwin_dsymutil", DARWIN_DSYMUTIL_SPEC }, -/* APPLE LOCAL end ARM 5342595 */ - -/* APPLE LOCAL begin mainline */ +/* APPLE LOCAL begin ARM 5683689 */ \ + { "darwin_cc1_minversion", DARWIN_CC1_MINVERSION_SPEC }, \ + { "darwin_ld_minversion", DARWIN_LD_MINVERSION_SPEC }, \ +/* APPLE LOCAL end ARM 5683689 */ \ +/* APPLE LOCAL ARM 5681645 */ \ + { "darwin_iphoneos_libgcc", DARWIN_IPHONEOS_LIBGCC_SPEC }, + +/* APPLE LOCAL begin ARM 5683689 */ #define DARWIN_DYLIB1_SPEC \ - "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ - %:version-compare(>= 10.5 mmacosx-version-min= -ldylib1.10.5.o)" + "%{miphoneos-version-min=*: -ldylib1.o} \ + %{!miphoneos-version-min=*: \ + %:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ + %:version-compare(>= 10.5 mmacosx-version-min= -ldylib1.10.5.o)}" #define DARWIN_CRT1_SPEC \ - "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ - %:version-compare(>= 10.5 mmacosx-version-min= -lcrt1.10.5.o)" -/* APPLE LOCAL end mainline */ +/* APPLE LOCAL ARM 5823776 iphoneos should use crt1.o */ \ + "%{miphoneos-version-min=*: -lcrt1.o} \ + %{!miphoneos-version-min=*: \ + %:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ + %:version-compare(>= 10.5 mmacosx-version-min= -lcrt1.10.5.o)}" +/* APPLE LOCAL end ARM 5683689 */ /* Default Darwin ASM_SPEC, very simple. */ /* APPLE LOCAL begin radar 4161346 */ @@ -517,13 +584,19 @@ #define DBX_DEBUGGING_INFO 1 /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Prefer DWARF only if appropriate dsymutil is available. */ - #define DWARF2_DEBUGGING_INFO +#define DWARF2_DEBUGGING_INFO #ifdef HAVE_DSYMUTIL #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG #else #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG #endif +#else +/* Prefer DWARF2. */ +#define DWARF2_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG +#endif /* LLVM LOCAL end */ /* APPLE LOCAL end mainline 4.3 2006-10-31 4370143 */ @@ -591,6 +664,7 @@ } while (0) /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* As in the warning above, alias definitions aren't supported on Mach-O. */ #define TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS @@ -608,6 +682,7 @@ (FN)->setLinkage(Function::ExternalLinkage); \ } \ } while (0) +#endif /* LLVM LOCAL end */ /* Darwin has the pthread routines in libSystem, which every program @@ -701,7 +776,10 @@ #undef OBJC_FLAG_ZEROCOST_EXCEPTIONS #define OBJC_FLAG_ZEROCOST_EXCEPTIONS \ do { \ - if (strverscmp (darwin_macosx_version_min, "10.5") < 0) \ + /* APPLE LOCAL begin ARM 5683689 */ \ + if (darwin_macosx_version_min \ + && strverscmp (darwin_macosx_version_min, "10.5") < 0) \ + /* APPLE LOCAL end ARM 5683689 */ \ error ("Mac OS X version 10.5 or later is needed for zerocost-exceptions"); \ } while (0) /* APPLE LOCAL end radar 5023725 */ @@ -729,6 +807,10 @@ } \ if (flag_objc_abi == -1) \ flag_objc_abi = (flag_next_runtime && TARGET_64BIT) ? 2 : 1; \ + /* APPLE LOCAL begin ARM hybrid objc-2.0 */ \ + if (flag_objc_legacy_dispatch == -1) \ + flag_objc_legacy_dispatch = (flag_objc_abi < 2); \ + /* APPLE LOCAL end ARM hybrid objc-2.0 */ \ /* APPLE LOCAL begin radar 2848255 */ \ /* APPLE LOCAL begin radar 5023725 */ \ if (flag_objc_abi == 2) \ @@ -745,14 +827,29 @@ flag_objc_abi = 2; /* recover */ \ } \ /* APPLE LOCAL end radar 2848255 */ \ + /* APPLE LOCAL begin 5660282 */ \ + if (darwin_iphoneos_version_min && flag_objc_gc) \ + { \ + warning (0, "-fobjc-gc not supported for iPhone OS; ignoring.");\ + flag_objc_gc = 0; \ + } \ + if (darwin_iphoneos_version_min && flag_objc_gc_only) \ + { \ + warning (0, "-fobjc-gc-only not supported for iPhone OS; ignoring.");\ + flag_objc_gc_only = 0; \ + } \ + /* APPLE LOCAL end 5660282 */ \ } while (0) /* APPLE LOCAL end radar 4862848 */ /* APPLE LOCAL begin radar 4531086 */ #undef OBJC_WARN_OBJC2_FEATURES #define OBJC_WARN_OBJC2_FEATURES(MESSAGE) \ + /* APPLE LOCAL begin ARM 5683689 */ \ do { \ - if (strverscmp (darwin_macosx_version_min, "10.5") < 0) \ + if (darwin_macosx_version_min \ + && strverscmp (darwin_macosx_version_min, "10.5") < 0) \ + /* APPLE LOCAL end ARM 5683689 */ \ warning (0, "Mac OS X version 10.5 or later is needed for use of %s", \ MESSAGE); \ } while (0) @@ -1092,32 +1189,40 @@ } \ } while (0) +/* APPLE LOCAL begin ARM 5603763 */ +/* Given a symbol name, remove quotes, prefix it with "L", suffix it + with SUFFIX, and re-apply quotes if needed. */ + +#define GEN_SUFFIXED_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH,SUFFIX) \ + do { \ + const char *symbol_ = (SYMBOL); \ + char *buffer_ = (BUF); \ + if (symbol_[0] == '"') \ + { \ + strcpy (buffer_, "\"L"); \ + strcpy (buffer_ + 2, symbol_ + 1); \ + strcpy (buffer_ + (SYMBOL_LENGTH), SUFFIX "\""); \ + } \ + else if (name_needs_quotes (symbol_)) \ + { \ + strcpy (buffer_, "\"L"); \ + strcpy (buffer_ + 2, symbol_); \ + strcpy (buffer_ + (SYMBOL_LENGTH) + 2, SUFFIX "\""); \ + } \ + else \ + { \ + strcpy (buffer_, "L"); \ + strcpy (buffer_ + 1, symbol_); \ + strcpy (buffer_ + (SYMBOL_LENGTH) + 1, SUFFIX); \ + } \ + } while (0) + /* Given a symbol name string, create the lazy pointer version of the symbol name. */ #define GEN_LAZY_PTR_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \ - do { \ - const char *symbol_ = (SYMBOL); \ - char *buffer_ = (BUF); \ - if (symbol_[0] == '"') \ - { \ - strcpy (buffer_, "\"L"); \ - strcpy (buffer_ + 2, symbol_ + 1); \ - strcpy (buffer_ + (SYMBOL_LENGTH), "$lazy_ptr\""); \ - } \ - else if (name_needs_quotes (symbol_)) \ - { \ - strcpy (buffer_, "\"L"); \ - strcpy (buffer_ + 2, symbol_); \ - strcpy (buffer_ + (SYMBOL_LENGTH) + 2, "$lazy_ptr\""); \ - } \ - else \ - { \ - strcpy (buffer_, "L"); \ - strcpy (buffer_ + 1, symbol_); \ - strcpy (buffer_ + (SYMBOL_LENGTH) + 1, "$lazy_ptr"); \ - } \ - } while (0) + GEN_SUFFIXED_NAME_FOR_SYMBOL (BUF, SYMBOL, SYMBOL_LENGTH, "$lazy_ptr") +/* APPLE LOCAL end ARM 5603763 */ #define EH_FRAME_SECTION_NAME "__TEXT" #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support" @@ -1168,8 +1273,10 @@ #define HANDLE_PRAGMA_PACK_PUSH_POP 1 /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* Handle pragma pack separately */ #define TARGET_OVERRIDE_PRAGMA_PACK_HANDLER 1 +#endif /* LLVM LOCAL end */ #define DARWIN_REGISTER_TARGET_PRAGMAS() \ @@ -1297,7 +1404,6 @@ darwin_handle_c_option (CODE, ARG, VALUE) /* APPLE LOCAL end iframework for 4.3 4094959 */ - /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION - Given a VAR_DECL for a global @@ -1434,11 +1540,23 @@ /* APPLE LOCAL begin mainline 2007-06-14 5235474 */ #ifndef CROSS_DIRECTORY_STRUCTURE -extern void darwin_default_min_version (int * argc, char *** argv); +/* APPLE LOCAL begin ARM 5683689 */ +/* LLVM FIXME: Uncomment!!! */ +#if 0 +extern void darwin_default_min_version (int * argc, char *** argv, + enum darwin_version_type vers_type); #define GCC_DRIVER_HOST_INITIALIZATION \ /* APPLE LOCAL isysroot 5083137 */ \ GCC_DRIVER_HOST_INITIALIZATION1; \ - darwin_default_min_version (&argc, &argv) + darwin_default_min_version (&argc, &argv, DARWIN_DEFAULT_VERSION_TYPE) +/* APPLE LOCAL end ARM 5683689 */ +#else +extern void darwin_default_min_version (int * argc, char *** argv); +#define GCC_DRIVER_HOST_INITIALIZATION \ + /* APPLE LOCAL isysroot 5083137 */ \ + GCC_DRIVER_HOST_INITIALIZATION1; \ + darwin_default_min_version (&argc, &argv) +#endif #endif /* CROSS_DIRECTORY_STRUCTURE */ /* APPLE LOCAL end mainline 2007-06-14 5235474 */ Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.opt?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.opt (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.opt Tue Jul 29 17:09:10 2008 @@ -23,15 +23,15 @@ Target Report Var(darwin_fix_and_continue) Generate code suitable for fast turn around debugging -; APPLE LOCAL begin mainline 2007-02-20 5005743 -; The Init here is for the convenience of GCC developers, so that -; cc1 and cc1plus don't crash if no -mmacosx-version-min is passed. The -; driver will always pass a -mmacosx-version-min, so in normal use -; the Init is never used. +; APPLE LOCAL begin ARM 5683689 mmacosx-version-min= -Target Joined Report Var(darwin_macosx_version_min) Init("10.1") +Target Joined Report Var(darwin_macosx_version_min) Init(NULL) The earliest MacOS X version on which this program will run -; APPLE LOCAL end mainline 2007-02-20 5005743 + +miphoneos-version-min= +Target Joined Report Var(darwin_iphoneos_version_min) Init(NULL) +The earliest iPhone OS version on which this program will run +; APPLE LOCAL end ARM 5683689 mone-byte-bool Target RejectNegative Report Var(darwin_one_byte_bool) Modified: llvm-gcc-4.2/trunk/gcc/config/freebsd.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/freebsd.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/freebsd.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/freebsd.h Tue Jul 29 17:09:10 2008 @@ -87,5 +87,7 @@ #define TARGET_POSIX_IO /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #define HANDLE_PRAGMA_PACK_PUSH_POP +#endif /* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Tue Jul 29 17:09:10 2008 @@ -97,8 +97,8 @@ #define CC1_SPEC "%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ "/* APPLE LOCAL ARM ignore -mthumb and -mno-thumb */"\ %= 0) + (darwin_iphoneos_version_min || \ + strverscmp (darwin_macosx_version_min, "10.4") >= 0) +/* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL end track initialization status 4964532 */ /* This needs to move since i386 uses the first flag and other flags are Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin64.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin64.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/darwin64.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin64.h Tue Jul 29 17:09:10 2008 @@ -30,6 +30,7 @@ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ + /* APPLE LOCAL 6015949 */ \ DARWIN_EXTRA_SPECS \ { "darwin_arch", DARWIN_ARCH_SPEC }, \ { "darwin_crt2", "" }, \ Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h Tue Jul 29 17:09:10 2008 @@ -175,8 +175,11 @@ extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -/* LLVM LOCAL make this global */ +/* LLVM LOCAL - begin make this global */ +#ifdef ENABLE_LLVM extern bool contains_128bit_aligned_vector_p (tree); +#endif +/* LLVM LOCAL - end make this global */ extern rtx ix86_function_value (tree, tree, bool); #endif Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Tue Jul 29 17:09:10 2008 @@ -35,7 +35,6 @@ that start with ASM_ or end in ASM_OP. */ /* LLVM LOCAL begin */ - #ifdef ENABLE_LLVM /* Add general target specific stuff */ @@ -65,7 +64,6 @@ }; #endif /* ENABLE_LLVM */ - /* LLVM LOCAL end */ /* Define the specific costs for a given cpu */ @@ -306,12 +304,12 @@ it's analogous to similar code for Mach-O on PowerPC. darwin.h redefines this to 1. */ #define TARGET_MACHO 0 - /* LLVM LOCAL begin mainline */ +#ifdef ENABLE_LLVM /* Likewise, for the Windows 64-bit ABI. */ #define TARGET_64BIT_MS_ABI 0 +#endif /* LLVM LOCAL end mainline */ - /* APPLE LOCAL begin mach-o cleanup */ #define MACHOPIC_INDIRECT 0 #define MACHOPIC_PURE 0 @@ -386,6 +384,14 @@ #endif #endif +/* LLVM LOCAL begin PR879 workaround */ +#ifdef ENABLE_LLVM +#define LLVM_CPP_BUILTINS builtin_define("__NO_MATH_INLINES"); +#else +#define LLVM_CPP_BUILTINS +#endif +/* LLVM LOCAL end PR879 workaround */ + /* Target CPU builtins. */ #define TARGET_CPU_CPP_BUILTINS() \ do \ @@ -555,9 +561,9 @@ builtin_define ("__core2__"); \ } \ /* APPLE LOCAL end mainline */ \ - /* LLVM LOCAL begin PR879 workaround */ \ - builtin_define("__NO_MATH_INLINES"); \ - /* LLVM LOCAL end PR879 workaround */ \ + /* LLVM LOCAL begin PR879 workaround */ \ + LLVM_CPP_BUILTINS \ + /* LLVM LOCAL end PR879 workaround */ \ } \ while (0) @@ -1113,10 +1119,12 @@ #define REAL_PIC_OFFSET_TABLE_REGNUM 3 #define PIC_OFFSET_TABLE_REGNUM \ + /* APPLE LOCAL begin 5695218 */ \ ((TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC) \ - || !flag_pic ? INVALID_REGNUM \ - : reload_completed ? REGNO (pic_offset_table_rtx) \ - : REAL_PIC_OFFSET_TABLE_REGNUM) + || !flag_pic ? INVALID_REGNUM \ + : reload_completed && pic_offset_table_rtx ? REGNO (pic_offset_table_rtx) \ + : REAL_PIC_OFFSET_TABLE_REGNUM) \ + /* APPLE LOCAL end 5695218 */ #define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_" @@ -2514,6 +2522,8 @@ { "adc", 2, "ir,m" }, \ { "add", 1, "+rm,r" }, \ { "add", 2, "ir,m" }, \ + { "addpd", 1, "+x"}, \ + { "addpd", 2, "xm"}, \ { "addps", 1, "+x"}, \ { "addps", 2, "xm"}, \ { "addsd", 1, "+x"}, \ @@ -3271,7 +3281,7 @@ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_FAR_ADDR) != 0) /* LLVM LOCAL begin */ - +#ifdef ENABLE_LLVM /* Codes for all the SSE/MMX builtins. */ enum ix86_builtins { @@ -3893,6 +3903,7 @@ #define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \ DESTTY, OPS) \ TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); +#endif /* ENABLE_LLVM */ /* LLVM LOCAL end */ /* Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Tue Jul 29 17:09:10 2008 @@ -79,9 +79,11 @@ #define C_COMMON_OVERRIDE_OPTIONS do { \ /* On powerpc, __cxa_get_exception_ptr is available starting in the \ 10.4.6 libstdc++.dylib. */ \ -/* APPLE LOCAL begin mainline 2007-02-20 5005743 */ \ - if (strverscmp (darwin_macosx_version_min, "10.4.6") < 0 \ -/* APPLE LOCAL end mainline 2007-02-20 5005743 */ \ +/* APPLE LOCAL begin ARM 5683689 */ \ + if (!darwin_iphoneos_version_min \ + && (!darwin_macosx_version_min \ + || strverscmp (darwin_macosx_version_min, "10.4.6") < 0) \ +/* APPLE LOCAL end 5683689 */ \ && flag_use_cxa_get_exception_ptr == 2) \ flag_use_cxa_get_exception_ptr = 0; \ /* APPLE LOCAL begin 5731065 */ \ @@ -98,6 +100,7 @@ #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 + /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ @@ -108,8 +111,8 @@ % 10.4 mmacosx-version-min= crt2.o%s)}" + "%{!m64: %{mmacosx-version-min=*: \ + %:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s)}}" +/* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL begin mainline 2007-03-13 5005743 5040758 */ \ /* Determine a minimum version based on compiler options. */ @@ -151,16 +157,33 @@ :10.1}" /* APPLE LOCAL end mainline 2007-03-13 5040758 5005743 */ +/* APPLE LOCAL begin ARM 5683689 */ +/* Default cc1 option for specifying minimum version number. */ +#define DARWIN_CC1_MINVERSION_SPEC "-mmacosx-version-min=%(darwin_minversion)" + +/* Default ld option for specifying minimum version number. */ +#define DARWIN_LD_MINVERSION_SPEC "-macosx_version_min %(darwin_minversion)" + +/* Use macosx version numbers by default. */ +#define DARWIN_DEFAULT_VERSION_TYPE DARWIN_VERSION_MACOSX +/* APPLE LOCAL end ARM 5683689 */ + +/* APPLE LOCAL ARM 5681645 */ +#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc_s.10.5 -lgcc" + /* APPLE LOCAL begin 5342595 */ /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #ifdef HAVE_DSYMUTIL #define DARWIN_DSYMUTIL_SPEC \ "%{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}" #else #define DARWIN_DSYMUTIL_SPEC "" #endif +#endif /* LLVM LOCAL end */ /* APPLE LOCAL end 5342595 */ + /* APPLE LOCAL begin mainline */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -545,9 +568,10 @@ (flag_next_runtime \ && flag_objc_direct_dispatch != 0 \ && !TARGET_64BIT \ -/* APPLE LOCAL begin mainline 2007-02-20 5005743 */ \ - && (strverscmp (darwin_macosx_version_min, "10.4") >= 0 \ -/* APPLE LOCAL end mainline 2007-02-20 5005743 */ \ +/* APPLE LOCAL begin ARM 5683689 */ \ + && (darwin_iphoneos_version_min \ + || strverscmp (darwin_macosx_version_min, "10.4") >= 0 \ +/* APPLE LOCAL end ARM 5683689 */ \ || flag_objc_direct_dispatch == 1)) /* This is the reserved direct dispatch address for Objective-C. */ @@ -563,15 +587,18 @@ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS \ (TARGET_64BIT \ -/* APPLE LOCAL begin mainline 2007-02-20 5005743 */ \ + /* APPLE LOCAL begin ARM 5683689 */ \ + || darwin_iphoneos_version_min \ || strverscmp (darwin_macosx_version_min, "10.3") >= 0) - -/* APPLE LOCAL end mainline 2007-02-20 5005743 */ \ + /* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL begin track initialization status 4964532 */ +/* APPLE LOCAL begin ARM 5683689 */ #undef TARGET_DWARF_UNINIT_VARS -#define TARGET_DWARF_UNINIT_VARS \ - (strverscmp (darwin_macosx_version_min, "10.4") >= 0) +#define TARGET_DWARF_UNINIT_VARS \ + (darwin_iphoneos_version_min \ + || (strverscmp (darwin_macosx_version_min, "10.4") >= 0)) +/* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL end track initialization status 4964532 */ /* When generating kernel code or kexts, we don't use Altivec by Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h Tue Jul 29 17:09:10 2008 @@ -216,7 +216,9 @@ }; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM extern const char *rs6000_cpu_target; +#endif /* LLVM LOCAL end */ extern enum processor_type rs6000_cpu; @@ -638,7 +640,7 @@ We must map them here to avoid huge unwinder tables mostly consisting of unused space. */ /* APPLE LOCAL begin 3399553 */ -#define DWARF_REG_TO_UNWIND_COLUMN(r) \ +#define DWARF_REG_TO_UNWIND_COLUMN(r) \ ((r) > 1200 ? ((r) - 1200 + LAST_PHYSICAL_REGISTER) : (r)) /* APPLE LOCAL end 3399553 */ @@ -1212,9 +1214,13 @@ On the RS/6000, we grow upwards, from the area after the outgoing arguments. */ -/* LLVM LOCAL begin stack protector */ +/* LLVM LOCAL - begin stack protector */ +#ifdef ENABLE_LLVM #define FRAME_GROWS_DOWNWARD 0 -/* LLVM LOCAL end stack protector */ +#else +#define FRAME_GROWS_DOWNWARD (flag_stack_protect != 0) +#endif +/* LLVM LOCAL - end stack protector */ /* Size of the outgoing register save area */ @@ -3450,6 +3456,7 @@ /* APPLE LOCAL end CW asm blocks */ /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM #define LLVM_TARGET_INTRINSIC_PREFIX "ppc" /* Turn -march=xx into a CPU type. @@ -3511,7 +3518,7 @@ llvm_rs6000_should_return_vector_as_shadow((X), (isBuiltin)) #endif /* LLVM_ABI_H */ - +#endif /* ENABLE_LLVM */ /* LLVM LOCAL end */ enum rs6000_builtin_type_index Modified: llvm-gcc-4.2/trunk/gcc/convert.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/convert.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/convert.h (original) +++ llvm-gcc-4.2/trunk/gcc/convert.h Tue Jul 29 17:09:10 2008 @@ -26,5 +26,7 @@ extern tree convert_to_real (tree, tree); extern tree convert_to_complex (tree, tree); extern tree convert_to_vector (tree, tree); +/* APPLE LOCAL blocks */ +extern tree convert_to_block_pointer (tree, tree); #endif /* GCC_CONVERT_H */ Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.h Tue Jul 29 17:09:10 2008 @@ -149,10 +149,6 @@ #define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE #define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type -/* APPLE LOCAL begin define this sensibly in all languages */ -#undef LANG_HOOKS_FLAG_NO_BUILTIN -#define LANG_HOOKS_FLAG_NO_BUILTIN c_flag_no_builtin -/* APPLE LOCAL end define this sensibly in all languages */ #undef LANG_HOOKS_TO_TARGET_CHARSET #define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset #undef LANG_HOOKS_GIMPLIFY_EXPR Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h Tue Jul 29 17:09:10 2008 @@ -1066,6 +1066,12 @@ unsigned has_complex_assign_ref : 1; unsigned non_aggregate : 1; + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + unsigned has_nontrivial_destructor_body : 1; + unsigned destructor_nontrivial_because_of_base : 1; + unsigned destructor_triviality_final : 1; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ + /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If so, make sure to copy it in instantiate_class_template! */ @@ -1073,7 +1079,9 @@ /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ - unsigned dummy : 12; + /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ + unsigned dummy : 10; + /* APPLE LOCAL end omit calls to empty destructors 5559195 */ tree primary_base; VEC(tree_pair_s,gc) *vcall_indices; @@ -2453,6 +2461,8 @@ || TREE_CODE (TYPE) == ENUMERAL_TYPE \ || ARITHMETIC_TYPE_P (TYPE) \ || TYPE_PTR_P (TYPE) \ + /* APPLE LOCAL blocks 6040305 */ \ + || TREE_CODE (TYPE) == BLOCK_POINTER_TYPE \ || TYPE_PTRMEMFUNC_P (TYPE)) /* [dcl.init.aggr] @@ -2534,6 +2544,20 @@ #define TYPE_HAS_NONTRIVIAL_DESTRUCTOR(NODE) \ (TYPE_LANG_FLAG_4 (NODE)) +/* APPLE LOCAL begin omit calls to empty destructors 5559195 */ +/* One if the body of the destructor of class type NODE has been shown to do + nothing, else zero. */ +#define CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_nontrivial_destructor_body) + +/* One if destructor of this type must be called by its base classes because + one of its base classes' destructors must be called. */ +#define CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->destructor_nontrivial_because_of_base) + +/* One if the values of CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE + and CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY are final. */ +#define CLASSTYPE_DESTRUCTOR_TRIVIALITY_FINAL(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->destructor_triviality_final) +/* APPLE LOCAL end omit calls to empty destructors 5559195 */ + /* Nonzero for class type means that copy initialization of this type can use a bitwise copy. */ #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \ @@ -3726,6 +3750,8 @@ cdk_pointer, cdk_reference, cdk_ptrmem, + /* APPLE LOCAL blocks 6040305 (ch) */ + cdk_block_pointer, cdk_error } cp_declarator_kind; @@ -3794,6 +3820,13 @@ /* For cdk_ptrmem, the class type containing the member. */ tree class_type; } pointer; + /* APPLE LOCAL begin blocks 6040305 (ch) */ + /* For cdk_block_pointer. */ + struct { + /* The cv-qualifiers for the pointer. */ + cp_cv_quals qualifiers; + } block_pointer; + /* APPLE LOCAL end blocks 6040305 (ch) */ } u; }; @@ -4122,7 +4155,6 @@ extern void yyhook (int); extern bool cxx_init (void); extern void cxx_finish (void); -extern bool in_main_input_context (void); /* in method.c */ extern void init_method (void); @@ -4205,7 +4237,6 @@ extern bool reregister_specialization (tree, tree, tree); extern tree fold_non_dependent_expr (tree); extern bool explicit_class_specialization_p (tree); -extern tree outermost_tinst_level (void); /* in repo.c */ extern void init_repo (void); @@ -4630,6 +4661,8 @@ /* APPLE LOCAL end radar 2848255 */ /* APPLE LOCAL radar 5355344 */ extern bool cp_objc_protocol_id_list (tree); +/* APPLE LOCAL radar 6029624 */ +extern bool objcp_reference_related_p (tree, tree); /* -- end of C++ */ @@ -4650,4 +4683,9 @@ /* APPLE LOCAL radar 5741070 */ extern tree c_return_interface_record_type (tree); +/* APPLE LOCAL begin block 6040305 (cg) */ +extern cp_declarator* make_block_pointer_declarator (tree, cp_cv_quals, + cp_declarator *); +/* APPLE LOCAL end block 6040305 (cg) */ + #endif /* ! GCC_CP_TREE_H */ Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.h Tue Jul 29 17:09:10 2008 @@ -36,3 +36,6 @@ enum decl_context, int, tree*); /* APPLE LOCAL radar 4721858 */ extern void emit_instantiate_pending_templates (location_t *); +/* APPLE LOCAL blocks 6040305 (ce) */ +/* LLVM FIXME: Uncomment!!! */ +/*extern tree grokparms (cp_parameter_declarator *first_parm, tree *parms); */ Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/name-lookup.h Tue Jul 29 17:09:10 2008 @@ -76,6 +76,8 @@ cxx_scope *scope; unsigned value_is_inherited : 1; unsigned is_local : 1; + /* APPLE LOCAL blocks 6040305 (ch) */ + unsigned declared_in_block : 1; }; /* Datatype used to temporarily save C++ bindings (for implicit @@ -311,7 +313,9 @@ extern void push_binding_level (struct cp_binding_level *); extern void push_namespace (tree); -extern void push_namespace_with_attribs (tree, tree); +/* APPLE LOCAL visibility 5805832 */ +/* LLVM FIXME: Uncomment !!! */ +/* extern bool push_namespace_with_attribs (tree, tree); */ extern void pop_namespace (void); extern void push_nested_namespace (tree); extern void pop_nested_namespace (tree); Modified: llvm-gcc-4.2/trunk/gcc/defaults.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/defaults.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/defaults.h (original) +++ llvm-gcc-4.2/trunk/gcc/defaults.h Tue Jul 29 17:09:10 2008 @@ -920,4 +920,22 @@ #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1 #endif +/* APPLE LOCAL begin ARM compact switch tables */ +/* Extra cases to add to switch tables. */ +#ifndef TARGET_EXTRA_CASES +#define TARGET_EXTRA_CASES 0 +#endif +/* APPLE LOCAL end ARM compact switch tables */ + +/* APPLE LOCAL begin 5946347 ms_struct support */ +/* On most machines, the default type alignment is sufficient */ +#ifndef TARGET_FIELD_MS_STRUCT_ALIGN +#define TARGET_FIELD_MS_STRUCT_ALIGN(FIELD) TYPE_ALIGN (TREE_TYPE (FIELD)) +#endif +#ifndef BIGGEST_MS_STRUCT_ALIGNMENT +#define BIGGEST_MS_STRUCT_ALIGNMENT BIGGEST_ALIGNMENT +#endif + +/* APPLE LOCAL end 5946347 ms_struct support */ + #endif /* ! GCC_DEFAULTS_H */ Modified: llvm-gcc-4.2/trunk/gcc/dwarf2.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2.h (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2.h Tue Jul 29 17:09:10 2008 @@ -389,9 +389,14 @@ /* Apple extensions. */ /* APPLE LOCAL begin radar 2338865 optimization notification */ DW_AT_APPLE_optimized = 0x3fe1, - DW_AT_APPLE_flags = 0x3fe2 + DW_AT_APPLE_flags = 0x3fe2, /* APPLE LOCAL end radar 2338865 optimization notification */ /* APPLE LOCAL end option verifier 4957887 */ + /* APPLE LOCAL differentiate between arm & thumb. */ + /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks */ + DW_AT_APPLE_isa = 0x3fe3, + DW_AT_APPLE_block = 0x3fe4 + /* APPLE LOCAL end radar 5811943 - Fix type of pointers to blocks */ }; #define DW_AT_lo_user 0x2000 /* Implementation-defined range start. */ Modified: llvm-gcc-4.2/trunk/gcc/except.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/except.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/except.h (original) +++ llvm-gcc-4.2/trunk/gcc/except.h Tue Jul 29 17:09:10 2008 @@ -118,11 +118,13 @@ extern bool verify_eh_edges (tree); /* LLVM local begin */ +#ifdef ENABLE_LLVM extern int classify_eh_handler (struct eh_region *); extern struct eh_region *get_eh_next_catch (struct eh_region *); extern struct eh_region *get_eh_region (unsigned); extern tree get_eh_type_list (struct eh_region *); extern tree lookup_type_for_runtime (tree); +#endif /* LLVM local end */ /* If non-NULL, this is a function that returns an expression to be @@ -140,13 +142,14 @@ extern tree (*lang_eh_runtime_type) (tree); /* LLVM local begin */ +#ifdef ENABLE_LLVM /* If non-NULL, this function returns a type that covers all others, a "catch-all" type. It may also return NULL_TREE, indicating that the null runtime object catches all types, as in C++. */ extern tree (*lang_eh_catch_all) (void); +#endif /* LLVM local end */ - /* Just because the user configured --with-sjlj-exceptions=no doesn't mean that we can use call frame exceptions. Detect that the target has appropriate support. */ Modified: llvm-gcc-4.2/trunk/gcc/flags.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flags.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/flags.h (original) +++ llvm-gcc-4.2/trunk/gcc/flags.h Tue Jul 29 17:09:10 2008 @@ -238,9 +238,11 @@ extern int align_labels_max_skip; extern int align_functions_log; -/* Like align_functions_log above, but used by front-ends to force the - minimum function alignment. Zero means no alignment is forced. */ +/* APPLE LOCAL begin mainline aligned functions 5933878 */ +/* LLVM FIXME: Remove next line!! */ extern int force_align_functions_log; +/* Removed extern force_align_functions_log. */ +/* APPLE LOCAL end mainline aligned functions 5933878 */ /* Nonzero if we dump in VCG format, not plain text. */ extern int dump_for_graph; @@ -388,7 +390,10 @@ /* Whether to emit an overflow warning whose code is C. */ #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c)) -/* LLVM LOCAL */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM extern int flag_llvm_pch_read; +#endif +/* LLVM LOCAL end */ #endif /* ! GCC_FLAGS_H */ Modified: llvm-gcc-4.2/trunk/gcc/function.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/function.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/function.h (original) +++ llvm-gcc-4.2/trunk/gcc/function.h Tue Jul 29 17:09:10 2008 @@ -460,6 +460,10 @@ unsigned int uses_vector : 1; /* APPLE LOCAL end 3837835 */ + /* APPLE LOCAL begin ARM compact switch tables */ + unsigned int needs_4byte_alignment : 1; + /* APPLE LOCAL end ARM compact switch tables */ + /* APPLE LOCAL begin ARM reliable backtraces */ unsigned int calls_builtin_ret_addr : 1; unsigned int calls_builtin_frame_addr : 1; @@ -605,4 +609,6 @@ extern void used_types_insert (tree); +/* APPLE LOCAL radar 5732232 - blocks */ +extern struct block_sema_info *cur_block; #endif /* GCC_FUNCTION_H */ Modified: llvm-gcc-4.2/trunk/gcc/gcc.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gcc.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gcc.h (original) +++ llvm-gcc-4.2/trunk/gcc/gcc.h Tue Jul 29 17:09:10 2008 @@ -52,6 +52,8 @@ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \ || !strcmp (STR, "isysroot") \ + /* APPLE LOCAL ARM iwithsysroot 4917039 */ \ + || !strcmp (STR, "iwithsysroot") \ || !strcmp (STR, "-param") || !strcmp (STR, "specs") \ || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ")) Modified: llvm-gcc-4.2/trunk/gcc/ginclude/tgmath.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ginclude/tgmath.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ginclude/tgmath.h (original) +++ llvm-gcc-4.2/trunk/gcc/ginclude/tgmath.h Tue Jul 29 17:09:10 2008 @@ -83,25 +83,32 @@ #define __TGMATH_CPLX(z,R,C) \ __builtin_choose_expr (__tg_cplx(z), \ __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), \ - __tg_choose (z, R##f(z), (R)(z), R##l(z))) + /* APPLE LOCAL shorten-64-to-32 4604239 */ \ + __tg_choose (z, R##f((float)(z)), (R)(z), R##l(z))) #define __TGMATH_CPLX_2(z1,z2,R,C) \ __builtin_choose_expr (__tg_cplx(z1) || __tg_cplx(z2), \ __tg_choose_2 (__real__(z1), __real__(z2), \ C##f(z1,z2), (C)(z1,z2), C##l(z1,z2)), \ __tg_choose_2 (z1, z2, \ - R##f(z1,z2), (R)(z1,z2), R##l(z1,z2))) + /* APPLE LOCAL shorten-64-to-32 5909621 */ \ + R##f((float)(z1),(float)(z2)), (R)(z1,z2), R##l(z1,z2))) #define __TGMATH_REAL(x,R) \ - __tg_choose (x, R##f(x), (R)(x), R##l(x)) + /* APPLE LOCAL shorten-64-to-32 5909621 */ \ + __tg_choose (x, R##f((float)(x)), (R)(x), R##l(x)) #define __TGMATH_REAL_2(x,y,R) \ - __tg_choose_2 (x, y, R##f(x,y), (R)(x,y), R##l(x,y)) + /* APPLE LOCAL shorten-64-to-32 4604239 */ \ + __tg_choose_2 (x, y, R##f((float)(x),(float)(y)), (R)(x,y), R##l(x,y)) #define __TGMATH_REAL_3(x,y,z,R) \ - __tg_choose_3 (x, y, z, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z)) + /* APPLE LOCAL shorten-64-to-32 5909621 */ \ + __tg_choose_3 (x, y, z, R##f((float)(x),(float)(y),(float)(z)), (R)(x,y,z), R##l(x,y,z)) #define __TGMATH_REAL_1_2(x,y,R) \ - __tg_choose (x, R##f(x,y), (R)(x,y), R##l(x,y)) + /* APPLE LOCAL shorten-64-to-32 5909621 */ \ + __tg_choose (x, R##f((float)(x),y), (R)(x,y), R##l(x,y)) #define __TGMATH_REAL_2_3(x,y,z,R) \ - __tg_choose_2 (x, y, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z)) + /* APPLE LOCAL shorten-64-to-32 5909621 */ \ + __tg_choose_2 (x, y, R##f((float)(x),(float)(y),z), (R)(x,y,z), R##l(x,y,z)) #define __TGMATH_CPLX_ONLY(z,C) \ __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)) Modified: llvm-gcc-4.2/trunk/gcc/gsyslimits.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gsyslimits.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gsyslimits.h (original) +++ llvm-gcc-4.2/trunk/gcc/gsyslimits.h Tue Jul 29 17:09:10 2008 @@ -4,5 +4,5 @@ instead of this text. */ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ -#include_next -#undef _GCC_NEXT_LIMITS_H +/* APPLE LOCAL begin 4401222 */ +/* APPLE LOCAL end 4401222 */ Modified: llvm-gcc-4.2/trunk/gcc/gthr-win32.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gthr-win32.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gthr-win32.h (original) +++ llvm-gcc-4.2/trunk/gcc/gthr-win32.h Tue Jul 29 17:09:10 2008 @@ -561,10 +561,13 @@ /* Windows32 thread local keys don't support destructors; this leads to leaks, especially in threaded applications making extensive use of C++ EH. Mingw uses a thread-support DLL to work-around this problem. */ -static inline int -__gthread_key_create (__gthread_key_t *key, /* LLVM LOCAL begin mainline */ - void (*dtor) (void *) __attribute__((unused))) +static inline int +__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *) +#ifdef ENABLE_LLVM + __attribute__((unused)) +#endif +) /* LLVM LOCAL end mainline */ { int status = 0; Modified: llvm-gcc-4.2/trunk/gcc/hard-reg-set.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/hard-reg-set.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/hard-reg-set.h (original) +++ llvm-gcc-4.2/trunk/gcc/hard-reg-set.h Tue Jul 29 17:09:10 2008 @@ -456,6 +456,18 @@ extern int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER]; #endif +/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */ +#ifdef DIMODE_REG_ALLOC_ORDER +/* Table of register numbers in the order in which to try to use them. */ + +extern int dimode_reg_alloc_order[FIRST_PSEUDO_REGISTER]; + +/* The inverse of dimode_reg_alloc_order. */ + +extern int dimode_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER]; +#endif +/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */ + /* For each reg class, a HARD_REG_SET saying which registers are in it. */ extern HARD_REG_SET reg_class_contents[N_REG_CLASSES]; Modified: llvm-gcc-4.2/trunk/gcc/langhooks-def.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/langhooks-def.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/langhooks-def.h (original) +++ llvm-gcc-4.2/trunk/gcc/langhooks-def.h Tue Jul 29 17:09:10 2008 @@ -135,8 +135,6 @@ #define LANG_HOOKS_TREE_SIZE lhd_tree_size #define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p #define LANG_HOOKS_BUILTIN_FUNCTION builtin_function -/* APPLE LOCAL define this sensibly for all languages */ -#define LANG_HOOKS_FLAG_NO_BUILTIN hook_bool_void_false #define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl #define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset #define LANG_HOOKS_INIT_TS lhd_do_nothing @@ -339,8 +337,6 @@ LANG_HOOKS_BUILTIN_FUNCTION, \ LANG_HOOKS_INIT_TS, \ LANG_HOOKS_EXPR_TO_DECL, \ -/* APPLE LOCAL define this sensibly for all languages */ \ - LANG_HOOKS_FLAG_NO_BUILTIN, \ } #endif /* GCC_LANG_HOOKS_DEF_H */ Modified: llvm-gcc-4.2/trunk/gcc/langhooks.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/langhooks.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/langhooks.h (original) +++ llvm-gcc-4.2/trunk/gcc/langhooks.h Tue Jul 29 17:09:10 2008 @@ -468,9 +468,6 @@ TREE_SIDE_EFFECTS need updating. */ tree (*expr_to_decl) (tree expr, bool *tc, bool *ti, bool *se); - /* APPLE LOCAL define this sensibly for all languages */ - bool (*flag_no_builtin)(void); - /* Whenever you add entries here, make sure you adjust langhooks-def.h and langhooks.c accordingly. */ }; Modified: llvm-gcc-4.2/trunk/gcc/libfuncs.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/libfuncs.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/libfuncs.h (original) +++ llvm-gcc-4.2/trunk/gcc/libfuncs.h Tue Jul 29 17:09:10 2008 @@ -20,8 +20,11 @@ #ifndef GCC_LIBFUNCS_H #define GCC_LIBFUNCS_H -/* LOCAL LLVM */ +/* LOCAL LLVM begin */ +#ifdef ENABLE_LLVM #include "tree.h" +#endif +/* LOCAL LLVM end */ /* Enumeration of indexes into libfunc_table. */ enum libfunc_index @@ -52,9 +55,11 @@ implicitly and not via optabs. */ extern GTY(()) rtx libfunc_table[LTI_MAX]; /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM /* FUNCTION_DECL nodes for the library functions that are called implicitly and not via optabs. */ extern GTY(()) tree llvm_libfunc_table[LTI_MAX]; +#endif /* LLVM LOCAL end */ /* Accessor macros for libfunc_table. */ Modified: llvm-gcc-4.2/trunk/gcc/limitx.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/limitx.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/limitx.h (original) +++ llvm-gcc-4.2/trunk/gcc/limitx.h Tue Jul 29 17:09:10 2008 @@ -1,12 +1,13 @@ /* This administrivia gets added to the beginning of limits.h if the system has its own version of limits.h. */ -/* We use _GCC_LIMITS_H_ because we want this not to match - any macros that the system's limits.h uses for its own purposes. */ -#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ -#define _GCC_LIMITS_H_ - +/* APPLE LOCAL begin 4401222 */ #ifndef _LIBC_LIMITS_H_ /* Use "..." so that we find syslimits.h only in this same directory. */ #include "syslimits.h" #endif +#ifdef _GCC_NEXT_LIMITS_H +#include_next +#undef _GCC_NEXT_LIMITS_H +#endif +/* APPLE LOCAL end 4401222 */ Modified: llvm-gcc-4.2/trunk/gcc/limity.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/limity.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/limity.h (original) +++ llvm-gcc-4.2/trunk/gcc/limity.h Tue Jul 29 17:09:10 2008 @@ -1,10 +1,2 @@ -/* This administrivia gets added to the end of limits.h - if the system has its own version of limits.h. */ - -#else /* not _GCC_LIMITS_H_ */ - -#ifdef _GCC_NEXT_LIMITS_H -#include_next /* recurse down to the real one */ -#endif - -#endif /* not _GCC_LIMITS_H_ */ +/* APPLE LOCAL begin 4401222 */ +/* APPLE LOCAL end 4401222 */ Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Jul 29 17:09:10 2008 @@ -70,6 +70,7 @@ #include "tree-inline.h" #include "langhooks.h" #include "cgraph.h" +#include "c-common.h" } // Non-zero if bytecode from PCH is successfully read. @@ -380,7 +381,7 @@ PM->add(createFunctionInliningPass()); // Inline small functions if (optimize > 2) PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args - if (!lang_hooks.flag_no_builtin()) + if (!flag_no_builtin) PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. PM->add(createJumpThreadingPass()); // Thread jumps. Modified: llvm-gcc-4.2/trunk/gcc/longlong.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/longlong.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/longlong.h (original) +++ llvm-gcc-4.2/trunk/gcc/longlong.h Tue Jul 29 17:09:10 2008 @@ -97,7 +97,7 @@ (E.g. WE32100, IBM360.) */ /* LLVM LOCAL begin */ -#if defined (__GNUC__) && !defined (NO_ASM) && !defined (__llvm__) +#if defined (__GNUC__) && !defined (NO_ASM) && (!defined (ENABLE_LLVM) || !defined (__llvm__)) /* LLVM LOCAL end */ /* We sometimes need to clobber "cc" with gcc2, but that would not be Modified: llvm-gcc-4.2/trunk/gcc/rtl.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/rtl.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/rtl.h (original) +++ llvm-gcc-4.2/trunk/gcc/rtl.h Tue Jul 29 17:09:10 2008 @@ -2266,6 +2266,8 @@ extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int); extern rtx get_reg_known_value (unsigned int); extern bool get_reg_known_equiv_p (unsigned int); +/* APPLE LOCAL 5695218 */ +extern rtx replace_regs (rtx, rtx *, unsigned int, int); #ifdef STACK_REGS extern int stack_regs_mentioned (rtx insn); Modified: llvm-gcc-4.2/trunk/gcc/sched-int.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sched-int.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/sched-int.h (original) +++ llvm-gcc-4.2/trunk/gcc/sched-int.h Tue Jul 29 17:09:10 2008 @@ -344,7 +344,6 @@ }; extern struct haifa_insn_data *h_i_d; - /* Used only if (current_sched_info->flags & USE_GLAT) != 0. These regsets store global_live_at_{start, end} information for each basic block. */ Modified: llvm-gcc-4.2/trunk/gcc/target-def.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/target-def.h?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/target-def.h (original) +++ llvm-gcc-4.2/trunk/gcc/target-def.h Tue Jul 29 17:09:10 2008 @@ -84,12 +84,6 @@ #define TARGET_ASM_TTYPE hook_bool_rtx_false #endif -/* LLVM LOCAL begin */ -#ifndef TARGET_ARM_TTYPE -#define TARGET_ASM_TTYPE hook_bool_rtx_false -#endif -/* LLVM LOCAL end */ - #ifndef TARGET_ASM_ASSEMBLE_VISIBILITY #define TARGET_ASM_ASSEMBLE_VISIBILITY default_assemble_visibility #endif @@ -511,16 +505,6 @@ #define TARGET_ARM_EABI_UNWINDER false -/* APPLE LOCAL begin mainline 2005-10-12 */ -#ifndef TARGET_VALID_DLLIMPORT_ATTRIBUTE_P -#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P hook_bool_tree_true -#endif -/* APPLE LOCAL end mainline 2005-10-12 */ - -/* LLVM LOCAL begin */ -#define TARGET_ARM_EABI_UNWINDER false -/* LLVM LOCAL end */ - #define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_false #define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_false #define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_false @@ -600,11 +584,6 @@ #define TARGET_SECONDARY_RELOAD default_secondary_reload #endif -/* LLVM LOCAL begin */ -#ifndef TARGET_UNWIND_TABLES_DEFAULT -#define TARGET_UNWIND_TABLES_DEFAULT false -#endif -/* LLVM LOCAL end */ /* C++ specific. */ #ifndef TARGET_CXX_GUARD_TYPE Modified: llvm-gcc-4.2/trunk/gcc/tree.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.def?rev=54175&r1=54174&r2=54175&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.def (original) +++ llvm-gcc-4.2/trunk/gcc/tree.def Tue Jul 29 17:09:10 2008 @@ -177,6 +177,11 @@ automatically to the value it points to. Used in C++. */ DEFTREECODE (REFERENCE_TYPE, "reference_type", tcc_type, 0) +/* APPLE LOCAL begin radar 5732232 - blocks */ +/* All pointer-to-block types have code BLOCK_POINTER_TYPE. + The TREE_TYPE points to the node for the type pointed to. */ +DEFTREECODE (BLOCK_POINTER_TYPE, "block_pointer_type", tcc_type, 0) +/* APPLE LOCAL end radar 5732232 - blocks */ /* The ordering of the following codes is optimized for the checking macros in tree.h. Changing the order will degrade the speed of the compiler. COMPLEX_TYPE, VECTOR_TYPE, ARRAY_TYPE. */ From baldrick at free.fr Tue Jul 29 15:56:02 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jul 2008 20:56:02 -0000 Subject: [llvm-commits] [llvm] r54172 - in /llvm/trunk: lib/CodeGen/BranchFolding.cpp test/CodeGen/Generic/2008-07-29-EHLabel.ll Message-ID: <200807292056.m6TKu2DU007992@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 29 15:56:02 2008 New Revision: 54172 URL: http://llvm.org/viewvc/llvm-project?rev=54172&view=rev Log: Fix PR2609. If a label is deleted, then it needs to be marked invalid regardless of whether it is a debug, an exception handling or (hopefully) a GC label. Added: llvm/trunk/test/CodeGen/Generic/2008-07-29-EHLabel.ll Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=54172&r1=54171&r2=54172&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Tue Jul 29 15:56:02 2008 @@ -114,15 +114,14 @@ while (!MBB->succ_empty()) MBB->removeSuccessor(MBB->succ_end()-1); - // If there is DWARF info to active, check to see if there are any DBG_LABEL - // records in the basic block. If so, unregister them from MachineModuleInfo. + // If there are any labels in the basic block, unregister them from + // MachineModuleInfo. if (MMI && !MBB->empty()) { for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { - if ((unsigned)I->getOpcode() == TargetInstrInfo::DBG_LABEL) { + if (I->isLabel()) // The label ID # is always operand #0, an immediate. MMI->InvalidateLabel(I->getOperand(0).getImm()); - } } } Added: llvm/trunk/test/CodeGen/Generic/2008-07-29-EHLabel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2008-07-29-EHLabel.ll?rev=54172&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2008-07-29-EHLabel.ll (added) +++ llvm/trunk/test/CodeGen/Generic/2008-07-29-EHLabel.ll Tue Jul 29 15:56:02 2008 @@ -0,0 +1,282 @@ +; RUN: llvm-as < %s | llc -o - | as -o /dev/null +; PR2609 + %struct..0._11 = type { i32 } + %struct..1__pthread_mutex_s = type { i32, i32, i32, i32, i32, %struct..0._11 } + %struct.pthread_attr_t = type { i32, [32 x i8] } + %struct.pthread_mutex_t = type { %struct..1__pthread_mutex_s } + %"struct.std::__ctype_abstract_base" = type { %"struct.std::locale::facet" } + %"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::__ctype_abstract_base"*, %"struct.std::__ctype_abstract_base"* } + %"struct.std::basic_istream >" = type { i32 (...)**, i32, %"struct.std::basic_ios >" } + %"struct.std::basic_istream >::sentry" = type { i8 } + %"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" } + %"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" } + %"struct.std::ctype" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } + %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" } + %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 } + %"struct.std::ios_base::_Words" = type { i8*, i32 } + %"struct.std::locale" = type { %"struct.std::locale::_Impl"* } + %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** } + %"struct.std::locale::facet" = type { i32 (...)**, i32 } + + at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0] + at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0] + at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0] + at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0] + at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i32)* @pthread_cancel ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0] + at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0] + at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %struct..0._11*)* @pthread_mutex_init ; [#uses=0] + at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0] + at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0] + at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_init ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%struct..0._11*, i32)* @pthread_mutexattr_settype ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_destroy ; [#uses=0] + +define %"struct.std::basic_istream >"* @_ZNSi7getlineEPcic(%"struct.std::basic_istream >"* %this, i8* %__s, i32 %__n, i8 signext %__delim) { +entry: + %__cerb = alloca %"struct.std::basic_istream >::sentry" ; <%"struct.std::basic_istream >::sentry"*> [#uses=2] + getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 1 ; :0 [#uses=7] + store i32 0, i32* %0, align 4 + call void @_ZNSi6sentryC1ERSib( %"struct.std::basic_istream >::sentry"* %__cerb, %"struct.std::basic_istream >"* %this, i8 zeroext 1 ) + getelementptr %"struct.std::basic_istream >::sentry"* %__cerb, i32 0, i32 0 ; :1 [#uses=1] + load i8* %1, align 8 ; :2 [#uses=1] + %toBool = icmp eq i8 %2, 0 ; [#uses=1] + br i1 %toBool, label %bb162, label %bb + +bb: ; preds = %entry + zext i8 %__delim to i32 ; :3 [#uses=1] + getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 0 ; :4 [#uses=1] + load i32 (...)*** %4, align 4 ; :5 [#uses=1] + getelementptr i32 (...)** %5, i32 -3 ; :6 [#uses=1] + bitcast i32 (...)** %6 to i32* ; :7 [#uses=1] + load i32* %7, align 4 ; :8 [#uses=1] + bitcast %"struct.std::basic_istream >"* %this to i8* ; :9 [#uses=1] + %ctg2186 = getelementptr i8* %9, i32 %8 ; [#uses=1] + bitcast i8* %ctg2186 to %"struct.std::basic_ios >"* ; <%"struct.std::basic_ios >"*>:10 [#uses=1] + getelementptr %"struct.std::basic_ios >"* %10, i32 0, i32 4 ; <%"struct.std::basic_streambuf >"**>:11 [#uses=1] + load %"struct.std::basic_streambuf >"** %11, align 4 ; <%"struct.std::basic_streambuf >"*>:12 [#uses=9] + getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 2 ; :13 [#uses=10] + load i8** %13, align 4 ; :14 [#uses=2] + getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 3 ; :15 [#uses=6] + load i8** %15, align 4 ; :16 [#uses=1] + icmp ult i8* %14, %16 ; :17 [#uses=1] + br i1 %17, label %bb81, label %bb82 + +bb81: ; preds = %bb + load i8* %14, align 1 ; :18 [#uses=1] + zext i8 %18 to i32 ; :19 [#uses=1] + %.pre = getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; [#uses=1] + br label %bb119.preheader + +bb82: ; preds = %bb + getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; :20 [#uses=2] + load i32 (...)*** %20, align 4 ; :21 [#uses=1] + getelementptr i32 (...)** %21, i32 9 ; :22 [#uses=1] + load i32 (...)** %22, align 4 ; :23 [#uses=1] + bitcast i32 (...)* %23 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:24 [#uses=1] + invoke i32 %24( %"struct.std::basic_streambuf >"* %12 ) + to label %bb119.preheader unwind label %lpad ; :25 [#uses=1] + +bb119.preheader: ; preds = %bb82, %bb81 + %.pre-phi = phi i32 (...)*** [ %.pre, %bb81 ], [ %20, %bb82 ] ; [#uses=4] + %__c79.0.ph = phi i32 [ %19, %bb81 ], [ %25, %bb82 ] ; [#uses=1] + sext i8 %__delim to i32 ; :26 [#uses=1] + br label %bb119 + +bb84: ; preds = %bb119 + sub i32 %__n, %82 ; :27 [#uses=1] + add i32 %27, -1 ; :28 [#uses=2] + load i8** %15, align 4 ; :29 [#uses=1] + ptrtoint i8* %29 to i32 ; :30 [#uses=1] + load i8** %13, align 4 ; :31 [#uses=3] + ptrtoint i8* %31 to i32 ; :32 [#uses=2] + sub i32 %30, %32 ; :33 [#uses=2] + icmp slt i32 %28, %33 ; :34 [#uses=1] + select i1 %34, i32 %28, i32 %33 ; :35 [#uses=3] + icmp sgt i32 %35, 1 ; :36 [#uses=1] + br i1 %36, label %bb90, label %bb99 + +bb90: ; preds = %bb84 + call i8* @memchr( i8* %31, i32 %26, i32 %35 ) nounwind readonly ; :37 [#uses=2] + icmp eq i8* %37, null ; :38 [#uses=1] + br i1 %38, label %bb93, label %bb92 + +bb92: ; preds = %bb90 + ptrtoint i8* %37 to i32 ; :39 [#uses=1] + sub i32 %39, %32 ; :40 [#uses=1] + br label %bb93 + +bb93: ; preds = %bb92, %bb90 + %__size.0 = phi i32 [ %40, %bb92 ], [ %35, %bb90 ] ; [#uses=4] + call void @llvm.memcpy.i32( i8* %__s_addr.0, i8* %31, i32 %__size.0, i32 1 ) + getelementptr i8* %__s_addr.0, i32 %__size.0 ; :41 [#uses=3] + load i8** %13, align 4 ; :42 [#uses=1] + getelementptr i8* %42, i32 %__size.0 ; :43 [#uses=1] + store i8* %43, i8** %13, align 4 + load i32* %0, align 4 ; :44 [#uses=1] + add i32 %44, %__size.0 ; :45 [#uses=1] + store i32 %45, i32* %0, align 4 + load i8** %13, align 4 ; :46 [#uses=2] + load i8** %15, align 4 ; :47 [#uses=1] + icmp ult i8* %46, %47 ; :48 [#uses=1] + br i1 %48, label %bb95, label %bb96 + +bb95: ; preds = %bb93 + load i8* %46, align 1 ; :49 [#uses=1] + zext i8 %49 to i32 ; :50 [#uses=1] + br label %bb119 + +bb96: ; preds = %bb93 + load i32 (...)*** %.pre-phi, align 4 ; :51 [#uses=1] + getelementptr i32 (...)** %51, i32 9 ; :52 [#uses=1] + load i32 (...)** %52, align 4 ; :53 [#uses=1] + bitcast i32 (...)* %53 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:54 [#uses=1] + invoke i32 %54( %"struct.std::basic_streambuf >"* %12 ) + to label %bb119 unwind label %lpad ; :55 [#uses=1] + +bb99: ; preds = %bb84 + trunc i32 %__c79.0 to i8 ; :56 [#uses=1] + store i8 %56, i8* %__s_addr.0, align 1 + getelementptr i8* %__s_addr.0, i32 1 ; :57 [#uses=5] + load i32* %0, align 4 ; :58 [#uses=1] + add i32 %58, 1 ; :59 [#uses=1] + store i32 %59, i32* %0, align 4 + load i8** %13, align 4 ; :60 [#uses=3] + load i8** %15, align 4 ; :61 [#uses=1] + icmp ult i8* %60, %61 ; :62 [#uses=1] + br i1 %62, label %bb101, label %bb102 + +bb101: ; preds = %bb99 + load i8* %60, align 1 ; :63 [#uses=1] + zext i8 %63 to i32 ; :64 [#uses=1] + getelementptr i8* %60, i32 1 ; :65 [#uses=1] + store i8* %65, i8** %13, align 4 + br label %bb104 + +bb102: ; preds = %bb99 + load i32 (...)*** %.pre-phi, align 4 ; :66 [#uses=1] + getelementptr i32 (...)** %66, i32 10 ; :67 [#uses=1] + load i32 (...)** %67, align 4 ; :68 [#uses=1] + bitcast i32 (...)* %68 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:69 [#uses=1] + invoke i32 %69( %"struct.std::basic_streambuf >"* %12 ) + to label %bb104 unwind label %lpad ; :70 [#uses=1] + +bb104: ; preds = %bb102, %bb101 + %__ret44.0 = phi i32 [ %64, %bb101 ], [ %70, %bb102 ] ; [#uses=1] + icmp eq i32 %__ret44.0, -1 ; :71 [#uses=1] + br i1 %71, label %bb119, label %bb112 + +bb112: ; preds = %bb104 + load i8** %13, align 4 ; :72 [#uses=2] + load i8** %15, align 4 ; :73 [#uses=1] + icmp ult i8* %72, %73 ; :74 [#uses=1] + br i1 %74, label %bb114, label %bb115 + +bb114: ; preds = %bb112 + load i8* %72, align 1 ; :75 [#uses=1] + zext i8 %75 to i32 ; :76 [#uses=1] + br label %bb119 + +bb115: ; preds = %bb112 + load i32 (...)*** %.pre-phi, align 4 ; :77 [#uses=1] + getelementptr i32 (...)** %77, i32 9 ; :78 [#uses=1] + load i32 (...)** %78, align 4 ; :79 [#uses=1] + bitcast i32 (...)* %79 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:80 [#uses=1] + invoke i32 %80( %"struct.std::basic_streambuf >"* %12 ) + to label %bb119 unwind label %lpad ; :81 [#uses=1] + +bb119: ; preds = %bb115, %bb114, %bb104, %bb96, %bb95, %bb119.preheader + %__c79.0 = phi i32 [ %__c79.0.ph, %bb119.preheader ], [ %50, %bb95 ], [ %76, %bb114 ], [ %55, %bb96 ], [ -1, %bb104 ], [ %81, %bb115 ] ; [#uses=3] + %__s_addr.0 = phi i8* [ %__s, %bb119.preheader ], [ %41, %bb95 ], [ %57, %bb114 ], [ %41, %bb96 ], [ %57, %bb104 ], [ %57, %bb115 ] ; [#uses=5] + load i32* %0, align 4 ; :82 [#uses=2] + add i32 %82, 1 ; :83 [#uses=2] + %.not = icmp sge i32 %83, %__n ; [#uses=1] + icmp eq i32 %__c79.0, -1 ; :84 [#uses=3] + icmp eq i32 %__c79.0, %3 ; :85 [#uses=2] + %or.cond = or i1 %84, %85 ; [#uses=1] + %or.cond188 = or i1 %or.cond, %.not ; [#uses=1] + br i1 %or.cond188, label %bb141, label %bb84 + +bb141: ; preds = %bb119 + %.not194 = xor i1 %85, true ; [#uses=1] + %brmerge = or i1 %84, %.not194 ; [#uses=1] + %.mux = select i1 %84, i32 2, i32 4 ; [#uses=0] + br i1 %brmerge, label %bb162, label %bb146 + +bb146: ; preds = %bb141 + store i32 %83, i32* %0, align 4 + load i8** %13, align 4 ; :86 [#uses=2] + load i8** %15, align 4 ; :87 [#uses=1] + icmp ult i8* %86, %87 ; :88 [#uses=1] + br i1 %88, label %bb148, label %bb149 + +bb148: ; preds = %bb146 + getelementptr i8* %86, i32 1 ; :89 [#uses=1] + store i8* %89, i8** %13, align 4 + ret %"struct.std::basic_istream >"* %this + +bb149: ; preds = %bb146 + load i32 (...)*** %.pre-phi, align 4 ; :90 [#uses=1] + getelementptr i32 (...)** %90, i32 10 ; :91 [#uses=1] + load i32 (...)** %91, align 4 ; :92 [#uses=1] + bitcast i32 (...)* %92 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:93 [#uses=1] + invoke i32 %93( %"struct.std::basic_streambuf >"* %12 ) + to label %bb162 unwind label %lpad ; :94 [#uses=0] + +bb162: ; preds = %bb149, %bb141, %entry + ret %"struct.std::basic_istream >"* %this + +lpad: ; preds = %bb149, %bb115, %bb102, %bb96, %bb82 + %__s_addr.1 = phi i8* [ %__s, %bb82 ], [ %__s_addr.0, %bb149 ], [ %41, %bb96 ], [ %57, %bb102 ], [ %57, %bb115 ] ; [#uses=0] + call void @__cxa_rethrow( ) noreturn + unreachable +} + +declare i8* @__cxa_begin_catch(i8*) nounwind + +declare i8* @llvm.eh.exception() nounwind + +declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind + +declare void @__cxa_rethrow() noreturn + +declare void @__cxa_end_catch() + +declare i32 @__gxx_personality_v0(...) + +declare void @_ZNSi6sentryC1ERSib(%"struct.std::basic_istream >::sentry"*, %"struct.std::basic_istream >"*, i8 zeroext ) + +declare i8* @memchr(i8*, i32, i32) nounwind readonly + +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind + +declare void @_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate(%"struct.std::basic_ios >"*, i32) + +declare extern_weak i32 @pthread_once(i32*, void ()*) + +declare extern_weak i8* @pthread_getspecific(i32) + +declare extern_weak i32 @pthread_setspecific(i32, i8*) + +declare extern_weak i32 @pthread_create(i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*) + +declare extern_weak i32 @pthread_cancel(i32) + +declare extern_weak i32 @pthread_mutex_lock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_trylock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_init(%struct.pthread_mutex_t*, %struct..0._11*) + +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) + +declare extern_weak i32 @pthread_key_delete(i32) + +declare extern_weak i32 @pthread_mutexattr_init(%struct..0._11*) + +declare extern_weak i32 @pthread_mutexattr_settype(%struct..0._11*, i32) + +declare extern_weak i32 @pthread_mutexattr_destroy(%struct..0._11*) From isanbard at gmail.com Tue Jul 29 17:15:27 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 22:15:27 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54176 - in /llvm-gcc-4.2/trunk/gcc/doc: extend.texi invoke.texi tm.texi Message-ID: <200807292215.m6TMFRpu011153@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 17:15:27 2008 New Revision: 54176 URL: http://llvm.org/viewvc/llvm-project?rev=54176&view=rev Log: Syning with Apple GCC's 4.2. Modified: llvm-gcc-4.2/trunk/gcc/doc/extend.texi llvm-gcc-4.2/trunk/gcc/doc/invoke.texi llvm-gcc-4.2/trunk/gcc/doc/tm.texi Modified: llvm-gcc-4.2/trunk/gcc/doc/extend.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/extend.texi?rev=54176&r1=54175&r2=54176&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/doc/extend.texi (original) +++ llvm-gcc-4.2/trunk/gcc/doc/extend.texi Tue Jul 29 17:15:27 2008 @@ -1590,6 +1590,8 @@ attributes when making a declaration. This keyword is followed by an attribute specification inside double parentheses. The following attributes are currently defined for functions on all targets: + at c APPLE LOCAL mainline aligned functions 5933878 + at code{aligned}, @code{noreturn}, @code{returns_twice}, @code{noinline}, @code{always_inline}, @c APPLE LOCAL nodebug @code{nodebug}, @@ -1635,6 +1637,29 @@ Not all target machines support this attribute. + at c APPLE LOCAL begin mainline aligned functions 5933878 + at item aligned (@var{alignment}) + at cindex @code{aligned} attribute +This attribute specifies a minimum alignment for the function, +measured in bytes. + +You cannot use this attribute to decrease the alignment of a function, +only to increase it. However, when you explicitly specify a function +alignment this will override the effect of the + at option{-falign-functions} (@pxref{Optimize Options}) option for this +function. + +Note that the effectiveness of @code{aligned} attributes may be +limited by inherent limitations in your linker. On many systems, the +linker is only able to arrange for functions to be aligned up to a +certain maximum alignment. (For some linkers, the maximum supported +alignment may be very very small.) See your linker documentation for +further information. + +The @code{aligned} attribute can also be used for variables and fields +(@pxref{Variable Attributes}.) + at c APPLE LOCAL end mainline aligned functions 5933878 + @item always_inline @cindex @code{always_inline} function attribute Generally, functions are not inlined unless optimization is specified. @@ -3190,6 +3215,11 @@ in an @code{__attribute__} will still only provide you with 8 byte alignment. See your linker documentation for further information. + at c APPLE LOCAL begin aligned functions 5933878 +The @code{aligned} attribute can also be used for functions +(@pxref{Function Attributes}.) + at c APPLE LOCAL end aligned functions 5933878 + @item cleanup (@var{cleanup_function}) @cindex @code{cleanup} attribute The @code{cleanup} attribute runs a function when the variable goes @@ -3465,150 +3495,15 @@ addresses). @end table - at anchor{i386 Variable Attributes} - at subsection i386 Variable Attributes - -Two attributes are currently defined for i386 configurations: - at code{ms_struct} and @code{gcc_struct} - - at table @code - at item ms_struct - at itemx gcc_struct - at cindex @code{ms_struct} attribute - at cindex @code{gcc_struct} attribute - -If @code{packed} is used on a structure, or if bit-fields are used -it may be that the Microsoft ABI packs them differently -than GCC would normally pack them. Particularly when moving packed -data between functions compiled with GCC and the native Microsoft compiler -(either via function call or as data in a file), it may be necessary to access -either format. - -Currently @option{-m[no-]ms-bitfields} is provided for the Microsoft Windows X86 -compilers to match the native Microsoft compiler. - -The Microsoft structure layout algorithm is fairly simple with the exception -of the bitfield packing: - -The padding and alignment of members of structures and whether a bit field -can straddle a storage-unit boundary - - at enumerate - at item Structure members are stored sequentially in the order in which they are -declared: the first member has the lowest memory address and the last member -the highest. - - at item Every data object has an alignment-requirement. The alignment-requirement -for all data except structures, unions, and arrays is either the size of the -object or the current packing size (specified with either the aligned attribute -or the pack pragma), whichever is less. For structures, unions, and arrays, -the alignment-requirement is the largest alignment-requirement of its members. -Every object is allocated an offset so that: - -offset % alignment-requirement == 0 - - at item Adjacent bit fields are packed into the same 1-, 2-, or 4-byte allocation -unit if the integral types are the same size and if the next bit field fits -into the current allocation unit without crossing the boundary imposed by the -common alignment requirements of the bit fields. - at end enumerate - -Handling of zero-length bitfields: - -MSVC interprets zero-length bitfields in the following ways: - - at enumerate - at item If a zero-length bitfield is inserted between two bitfields that would -normally be coalesced, the bitfields will not be coalesced. - -For example: - - at smallexample -struct - @{ - unsigned long bf_1 : 12; - unsigned long : 0; - unsigned long bf_2 : 12; - @} t1; - at end smallexample - -The size of @code{t1} would be 8 bytes with the zero-length bitfield. If the -zero-length bitfield were removed, @code{t1}'s size would be 4 bytes. - - at item If a zero-length bitfield is inserted after a bitfield, @code{foo}, and the -alignment of the zero-length bitfield is greater than the member that follows it, - at code{bar}, @code{bar} will be aligned as the type of the zero-length bitfield. - -For example: - - at smallexample -struct - @{ - char foo : 4; - short : 0; - char bar; - @} t2; - -struct - @{ - char foo : 4; - short : 0; - double bar; - @} t3; - at end smallexample - -For @code{t2}, @code{bar} will be placed at offset 2, rather than offset 1. -Accordingly, the size of @code{t2} will be 4. For @code{t3}, the zero-length -bitfield will not affect the alignment of @code{bar} or, as a result, the size -of the structure. - -Taking this into account, it is important to note the following: - - at enumerate - at item If a zero-length bitfield follows a normal bitfield, the type of the -zero-length bitfield may affect the alignment of the structure as whole. For -example, @code{t2} has a size of 4 bytes, since the zero-length bitfield follows a -normal bitfield, and is of type short. - - at item Even if a zero-length bitfield is not followed by a normal bitfield, it may -still affect the alignment of the structure: - - at smallexample -struct - @{ - char foo : 6; - long : 0; - @} t4; - at end smallexample - -Here, @code{t4} will take up 4 bytes. - at end enumerate - - at item Zero-length bitfields following non-bitfield members are ignored: - - at smallexample -struct - @{ - char foo; - long : 0; - char bar; - @} t5; - at end smallexample - -Here, @code{t5} will take up 2 bytes. - at end enumerate - at end table - + at c APPLE LOCAL begin 5946347 ms_struct support + at anchor{PowerPC Variable Attributes} @subsection PowerPC Variable Attributes -Three attributes currently are defined for PowerPC configurations: - at code{altivec}, @code{ms_struct} and @code{gcc_struct}. - -For full documentation of the struct attributes please see the -documentation in the @xref{i386 Variable Attributes}, section. +One is defined for PowerPC configurations: @code{altivec}. -For documentation of @code{altivec} attribute please see the +For documentation of the @code{altivec} attribute please see the documentation in the @xref{PowerPC Type Attributes}, section. + at c APPLE LOCAL end 5946347 ms_struct support @subsection SPU Variable Attributes @@ -3924,28 +3819,28 @@ Otherwise the two shared objects will be unable to use the same typeinfo node and exception handling will break. - at subsection ARM Type Attributes - -On those ARM targets that support @code{dllimport} (such as Symbian -OS), you can use the @code{notshared} attribute to indicate that the -virtual table and other similar data for a class should not be -exported from a DLL at . For example: - - at smallexample -class __declspec(notshared) C @{ -public: - __declspec(dllimport) C(); - virtual void f(); -@} + at c APPLE LOCAL begin weak types 5954418 + at item weak +In C++, attribute weak can be applied to a class to ensure that all +non-hidden instances of the type are treated as the same type across +shared library boundaries on platforms (such as darwin and arm aapcs) +that can emit vtables and the type info meta data as non-comdat +symbols. This is useful when the class has a key method and the +translation unit that contains the key method is used in more than one +shared library or in a shared library and the application. Doing this +results in more expensive startup times. This attribute is inherited +by subclasses, so it is only necessary to mark a base type. The +typical use would be to mark any types used for throwing across shared +library boundaries or those used in dynamic_cast operations across a +shared library boundary. + at c APPLE LOCAL end weak types 5954418 -__declspec(dllexport) -C::C() @{@} - at end smallexample + at c APPLE LOCAL begin 5946347 ms_struct support + at end table -In this code, @code{C::C} is exported from the current DLL, but the -virtual table for @code{C} is not exported. (You can use - at code{__attribute__} instead of @code{__declspec} if you prefer, but -most Symbian OS code uses @code{__declspec}.) +To specify multiple attributes, separate them by commas within the +double parentheses: for example, @samp{__attribute__ ((aligned (16), +packed))}. @anchor{i386 Type Attributes} @subsection i386 Type Attributes @@ -3953,10 +3848,11 @@ Two attributes are currently defined for i386 configurations: @code{ms_struct} and @code{gcc_struct} + at table @code @item ms_struct @itemx gcc_struct - at cindex @code{ms_struct} - at cindex @code{gcc_struct} + at cindex @code{ms_struct} attribute + at cindex @code{gcc_struct} attribute If @code{packed} is used on a structure, or if bit-fields are used it may be that the Microsoft ABI packs them differently @@ -3967,11 +3863,149 @@ Currently @option{-m[no-]ms-bitfields} is provided for the Microsoft Windows X86 compilers to match the native Microsoft compiler. + +The Microsoft structure layout algorithm is fairly simple with the exception +of the bitfield packing: + +The padding and alignment of members of structures and whether a bit field +can straddle a storage-unit boundary + + at enumerate + at item Structure members are stored sequentially in the order in which they are +declared: the first member has the lowest memory address and the last member +the highest. + + at item Every data object has an alignment-requirement. The alignment-requirement +for all data except structures, unions, and arrays is either the size of the +object or the current packing size (specified with either the aligned attribute +or the pack pragma), whichever is less. For structures, unions, and arrays, +the alignment-requirement is the largest alignment-requirement of its members. +Every object is allocated an offset so that: + +offset % alignment-requirement == 0 + + at item Adjacent bit fields are packed into the same 1-, 2-, or 4-byte allocation +unit if the integral types are the same size and if the next bit field fits +into the current allocation unit without crossing the boundary imposed by the +common alignment requirements of the bit fields. + at end enumerate + +Handling of zero-length bitfields: + +MSVC interprets zero-length bitfields in the following ways: + + at enumerate + at item If a zero-length bitfield is inserted between two bitfields that would +normally be coalesced, the bitfields will not be coalesced. + +For example: + + at smallexample +struct + @{ + unsigned long bf_1 : 12; + unsigned long : 0; + unsigned long bf_2 : 12; + @} t1; + at end smallexample + +The size of @code{t1} would be 8 bytes with the zero-length bitfield. If the +zero-length bitfield were removed, @code{t1}'s size would be 4 bytes. + + at item If a zero-length bitfield is inserted after a bitfield, @code{foo}, and the +alignment of the zero-length bitfield is greater than the member that follows it, + at code{bar}, @code{bar} will be aligned as the type of the zero-length bitfield. + +For example: + + at smallexample +struct + @{ + char foo : 4; + short : 0; + char bar; + @} t2; + +struct + @{ + char foo : 4; + short : 0; + double bar; + @} t3; + at end smallexample + +For @code{t2}, @code{bar} will be placed at offset 2, rather than offset 1. +Accordingly, the size of @code{t2} will be 4. For @code{t3}, the zero-length +bitfield will not affect the alignment of @code{bar} or, as a result, the size +of the structure. + +Taking this into account, it is important to note the following: + + at enumerate + at item If a zero-length bitfield follows a normal bitfield, the type of the +zero-length bitfield may affect the alignment of the structure as whole. For +example, @code{t2} has a size of 4 bytes, since the zero-length bitfield follows a +normal bitfield, and is of type short. + + at item Even if a zero-length bitfield is not followed by a normal bitfield, it may +still affect the alignment of the structure: + + at smallexample +struct + @{ + char foo : 6; + long : 0; + @} t4; + at end smallexample + +Here, @code{t4} will take up 4 bytes. + at end enumerate + + at item Zero-length bitfields following non-bitfield members are ignored: + + at smallexample +struct + @{ + char foo; + long : 0; + char bar; + @} t5; + at end smallexample + +Here, @code{t5} will take up 2 bytes. + at end enumerate @end table -To specify multiple attributes, separate them by commas within the -double parentheses: for example, @samp{__attribute__ ((aligned (16), -packed))}. + at anchor{ARM Type Attributes} + at subsection ARM Type Attributes + +Two attributes currently are defined for ARM configurations: + at code{ms_struct} and @code{gcc_struct}. + +For full documentation of the struct attributes please see the +documentation in the @xref{i386 Type Attributes}, section. + +On those ARM targets that support @code{dllimport} (such as Symbian +OS), you can use the @code{notshared} attribute to indicate that the +virtual table and other similar data for a class should not be +exported from a DLL at . For example: + + at smallexample +class __declspec(notshared) C @{ +public: + __declspec(dllimport) C(); + virtual void f(); +@} + +__declspec(dllexport) +C::C() @{@} + at end smallexample + +In this code, @code{C::C} is exported from the current DLL, but the +virtual table for @code{C} is not exported. (You can use + at code{__attribute__} instead of @code{__declspec} if you prefer, but +most Symbian OS code uses @code{__declspec}.) + at c APPLE LOCAL end 5946347 ms_struct support @anchor{PowerPC Type Attributes} @subsection PowerPC Type Attributes Modified: llvm-gcc-4.2/trunk/gcc/doc/invoke.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/invoke.texi?rev=54176&r1=54175&r2=54176&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/doc/invoke.texi (original) +++ llvm-gcc-4.2/trunk/gcc/doc/invoke.texi Tue Jul 29 17:15:27 2008 @@ -216,6 +216,10 @@ -Wnewline-eof (APPLE ONLY) @gol @c APPLE LOCAL -Wno-altivec-long-deprecated --ilr ** -Wno-altivec-long-deprecated (APPLE ONLY) + at c APPLE LOCAL begin 5695218 +-fglobal-alloc-prefer-bytes (APPLE ONLY) +-fno-global-alloc-prefer-bytes (APPLE ONLY) + at c APPLE LOCAL end 5695218 @c APPLE LOCAL fwritable strings -funsigned-bitfields -funsigned-char -fwritable-strings} @@ -378,7 +382,11 @@ -fcrossjumping -fif-conversion -fif-conversion2 @gol -finline-functions -finline-functions-called-once @gol -finline-limit=@var{n} -fkeep-inline-functions @gol --fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol + at c APPLE LOCAL begin ARM conditionally disable local RA +-fkeep-static-consts @gol +-flocal-alloc (APPLE ONLY) @gol +-fmerge-constants -fmerge-all-constants @gol + at c APPLE LOCAL end ARM conditionally disable local RA -fmodulo-sched -fno-branch-count-reg @gol -fno-default-inline -fno-defer-pop -fmove-loop-invariants @gol -fno-function-cse -fno-guess-branch-probability @gol @@ -428,6 +436,8 @@ -iprefix @var{file} -iwithprefix @var{dir} @gol -iwithprefixbefore @var{dir} -isystem @var{dir} @gol -imultilib @var{dir} -isysroot @var{dir} @gol + at c APPLE LOCAL ARM iwithsysroot 4917039 +-iwithsysroot (APPLE ONLY) @var{dir} @gol -M -MM -MF -MG -MP -MQ -MT -nostdinc @gol -P -fworking-directory -remap @gol -trigraphs -undef -U at var{macro} -Wp, at var{option} @gol @@ -492,7 +502,10 @@ -mthumb -marm @gol -mtpcs-frame -mtpcs-leaf-frame @gol -mcaller-super-interworking -mcallee-super-interworking @gol --mtp=@var{name}} + at c APPLE LOCAL begin 5946347 ms_struct support +-mtp=@var{name} @gol +-mms-bitfields -mno-ms-bitfields} + at c APPLE LOCAL end 5946347 ms_struct support @c APPLE LOCAL ARM prune man page @ignore @@ -547,6 +560,8 @@ -twolevel_namespace -umbrella -undefined @gol -unexported_symbols_list -weak_reference_mismatches @gol -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol + at c APPLE LOCAL ARM 5905142 +-miphoneos-version-min=@var{version} @gol @c APPLE LOCAL pascal strings -mpascal-strings (APPLE ONLY) @gol @c APPLE LOCAL begin fat builds @@ -628,7 +643,10 @@ -mstackrealign @gol -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol -mcmodel=@var{code-model} @gol --m32 -m64 -mlarge-data-threshold=@var{num}} + at c APPLE LOCAL begin 5946347 ms_struct support +-m32 -m64 -mlarge-data-threshold=@var{num} @gol +-mms-bitfields -mno-ms-bitfields} + at c APPLE LOCAL end 5946347 ms_struct support @c APPLE LOCAL prune man page @ignore @@ -777,7 +795,10 @@ -mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol -mprototype -mno-prototype @gol -msim -mmvme -mads -myellowknife -memb -msdata @gol --msdata=@var{opt} -mvxworks -mwindiss -G @var{num} -pthread} + at c APPLE LOCAL begin 5946347 ms_struct support +-msdata=@var{opt} -mvxworks -mwindiss -G @var{num} -pthread @gol +-mms-bitfields -mno-ms-bitfields} + at c APPLE LOCAL end 5946347 ms_struct support @c APPLE LOCAL prune man page @ignore @@ -973,12 +994,9 @@ the last two letters must both be literally @samp{x}. Likewise, @samp{.C} refers to a literal capital C at . - at item @var{file}.mm - at itemx @var{file}.M -Objective-C++ source code which must be preprocessed. - - at item @var{file}.mii -Objective-C++ source code which should not be preprocessed. + at c APPLE LOCAL begin Objective-C++ + at c Delete duplicate @var{file}.mm, @var{file}.M, @var{file}.mii. + at c APPLE LOCAL end Objective-C++ @item @var{file}.hh @itemx @var{file}.H @@ -1644,6 +1662,18 @@ (default behavior) @c APPLE LOCAL end radar 3506309 + at c APPLE LOCAL begin 5695218 + at item -fglobal-alloc-prefer-bytes + at item -fno-global-alloc-prefer-bytes + at opindex fglobal-alloc-prefer-bytes +For the x86_32 architecture, prefer byte or short values to word +values during global register allocation. Some of the registers on +this target can't be used with values smaller than a 32-bit word; +allocating these values earlier increases the chance they will get a +byte-capable (or short-capable) register. Ignored for other targets. +Defaults on with global register allocation (@code{-Os}, @code{-O2}, +or @code{-O3}). (APPLE ONLY) + at c APPLE LOCAL end 5695218 @c APPLE LOCAL begin fwritable strings. @item -fwritable-strings @opindex fwritable-strings @@ -5349,6 +5379,16 @@ check if the variable was referenced, regardless of whether or not optimization is turned on, use the @option{-fno-keep-static-consts} option. + at c APPLE LOCAL begin ARM conditionally disable local RA + at item -flocal-alloc +(APPLE ONLY) Enable the local (intra-basic-block) register allocator. + +GCC enables this option by default. If you want to force the compiler to +supress register allocation within a basic block, use the + at option{-fno-local-alloc} option. This option cannot be disabled with + at option{-O0}, for correctness reasons. + at c APPLE LOCAL end ARM conditionally disable local RA + @item -fmerge-constants Attempt to merge identical constants (string constants and floating point constants) across compilation units. @@ -7357,6 +7397,14 @@ If you really need to change the search order for system directories, use the @option{-nostdinc} and/or @option{-isystem} options. + at c APPLE LOCAL begin ARM iwithsysroot 4917039 +The option @option{-iwithsysroot} (APPLE ONLY), if specified with an +absolute path, will prepend the system root directory (if applicable) to +the path and add it to the beginning of the system search paths. If +specified with a relative path, @option{-iwithsysroot} will behave +identically to @option{-isystem}. + at c APPLE LOCAL end ARM iwithsysroot 4917039 + @item -iquote at var{dir} @opindex iquote Add the directory @var{dir} to the head of the list of directories to @@ -8468,6 +8516,15 @@ best available method for the selected processor. The default setting is @option{auto}. + at c APPLE LOCAL begin 5946347 ms_struct support + at item -mms-bitfields + at opindex mms-bitfields +Set the default structure layout to be compatible with the Microsoft +compiler standard. This is equivalent to adding an @code{ms_struct} +attribute to each structure and union tag definition. The default is + at option{mno-ms-bitfields}. + at c APPLE LOCAL end 5946347 ms_struct support + @end table @c APPLE LOCAL ARM prune man page @@ -8863,6 +8920,13 @@ is @var{version}. Typical values of @var{version} include @code{10.1}, @code{10.2}, and @code{10.3.9}. + at c APPLE LOCAL begin ARM 5905142 +This value can also be set with the @env{MACOSX_DEPLOYMENT_TARGET} +environment variable. If both the command-line option is specified +and the environment variable is set, the command-line option will +take precedence. + at c APPLE LOCAL end ARM 5905142 + @c APPLE LOCAL begin mainline 2007-06-14 5235474 If the compiler was built to use the system's headers by default, then the default for this option is the system version on which the @@ -8870,6 +8934,22 @@ are compatible with as many systems and code bases as possible. @c APPLE LOCAL end mainline 2007-06-14 5235474 + at c APPLE LOCAL begin ARM 5905142 +This value is not set by default for ARM targets. + + at item -miphoneos-version-min=@var{version} +The earliest version of iPhone OS that this executable will run on +is @var{version}. + +This value can also be set with the @env{IPHONEOS_DEPLOYMENT_TARGET} +environment variable. If both the command-line option is specified +and the environment variable is set, the command-line option will +take precedence. + +On ARM targets, if not specified by the command-line option or +environment variable, this value defaults to 2.0. + at c APPLE LOCAL end ARM 5905142 + @item -mkernel @opindex mkernel Enable kernel development mode. The @option{-mkernel} option sets @@ -10559,6 +10639,16 @@ Generate code for the large model: This model makes no assumptions about addresses and sizes of sections. Currently GCC does not implement this model. + + at c APPLE LOCAL begin 5946347 ms_struct support + at item -mms-bitfields + at opindex mms-bitfields +Set the default structure layout to be compatible with the Microsoft +compiler standard. This is equivalent to adding an @code{ms_struct} +attribute to each structure and union tag definition. The default is + at option{mno-ms-bitfields}. + at c APPLE LOCAL end 5946347 ms_struct support + @end table @c APPLE LOCAL prune man page @@ -12896,6 +12986,15 @@ Adds support for multithreading with the @dfn{pthreads} library. This option sets flags for both the preprocessor and linker. + at c APPLE LOCAL begin 5946347 ms_struct support + at item -mms-bitfields + at opindex mms-bitfields +Set the default structure layout to be compatible with the Microsoft +compiler standard. This is equivalent to adding an @code{ms_struct} +attribute to each structure and union tag definition. The default is + at option{mno-ms-bitfields}. + at c APPLE LOCAL end 5946347 ms_struct support + @end table @c APPLE LOCAL prune man page @@ -14746,6 +14845,21 @@ If @env{LANG} is not defined, or if it has some other value, then the compiler will use mblen and mbtowc as defined by the default locale to recognize and translate multibyte characters. + + at c APPLE LOCAL begin ARM 5905142 + at item MACOSX_DEPLOYMENT_TARGET + at itemx IPHONEOS_DEPLOYMENT_TARGET +These variables are used to set the target OS version, as described +for command-line options @option{-mmacosx-version-min} and + at option{-miphoneos-version-min}. Only one OS version can be specified +per architecture, with @env{MACOSX_DEPLOYMENT_TARGET} taking precedence +on non-ARM targets and @env{IPHONEOS_DEPLOYMENT_TARGET} taking +precedence on ARM targets. + +If either command-line option @option{-mmacosx-version-min} or + at option{-miphoneos-version-min} is specified, both of these +environment variables are ignored. + at c APPLE LOCAL end ARM 5905142 @end table @noindent Modified: llvm-gcc-4.2/trunk/gcc/doc/tm.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/tm.texi?rev=54176&r1=54175&r2=54176&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/doc/tm.texi (original) +++ llvm-gcc-4.2/trunk/gcc/doc/tm.texi Tue Jul 29 17:15:27 2008 @@ -1050,6 +1050,31 @@ Biggest alignment that any data type can require on this machine, in bits. @end defmac + at c APPLE LOCAL begin 5946347 ms_struct support + at defmac BIGGEST_MS_STRUCT_ALIGNMENT +Define this macro if the target supports Microsoft structure alignment +(@code{TARGET_MS_BITFIELD_LAYOUT_P}) and the target definition of +BIGGEST_ALIGNMENT is smaller than is needed for ms_struct records. It should +defined as the largest field alignment required by the target for Microsoft +aligned structure fields. + +By default, @code{BIGGEST_MS_STRUCT_ALIGNMENT} is defined to be equivalent to + at code{BIGGEST_ALIGNMENT}. + at end defmac + + at defmac TARGET_FIELD_MS_STRUCT_ALIGN +Define this macro if the target supports Microsoft structure alignment +(@code{TARGET_MS_BITFIELD_LAYOUT_P}) and the standard type alignment +of non-aggregate types is not sufficient for the MS structure alignment rules. + +The @code{TARGET_FIELD_MS_STRUCT_ALIGN} macro should return the alignment required +for the field passed as its argument. + +By default, the type alignment of the field will be used, i.e., + at code{TYPE_ALIGN (TREE_TYPE (FIELD))}. + at end defmac + at c APPLE LOCAL end 5946347 ms_struct support + @defmac MINIMUM_ATOMIC_ALIGNMENT If defined, the smallest alignment, in bits, that can be given to an object that can be referenced in one operation, without disturbing any From isanbard at gmail.com Tue Jul 29 14:45:18 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 19:45:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54170 - in /llvm-gcc-4.2/trunk/gcc: objc/ChangeLog.apple objc/objc-act.h objc/objc-tree.def objcp/ChangeLog.apple objcp/objcp-lang.c Message-ID: <200807291945.m6TJjJAv005547@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 14:45:18 2008 New Revision: 54170 URL: http://llvm.org/viewvc/llvm-project?rev=54170&view=rev Log: Bring LLVM-GCC's Obj-C support up to Apple GCC 4.2's TOT. There's still one file to upgrade yet. Modified: llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/objc/objc-act.h llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def llvm-gcc-4.2/trunk/gcc/objcp/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c Modified: llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple?rev=54170&r1=54169&r2=54170&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple Tue Jul 29 14:45:18 2008 @@ -1,3 +1,348 @@ +2008-07-25 Fariborz Jahanian + + Radar 6023694 + * objc-act.h: (IS_SUPER) changed to compare + against the original type. + +2008-07-22 Fariborz Jahanian + + Radar 6029577 + * objc-act.c (objc_build_property_reference_expr): + Added support for property reference tree build when + property and/or getter is of a reference type. + +2008-07-21 Fariborz Jahanian + + Radar 6029624 + * objc-act.c: (objc_declare_property_impl): Consider property + of reference type as valid. + (objc_add_internal_ivar): Type of a synthesized ivar + of a property reference type is its referenced type. + +2008-07-18 Fariborz Jahanian + + Radar 6068877 + * objc-act.c: (objc_create_init_utf16_var): Removed. + +2008-07-17 Fariborz Jahanian + Radar 6083530 + * objc-act.c: (objc_build_foreach_components): 'limit' and + 'counter' temporaries must have type unsigned long. + +2008-07-08 Fariborz Jahanian + + Radar 6061276 + * objc-act.c (objc_compare_types): Resolve a @class decl. + in type tree to its @interface decl. if can. + +2008-06-16 Fariborz Jahanian + + Radar 6003871 + * objc-act.c (objc_build_ivar_layout): Free object after + its use not before. + +2008-06-13 Fariborz Jahanian + + Radar 5996271 + * objc-act.c (encode_type): encode 128-bit int. + +2008-06-03 Fariborz Jahanian + + Radar 5982789 + * objc-act.c (buildNSStringType): New + (objc_build_string_object): Type of a CFString literal is + now NSString *. + (objc_check_nsstring_pointer_type): Call buildNSStringType + to build "NSString" type. + +2008-06-03 Fariborz Jahanian + + Radar 5887355 + * objc-act.c (objc_build_string_object): Defer tree build + of cfstrings when in a template declaration. + (objc-tree.def): OBJC_STRING_REFERENCE is new tree code. + +2008-05-27 Fariborz Jahanian + + Radar 5962694 + * objc/objc-act.c (finish_class): For categories also merge + properties from their protocol list. + +2008-05-16 Fariborz Jahanian + + Radar 5932809 + * objc-act.c (objc_finish_message_expr) Don't warning on + [id release] or [id retain] messaging synthesized for byref + variable blocks. + (build_ivar_reference): build_closure_ref_decl call takes + on less argument (this is a clean up). + (retain_closure_component, release_closure_component): Set + donot_warn_missing_methods flag so we do not issue warning + on [id release] or [id retain] messaging synthesis. + (cast_to_pointer_to_id): New. + +2008-04-23 Fariborz Jahanian + + Radar 5882266 (tweaked). + * objc-act.c (objc_is_strong_p): Previous patch removed. + (objc_is_gcable_type): Special handling for finding '__weak' + attribute on block types. + +2008-04-23 Fariborz Jahanian + + Radar 5882266 + * objc-act.c (objc_is_strong_p): gc-attribute of + closure pointers are on its function type. + +2008-04-10 Fariborz Jahanian + + Radar 5849129 + * objc-act.c (encode_pointer): encode block pointer as '@'. + (encode_type): Add sncoding support for block pointer encopding. + +2008-03-31 Fariborz Jahanian + + Radar 5832193 + * objc-act.c (objc_is_gcable_type): A block type is also gc'able. + (objc_generate_write_barrier): Allow write-barriers when assigning to + a block pointer object. + +2008-03-31 Fariborz Jahanian + + Radar 5831920 + * objc-act.c (objc_type_valid_for_messaging): A block is a valid object for + messaging. + +2008-03-28 Fariborz Jahanian + + Radar 5808305 + * objc-act.c (release_closure_component): Do a plain bitwise copy + of object pointers of const copied-in object poiners (no more + retain autorelease thing). + +2008-03-28 Fariborz Jahanian + + Radar 5809099 + * objc-act.c (objc_finish_message_expr): Treat closure pointer receiver as + an 'id' object. + +2008-03-26 Fariborz Jahanian + + Radar 5782740 - Minor tweak. + * objc-act.c (release_closure_component): Message sent is + "release' instead of "retain". + +2008-03-24 Fariborz Jahanian + + Radar 5811191 + * objc-act.c (build_ivar_reference): Warn if an ivar is declared + inside an |...| block. Treat all ivar access such that their + implicit 'self' is copied-in const and ivar reference is + implicit byref. + +2008-03-13 Fariborz Jahanian + + Radar 5796058 - Minor change + * objc-act.c (build_ivar_reference): All 'ivar' in closures + are now treated as though declared 'byref'. + +2008-03-12 Fariborz Jahanian + + Radar 5795493 - type matching of closure types + * objc-act.c (objc_types_are_equivalent): Added case for + CLOSURE_POINTER_TYPE + +2008-03-12 Fariborz Jahanian + + Radar 5796058 - ivar in blocks + * objc-act.c (build_ivar_reference): If 'ivar' is used + in a block, register it as copied-in or byref ivar. + (objc_lookup_ivar): If variable representing a copied-in or byref + ivar just returh it. + +2008-03-10 Fariborz Jahanian + + Radar 5782740 (ivars) + * objc-act.c (build_ivar_reference): 'self' will be + a copied-in variable when implicitly used for an ivar + reference. + +2008-03-06 Fariborz Jahanian + + Radar 5782740 + * objc-act.c (retain_closure_component, release_closure_component, + copy_in_object, closure_requires_copying): New + +2008-04-29 Fariborz Jahanian + + Radar 5893391 + * objc-act.c (objc_build_property_reference_expr): Protocol qualified 'id' + typed receivers are valid object for property reference expressions. + (objc_build_getter_call): Generate getter call when receiver is + a protocol qualified 'id' experssion. + +2008-04-24 Caroline Tice + + * objc-act.c (objc_start_function): Fix APPLE LOCAL markers. + +2008-04-23 Caroline Tice + + Radar 5839812 + * objc-act.c (objc_start_function): Add new parameter, 'method'; + if 'method' is non-NULL, give 'fndecl' the same source location as + 'method'. + (objc_add_property_setter_method): Set the source location of + 'selector' to the source location of 'x'. + (build_module_initializer_routine): Pass NULL_TREE to + objc_start_function for the new method parameter. + (objc_synthesize_new_getter): copy 'decl' and give it the same source + location as 'property' before passing it to + objc_start_method_definition. + (objc_synthesize_new_setter): Likewise. + (finish_class): Give 'getter_decl' the same source location as 'x'; + likewise for 'setter_decl'. + (really_start_method): Pass 'method' to objc_start_function. + (objc_declare_property_impl): Assign 'property_decl' the current + input location. + +2008-04-15 Fariborz Jahanian + + Radar 5852190 + * objc-act.c (objc_synthesize_new_setter): Be smarter + in finding setter method's value argument. + +2008-04-03 Fariborz Jahanian + + Radar 5724385 (tweaked for bitfield ivars). + * objc-act.c (build_v2_ivar_list_initializer): Alignment of + bitfield ivar is that of its underlying type. + +2008-04-01 Fariborz Jahanian + + Radar 5835805 + * objc-act.c (start_class): If using a class alias, + resolve it to its class. + +2008-03-26 Fariborz Jahanian + + Radar 5218071 + * objc-act.c (objc_compare_types): Add special handling for property + types in base and derived class, to check for more specialization. + (diagnose_property_mismatch): When type of readonly properties mismatch + check for specialization. + (objc_merge_proto_properties_in_class): call to diagnose_property_mismatch + takes an extra argument. + (objc_compare_properties_with_super): Ditto + +2008-03-20 Fariborz Jahanian + + Radar 5809596 + * objc-act.c (objc_init): For all objc ABIs + -fobjc-call-cxx-cdtors is on by default + +2008-03-20 Fariborz Jahanian + + Radar 5802025 + * objc-act.c (objc_build_property_getter_func_call): New + (objc_gimplify_expr): Use objc_build_property_getter_func_call + +2008-03-19 Fariborz Jahanian + + Radar 5471096 + * objc-act.c (objc_is_public): For cateogies, look for 'ivar' + in its class. + +2008-03-11 Fariborz Jahanian + + Radar 5791701 + * objc-act.c (objc_build_aggregate_ivar_layout): Special + treatment when last field is a bitfield for ivar layout. + +2008-03-11 Fariborz Jahanian + + Radar 5781140 + * objc-act.c (objc_build_aggregate_ivar_layout): Check on + no-field and return. + +2008-03-04 Fariborz Jahanian + + Radar 5774213 + * objc-act.c (handle_impent): Output global category name + for 32bit abi only. + +2008-03-03 Fariborz Jahanian + + Radar 5777307 + * objc-act.c (lookup_nested_method): Lookup in protocol list for + setter/getter declarations. + +2008-03-03 Fariborz Jahanian + + Radar 5698469 + * objc-act.c (objc_add_property_variable): Say "default assign" + when warning. + +2008-02-14 Fariborz Jahanian + + Radar 5724385 + * objc-act.c (build_v2_ivar_list_initializer): Remove dead code. + Fix alignment of fields to the alignment of underlying type. + (generate_v2_ivar_lists): Compute number of ivars to exclude unnamed + bitfields. + +2008-02-06 Josh Conner + + Radar 5726269 + * objc-act.c (objc_init): Invoke OBJC_TARGET_FLAG_OBJC_ABI. + +2008-01-16 Fariborz Jahanian + + Radar 5370783 + * objc-act.c (add_method_to_hash_list): Change argument passed + to comp_proto_with_proto. + (objc_add_method): Ditto. + (objc_process_getter_setter): Change argument passed + to match_proto_with_proto. + (match_proto_with_proto): With 'strict' equal 1, allow + valid object pointer conversion as valid type match. + (really_start_method): Allow finding prototype in one + of super classes of current implementation. + +2008-01-14 Fariborz Jahanian + + Radar 5676962 + * objc-act.c (objc_build_struct): Save and restore + TYPE_LANG_SPECIFIC objects. + +2008-01-10 Josh Conner + + Radar 5675908 + * objc-act.c (objc_synthesize_new_setter): Don't force + flag_objc_gc to 1 before calling build_modify_expr. + +2008-01-10 Josh Conner + + Radar 5680184 + * objc-act.c (objc_init): Add support for + flag_objc_legacy_dispatch with objc-2.0. + (synth_module_prologue): Likewise. + (get_arg_type_list): Likewise. + (objc_finish_message_expr): Likewise. + +2007-11-29 Fariborz Jahanian + + Radar 5607453 + * objc-act.c (objc_add_property_variable): Exclude 'id' and + 'Class" object types for "NSCopying" protocol warning. + +2007-11-28 Fariborz Jahanian + + Radar 5610134 + * objc-act.c (ivar_offset_ref): assertion added. + (objc_synthesize_new_getter): Produce non-fragile offset tree + for 64bit ABI. + (objc_synthesize_new_setter): Ditto. + 2007-11-05 Josh Conner Radar 5569420 @@ -25,13 +370,13 @@ 2007-08-21 Fariborz Jahanian - Radar 5424473 + Radar 5424473 * objc-act.c (start_method_def): Exclude +finalize from warning issuance (was radar 4757423). 2007-08-20 Fariborz Jahanian - Radar 5422751 + Radar 5422751 * objc-act.c (objc_protocol_implementation): Function removed. 2007-08-17 Fariborz Jahanian @@ -42,7 +387,7 @@ 2007-08-16 Fariborz Jahanian - Radar 3533972 + Radar 3533972 * objc-act.c (objc_finish_message_expr): Do the receiver type conversion if user has provided one. @@ -54,36 +399,36 @@ 2007-08-14 Fariborz Jahanian - Radar 5407792 + Radar 5407792 * objc-act.c (objc_v2_encode_prop_attr): Add 'N' for nonatomic property attribute encoding. 2007-08-10 Fariborz Jahanian - Radar 5376125 - * objc-act.c (objc_warn_direct_ivar_access): New - (objc_build_getter_call): Warn if 'ivar' accessed outside - property context. - (objc_synthesize_new_getter): Turn off above warning if 'ivar' is - accessed for getter synthesis. - (objc_synthesize_new_setter): Turn off above warning if 'ivar' is - accessed for setter synthesis. + Radar 5376125 + * objc-act.c (objc_warn_direct_ivar_access): New + (objc_build_getter_call): Warn if 'ivar' accessed outside + property context. + (objc_synthesize_new_getter): Turn off above warning if 'ivar' is + accessed for getter synthesis. + (objc_synthesize_new_setter): Turn off above warning if 'ivar' is + accessed for setter synthesis. 2007-08-10 Fariborz Jahanian - Radar 5398274 - * objc-act.c (objc_synthesize_new_setter): Set 'used' flag - on '_value' argument when doing lhs = _value; + Radar 5398274 + * objc-act.c (objc_synthesize_new_setter): Set 'used' flag + on '_value' argument when doing lhs = _value; 2007-08-08 Fariborz Jahanian - Radar 5389292 + Radar 5389292 * objc-act.c (objc_declare_property_impl): For ivar decl. get the underlying bitfield type for comparison. 2007-08-07 Fariborz Jahanian - Radar 5390587 + Radar 5390587 * objc-act.c (objc_build_property_reference_expr): Preserve the original receiver.property_name information. (objc_resolve_build_property_setter_name): Get 'setter' name from original property name. @@ -93,7 +438,7 @@ 2007-07-31 Fariborz Jahanian - Radar 5259868 + Radar 5259868 * objc-act.c (objc_build_ivar_layout): Compress ivar layout nibbles if can. @@ -115,19 +460,19 @@ 2007-07-17 Fariborz Jahanian - Radar 5338634 + Radar 5338634 * objc-act.c (finish_class): Fix check for name conflict between property name and its setter name. 2007-07-16 Fariborz Jahanian - Radar 5333233 + Radar 5333233 * objc-act.c (generate_v2_shared_structures): If class has no 'ivar', set 'field' to class's hiden field (for its super class). 2007-07-13 Fariborz Jahanian - Radar 5277239 + Radar 5277239 * objc-act.c (lookup_method_static): Takes a new argument. (objc_property_access_info): Now recognizes 'receiver' when it is a class object. @@ -145,7 +490,7 @@ 2007-07-10 Fariborz Jahanian - Radar 5285911 + Radar 5285911 * objc-tree.def (OBJC_PROPERTY_REFERENCE_EXPR): New code tree. * objc-act.c (objc_property_access_info): New (objc_build_property_reference_expr): New @@ -161,41 +506,41 @@ 2007-06-29 Fariborz Jahanian - Radar 5082000 - * lang-specs.h (print-objc-ivar-layout): Add - * objc-act.c (total_type_elements): New - (OUTPUT_LAYOUT_BYTE): New macro - (adjust_max_layout_buf_size): New - (objc_build_aggregate_ivar_layout): Add support to handle - layout for ivar of array type. - (objc_build_ivar_layout): Modified to support dynamic - buffer allocation and printing of gc ivar layout on demand. + Radar 5082000 + * lang-specs.h (print-objc-ivar-layout): Add + * objc-act.c (total_type_elements): New + (OUTPUT_LAYOUT_BYTE): New macro + (adjust_max_layout_buf_size): New + (objc_build_aggregate_ivar_layout): Add support to handle + layout for ivar of array type. + (objc_build_ivar_layout): Modified to support dynamic + buffer allocation and printing of gc ivar layout on demand. 2007-06-29 Fariborz Jahanian - Radar 5251019 - * objc-act.c (objc_build_ivar_layout): ivar layout nibble string - must include count of words to skip at the end. + Radar 5251019 + * objc-act.c (objc_build_ivar_layout): ivar layout nibble string + must include count of words to skip at the end. 2007-06-29 Fariborz Jahanian - Radar 5276085 + Radar 5276085 - * objc-tree.def (OBJC_WEAK_REFERENCE_EXPR): New tree code. - (objc_tree_is_weak_expr): New routine to decide if expression - is 'weak' reference. - (objc_build_weak_reference_tree): New routine to build a - 'weak' reference tree. - (objc_weak_reference_expr): New routine to return the 'weak' - reference expression tree. + * objc-tree.def (OBJC_WEAK_REFERENCE_EXPR): New tree code. + (objc_tree_is_weak_expr): New routine to decide if expression + is 'weak' reference. + (objc_build_weak_reference_tree): New routine to build a + 'weak' reference tree. + (objc_weak_reference_expr): New routine to return the 'weak' + reference expression tree. (objc_synthesize_getter, objc_synthesize_new_getter): Call objc_build_weak_reference_tree. - (objc_generate_weak_read): Removed. - (objc_remove_weak_read): Removed. - (objc_gimplify_expr): Take a OBJC_WEAK_REFERENCE_EXPR - tree and covert it into a 'weak' reference API before - gimplification. + (objc_generate_weak_read): Removed. + (objc_remove_weak_read): Removed. + (objc_gimplify_expr): Take a OBJC_WEAK_REFERENCE_EXPR + tree and covert it into a 'weak' reference API before + gimplification. 2007-06-29 Fariborz Jahanian @@ -205,19 +550,19 @@ 2007-06-18 Fariborz Jahanian - Radar 5265737 - * objc-act.c (objc_v2_build_setter_call, objc_build_setter_call): - Look into rhs of TARGET_EXPR for the getter tree (c++ only). + Radar 5265737 + * objc-act.c (objc_v2_build_setter_call, objc_build_setter_call): + Look into rhs of TARGET_EXPR for the getter tree (c++ only). 2007-06-18 Fariborz Jahanian - Radar 5265608 - * objc-act.c (objc_declare_property_impl): Error reporting - replaces gcc_assert. + Radar 5265608 + * objc-act.c (objc_declare_property_impl): Error reporting + replaces gcc_assert. 2007-06-06 Fariborz Jahanian - Radar 5250860 (Remove old property) + Radar 5250860 (Remove old property) * objc/objc-act.c (objc_set_property_attr, objc_add_property_variable, objc_build_getter_call, objc_setter_func_call, objc_v2_encode_prop_attr, @@ -233,7 +578,7 @@ 2007-05-31 Fariborz Jahanian - Radar 5172645 + Radar 5172645 * objc-act.c (objc_add_property_variable): Check for warn_property_assign_default flag added. @@ -245,13 +590,13 @@ 2007-05-29 Fariborz Jahanian - Radar 5217964 - * objc-act.c (objc_build_ivar_layout): Skip count bits must all - come before the scan count bits. + Radar 5217964 + * objc-act.c (objc_build_ivar_layout): Skip count bits must all + come before the scan count bits. 2007-05-23 Fariborz Jahanian - Radar 5195402 + Radar 5195402 * objc-act.c (objc_check_nsstring_pointer_type): New (objc_check_format_nsstring): Call objc_check_nsstring_pointer_type @@ -266,24 +611,24 @@ 2007-05-17 Fariborz Jahanian - Radar 5207415 - * objc-act.c (objc_synthesize_new_getter): Use existing getter name for - synthesis. - (objc_synthesize_new_setter): Use existing setter name for synthesis. + Radar 5207415 + * objc-act.c (objc_synthesize_new_getter): Use existing getter name for + synthesis. + (objc_synthesize_new_setter): Use existing setter name for synthesis. 2007-05-16 Fariborz Jahanian - Radar 5207415 - * objc-act.c (objc_synthesize_new_getter): Use existing getter name for - synthesis. - (objc_synthesize_new_setter): Use existing setter name for synthesis. + Radar 5207415 + * objc-act.c (objc_synthesize_new_getter): Use existing getter name for + synthesis. + (objc_synthesize_new_setter): Use existing setter name for synthesis. 2007-05-12 Fariborz Jahanian - Radar 5192466 - * objc-act.c (build_v2_protocol_template): Define two new fields - for 'struct protocol_t'. - (build_protocol_initializer): Initialize the two new fields. + Radar 5192466 + * objc-act.c (build_v2_protocol_template): Define two new fields + for 'struct protocol_t'. + (build_protocol_initializer): Initialize the two new fields. 2007-05-07 Fariborz Jahanian @@ -299,9 +644,9 @@ 2007-05-03 Fariborz Jahanian - Radar 5180172 - * objc-act.c (objc_declare_property_impl): Issue error on use of @synthesize - in a category implementation. + Radar 5180172 + * objc-act.c (objc_declare_property_impl): Issue error on use of @synthesize + in a category implementation. 2007-05-03 Fariborz Jahanian @@ -311,13 +656,13 @@ 2007-04-30 Fariborz Jahanian - Radar 5159695 + Radar 5159695 * objc-act.c (objc_add_property_variable): Warn on mismatched attribute in class continuation property declaration. 2007-04-30 Fariborz Jahanian - Radar 5168496 + Radar 5168496 * objc-act.c (managed_objc_object_pointer): New (objc_add_property_setter_method): Call it instead of objc_type_valid_for_messaging. @@ -327,60 +672,60 @@ 2007-04-25 Fariborz Jahanian - Radar 5159707 + Radar 5159707 * objc-act.c (objc_add_property_variable): Warn on mismatched type of property in class continuation and its main class. 2007-04-23 Fariborz Jahanian - Radar 5153561 - * objc-act.c (objc_init): Initialize data structures needed in - objc2_eh_runtime_type routine. + Radar 5153561 + * objc-act.c (objc_init): Initialize data structures needed in + objc2_eh_runtime_type routine. 2007-04-23 Fariborz Jahanian - Radar 5142207 - * objc-act.c (IS_CLS_META, CLS_HIDDEN, OBJC2_CLS_HIDDEN): New macros. - (build_shared_structure_initializer): Use IS_CLS_META. - (generate_v2_shared_structures): Add CLS_HIDDEN flag to 'info' field - of class's meta-data. - (generate_v2_shared_structures): Use OBJC2_CLS_HIDDEN instead of numeric - value. + Radar 5142207 + * objc-act.c (IS_CLS_META, CLS_HIDDEN, OBJC2_CLS_HIDDEN): New macros. + (build_shared_structure_initializer): Use IS_CLS_META. + (generate_v2_shared_structures): Add CLS_HIDDEN flag to 'info' field + of class's meta-data. + (generate_v2_shared_structures): Use OBJC2_CLS_HIDDEN instead of numeric + value. 2007-04-20 Fariborz Jahanian - Radar 5130983 - * objc-act.c (objc_finish_foreach_loop): Issue error on non-lvalue - selector expression. + Radar 5130983 + * objc-act.c (objc_finish_foreach_loop): Issue error on non-lvalue + selector expression. 2007-03-12 Fariborz Jahanian - Radar 5023725 - * objc-act.c (OBJC_FLAG_ZEROCOST_EXCEPTIONS): New macro - (objc_init_exceptions): Use it. + Radar 5023725 + * objc-act.c (OBJC_FLAG_ZEROCOST_EXCEPTIONS): New macro + (objc_init_exceptions): Use it. 2007-04-19 Fariborz Jahanian - Radar 5140757 - * objc-act.c (objc_build_compound_setter_call): Use save_expr - instead of copy_node for rhs. + Radar 5140757 + * objc-act.c (objc_build_compound_setter_call): Use save_expr + instead of copy_node for rhs. 2007-04-18 Fariborz Jahanian - Radar 5128402 - * objc-act.c (objc_finish_foreach_loop): Set elem to nil at the else part - of the outer if-stmt instead of at the begining. + Radar 5128402 + * objc-act.c (objc_finish_foreach_loop): Set elem to nil at the else part + of the outer if-stmt instead of at the begining. 2007-04-09 Fariborz Jahanian - Radar 5096648 - * objc-act.c (TARGET_CFSTRING_P): Removed - (objc_NSString_format): Removed + Radar 5096648 + * objc-act.c (TARGET_CFSTRING_P): Removed + (objc_NSString_format): Removed 2007-04-05 Fariborz Jahanian - Radar 5109807 - * objc-act.c (objc_build_ivar_layout): skip the gap + Radar 5109807 + * objc-act.c (objc_build_ivar_layout): skip the gap 2007-04-02 Fariborz Jahanian @@ -391,307 +736,307 @@ 2007-03-30 Fariborz Jahanian - Radar 4727191 (tweaked) - (objc_build_compound_setter_call): Set DECL_SEEN_IN_BIND_EXPR_P - on Dupe'd local variable. + Radar 4727191 (tweaked) + (objc_build_compound_setter_call): Set DECL_SEEN_IN_BIND_EXPR_P + on Dupe'd local variable. 2007-03-29 Fariborz Jahanian - Radar 5096644 - * objc-act.c (objc_add_property_variable): Check for forward class - use of property type before doing some checking. + Radar 5096644 + * objc-act.c (objc_add_property_variable): Check for forward class + use of property type before doing some checking. 2007-03-29 Fariborz Jahanian - - Radar 5080710 - * objc-act.c (objc_finish_message_expr, build_objc_method_call, - objc_synthesize_new_getter, objc_synthesize_new_setter): Added check - for TREE_ADDRESSABLE flag in deciding if method returns its structure - value in memory. + + Radar 5080710 + * objc-act.c (objc_finish_message_expr, build_objc_method_call, + objc_synthesize_new_getter, objc_synthesize_new_setter): Added check + for TREE_ADDRESSABLE flag in deciding if method returns its structure + value in memory. 2007-03-29 Fariborz Jahanian - Radar 4947014 - objc atomic property + Radar 4947014 - objc atomic property - * objc-act.h (umsg_GetAtomicProperty, umsg_SetAtomicProperty, - umsg_CopyAtomicStruct, umsg_NSCopying_Type): New decl. - (ATOMIC_PROPERTY, PROPERTY): New macros. - * objc-act.c (objc_set_property_attr): Register atomic/nonatomic - properties. - (objc_add_property_variable): Issue new warning for -fobjc-gc-only - when default 'assign' property's object implements ''. - (declare_atomic_property_api): New routine - (build_id_NSCopying_type): New routine - (declare_prototype_property_bycopy): Clean up to call build_id_NSCopying_type. - (aggregate_contains_objc_pointer): New routine - (diagnose_property_mismatch): Diagnose on atomic/nonatomic mismatch. - (objc_synthesize_new_getter): Generate atomic 'helper's in getters for - 'copy'/'retain', as well as those struct objects passed in memory under - a variety of situations. - (objc_synthesize_new_setter): Generate atomic 'helper's in setters for - 'copy'/'retain', as well as those struct objects passed in memory under - a variety of situations. + * objc-act.h (umsg_GetAtomicProperty, umsg_SetAtomicProperty, + umsg_CopyAtomicStruct, umsg_NSCopying_Type): New decl. + (ATOMIC_PROPERTY, PROPERTY): New macros. + * objc-act.c (objc_set_property_attr): Register atomic/nonatomic + properties. + (objc_add_property_variable): Issue new warning for -fobjc-gc-only + when default 'assign' property's object implements ''. + (declare_atomic_property_api): New routine + (build_id_NSCopying_type): New routine + (declare_prototype_property_bycopy): Clean up to call build_id_NSCopying_type. + (aggregate_contains_objc_pointer): New routine + (diagnose_property_mismatch): Diagnose on atomic/nonatomic mismatch. + (objc_synthesize_new_getter): Generate atomic 'helper's in getters for + 'copy'/'retain', as well as those struct objects passed in memory under + a variety of situations. + (objc_synthesize_new_setter): Generate atomic 'helper's in setters for + 'copy'/'retain', as well as those struct objects passed in memory under + a variety of situations. 2007-03-29 Fariborz Jahanian - Radar 4564694 - * objc-act.c (objc_is_reserved_word): @package is new objc keyword. - (add_instance_variable): Treat @package ivar same as @public (32bit) - and same as @private (64bit) for linkage purposes. + Radar 4564694 + * objc-act.c (objc_is_reserved_word): @package is new objc keyword. + (add_instance_variable): Treat @package ivar same as @public (32bit) + and same as @private (64bit) for linkage purposes. 2007-03-27 Fariborz Jahanian - Radar 5040740 - * objc-act.c (lookup_nested_method): New - (objc_synthesize_new_getter): Call lookup_nested_method. - (objc_synthesize_new_setter): Ditto. - (lookup_nested_property): New - (objc_declare_property_impl): Call lookup_nested_property. + Radar 5040740 + * objc-act.c (lookup_nested_method): New + (objc_synthesize_new_getter): Call lookup_nested_method. + (objc_synthesize_new_setter): Ditto. + (lookup_nested_property): New + (objc_declare_property_impl): Call lookup_nested_property. 2007-03-23 Fariborz Jahanian - - Radar 5060975 - * objc-act.c (build_objc_exception_stuff): objc_exception_throw (id) - claims that it may throw an exception + + Radar 5060975 + * objc-act.c (build_objc_exception_stuff): objc_exception_throw (id) + claims that it may throw an exception 2007-03-27 Fariborz Jahanian - Radar 5025001 - * objc-act.c (objc_build_struct): Inser a new char :0 bf if last ivar - was a bitfield. - (build_v2_ivar_list_initializer): Fix an unrelated objctivec-c++ bug. + Radar 5025001 + * objc-act.c (objc_build_struct): Inser a new char :0 bf if last ivar + was a bitfield. + (build_v2_ivar_list_initializer): Fix an unrelated objctivec-c++ bug. 2007-03-27 Fariborz Jahanian - Radar 5005756 - * objc-act.c (build_objc_method_call, build_v2_build_objc_method_call): - Don't check on method attributes sent to receiver of 'id' or 'Class' - types. + Radar 5005756 + * objc-act.c (build_objc_method_call, build_v2_build_objc_method_call): + Don't check on method attributes sent to receiver of 'id' or 'Class' + types. 2007-03-23 Fariborz Jahanian - Radar 5002848 - * objc-act.c (generating_property_type_encoding): Declare - (objc_v2_encode_prop_attr): Set generating_property_type_encoding. - (encode_pointer): Get underlying type of a type name for encoding. + Radar 5002848 + * objc-act.c (generating_property_type_encoding): Declare + (objc_v2_encode_prop_attr): Set generating_property_type_encoding. + (encode_pointer): Get underlying type of a type name for encoding. 2007-03-23 Fariborz Jahanian - Radar 4985544 - * objc-act.c (objc_check_format_nsstring): New - (objc_NSString_format): New + Radar 4985544 + * objc-act.c (objc_check_format_nsstring): New + (objc_NSString_format): New 2007-03-22 Fariborz Jahanian - Radar 4994854 - * objc-act.c (objc_start_category_interface): If anonymous category - already declared, then use it. - (objc_add_property_variable): Insert new property into primary class. + Radar 4994854 + * objc-act.c (objc_start_category_interface): If anonymous category + already declared, then use it. + (objc_add_property_variable): Insert new property into primary class. 2007-03-22 Fariborz Jahanian - Radar 4965989 - * objc-act.h (ANONYMOUS_CATEGORY): New macro. - * objc-act.c (objc_add_property_variable): Add merging of - property in anonymous category into primary class. - (objc_merge_methods): New. - (finish_class): Merge methods from anonymous categories into - primary class. + Radar 4965989 + * objc-act.h (ANONYMOUS_CATEGORY): New macro. + * objc-act.c (objc_add_property_variable): Add merging of + property in anonymous category into primary class. + (objc_merge_methods): New. + (finish_class): Merge methods from anonymous categories into + primary class. 2007-03-22 Fariborz Jahanian - Removed objc2 hybrid abi - * objc-act.c: All code and checking related to hybrid abi - is removed. + Removed objc2 hybrid abi + * objc-act.c: All code and checking related to hybrid abi + is removed. 2007-03-22 Fariborz Jahanian - Radar 4995942 - * objc-act.c (objc2_build_ehtype_initializer): Change setting of - _objc_ehtype_vtable field. + Radar 4995942 + * objc-act.c (objc2_build_ehtype_initializer): Change setting of + _objc_ehtype_vtable field. 2007-03-22 Fariborz Jahanian - Radar 4995066 - * objc-act.c (objc_build_ivar_assignment): Takes new argument. - (objc_build_ivar_assignment): Call objc2_outervar for valid - 'non-fragile' ivars only. - (objc_generate_write_barrier): Add objc2_ivar_ref as 2nd argument. + Radar 4995066 + * objc-act.c (objc_build_ivar_assignment): Takes new argument. + (objc_build_ivar_assignment): Call objc2_outervar for valid + 'non-fragile' ivars only. + (objc_generate_write_barrier): Add objc2_ivar_ref as 2nd argument. 2007-03-22 Fariborz Jahanian - Radar 4982951 - * objc-act.c (objc2_outervar): New - (objc2_build_indirect_ref_ivar2): New - (objc_substitute_decl): Handle objc2's 'non-fragile' ivar reference. - (objc_build_ivar_assignment): Get the outervar for objc2 - (objc_v2_ivar_reference): Now returns the objc2's ivar offset variable - upon success. - (objc_strip_off_indirection, objc_generate_write_barrier): Calls - objc_v2_ivar_reference differently. + Radar 4982951 + * objc-act.c (objc2_outervar): New + (objc2_build_indirect_ref_ivar2): New + (objc_substitute_decl): Handle objc2's 'non-fragile' ivar reference. + (objc_build_ivar_assignment): Get the outervar for objc2 + (objc_v2_ivar_reference): Now returns the objc2's ivar offset variable + upon success. + (objc_strip_off_indirection, objc_generate_write_barrier): Calls + objc_v2_ivar_reference differently. 2007-03-22 Fariborz Jahanian - Radar 4957534 - * objc-act.c (objc2_build_throw_call): Call objc_exception_rethrow - for @throw in objc2's abi. - (build_objc_exception_stuff): Define objc_rethrow_exception_decl. - * objc-act.h (objc_rethrow_exception_decl): Renamed from - objc_rethrow_exception (previously unsed). + Radar 4957534 + * objc-act.c (objc2_build_throw_call): Call objc_exception_rethrow + for @throw in objc2's abi. + (build_objc_exception_stuff): Define objc_rethrow_exception_decl. + * objc-act.h (objc_rethrow_exception_decl): Renamed from + objc_rethrow_exception (previously unsed). 2007-03-22 Fariborz Jahanian - Radar 5008110 - part2 (minor tweak) - * objc-act.c (init_UOBJC2_EHTYPE_decls): Moved up. - (objc2_build_ehtype_initializer): Call init_UOBJC2_EHTYPE_decls. + Radar 5008110 - part2 (minor tweak) + * objc-act.c (init_UOBJC2_EHTYPE_decls): Moved up. + (objc2_build_ehtype_initializer): Call init_UOBJC2_EHTYPE_decls. 2007-03-22 Fariborz Jahanian - Radar 5008110 - * objc-act.c (objc2_build_ehtype_var_decl): Takes two new argument. - (objc2_objc_exception_attr): New - (objc2_eh_runtime_type): Generate extern or weak EHTYPE meta-data - depending on setting of __objc_exception__ attribute. - (generate_v2_shared_structures): Generate EHTYPE meta-data depending on setting - of __objc_exception__ attribute. + Radar 5008110 + * objc-act.c (objc2_build_ehtype_var_decl): Takes two new argument. + (objc2_objc_exception_attr): New + (objc2_eh_runtime_type): Generate extern or weak EHTYPE meta-data + depending on setting of __objc_exception__ attribute. + (generate_v2_shared_structures): Generate EHTYPE meta-data depending on setting + of __objc_exception__ attribute. 2007-03-22 Fariborz Jahanian - Radar 4951324 - * objc-act.c (objc2_eh_runtime_type): Remove call to - init_UOBJC2_EHTYPE_decls. - (objc_init_exceptions): Call init_UOBJC2_EHTYPE_decls here. - (objc2_build_extern_decl_catch_object): New - (objc_begin_catch_clause): Call objc2_build_extern_decl_catch_object - to declare objc2's new typeinfo declarations. + Radar 4951324 + * objc-act.c (objc2_eh_runtime_type): Remove call to + init_UOBJC2_EHTYPE_decls. + (objc_init_exceptions): Call init_UOBJC2_EHTYPE_decls here. + (objc2_build_extern_decl_catch_object): New + (objc_begin_catch_clause): Call objc2_build_extern_decl_catch_object + to declare objc2's new typeinfo declarations. 2007-03-22 Fariborz Jahanian - Radar 4995967 - * objc-act.c (objc_begin_catch_clause) Assume 'id obj' for - the @catch (...) expression. + Radar 4995967 + * objc-act.c (objc_begin_catch_clause) Assume 'id obj' for + the @catch (...) expression. 2007-03-22 Fariborz Jahanian - Radar 2848255 - * objc-act.h: New declaratons for objc2 exception APIs. - * objc-act.c (objc_init): Use objc2_eh_runtime_type with - -fobjc-zerocost-exceptions for exception type mangling. - (create_weak_decl): New. - (objc2_build_ehtype): New. - objc2_build_ehtype_initializer): New. - (objc2_build_ehtype_var_decl): New. - (objc2_valid_objc_catch_type): New. - (objc2_eh_runtime_type): New. - (objc_init_exceptions): New objc2 exception initialization, - declare __objc_personality_v0 personality function. - (objc_begin_catch_clause): Add support for objc2 catch ABI and - new @catch(...) syntax. - (objc2_liteweight_finish_try_stmt): New. - (objc_finish_catch_clause): Add support for insertion of - new control for objc2 catch. - (objc_build_throw_stmt): Now calls objc2_build_throw_call. - (objc2_build_throw_call): New routine to call for the throw ABI. - (build_objc_exception_stuff): Declares vaiours objc2 new ABI functions. + Radar 2848255 + * objc-act.h: New declaratons for objc2 exception APIs. + * objc-act.c (objc_init): Use objc2_eh_runtime_type with + -fobjc-zerocost-exceptions for exception type mangling. + (create_weak_decl): New. + (objc2_build_ehtype): New. + objc2_build_ehtype_initializer): New. + (objc2_build_ehtype_var_decl): New. + (objc2_valid_objc_catch_type): New. + (objc2_eh_runtime_type): New. + (objc_init_exceptions): New objc2 exception initialization, + declare __objc_personality_v0 personality function. + (objc_begin_catch_clause): Add support for objc2 catch ABI and + new @catch(...) syntax. + (objc2_liteweight_finish_try_stmt): New. + (objc_finish_catch_clause): Add support for insertion of + new control for objc2 catch. + (objc_build_throw_stmt): Now calls objc2_build_throw_call. + (objc2_build_throw_call): New routine to call for the throw ABI. + (build_objc_exception_stuff): Declares vaiours objc2 new ABI functions. 2007-02-06 Fariborz Jahanian - Radar 4894756 - * objc-act.c (STRING_V2_IVAR_OFFSET_PREFIX): New macro. - (objc_v2_ivar_reference): New routine. - (objc_strip_off_indirection): Don't strip off an objc2 ivar - reference tree. - (objc_is_ivar_reference_p): Check for objc2 ivar tree. - (objc_generate_write_barrier): Added support for generation - of write barrier for new objc2 ivar reference tree. - (objc_class_visibility): Use STRING_V2_IVAR_OFFSET_PREFIX. + Radar 4894756 + * objc-act.c (STRING_V2_IVAR_OFFSET_PREFIX): New macro. + (objc_v2_ivar_reference): New routine. + (objc_strip_off_indirection): Don't strip off an objc2 ivar + reference tree. + (objc_is_ivar_reference_p): Check for objc2 ivar tree. + (objc_generate_write_barrier): Added support for generation + of write barrier for new objc2 ivar reference tree. + (objc_class_visibility): Use STRING_V2_IVAR_OFFSET_PREFIX. 2007-02-06 Fariborz Jahanian - Radar 4966565 - * objc-act.c (get_category_base_class_impl): New. - (lookup_accessor_in_base_class_impl): New. - (objc_gen_property_data): Further look into base class - implementation before issuing warning on unimplemented - accessor. + Radar 4966565 + * objc-act.c (get_category_base_class_impl): New. + (lookup_accessor_in_base_class_impl): New. + (objc_gen_property_data): Further look into base class + implementation before issuing warning on unimplemented + accessor. 2007-02-06 Fariborz Jahanian - Radar 4963113 - * objc-act.c (check_methods_accessible): Do not warn of unimplemmented + Radar 4963113 + * objc-act.c (check_methods_accessible): Do not warn of unimplemmented 2007-02-06 Fariborz Jahanian - Radar 4968128 - * objc-act.c (strip_end_colon): New - (finish_class): Call strip_end_colon to strip ':' - for setter method name declaration. + Radar 4968128 + * objc-act.c (strip_end_colon): New + (finish_class): Call strip_end_colon to strip ':' + for setter method name declaration. 2007-02-06 Fariborz Jahanian - Radar 4959107 - * objc-act.c (objc_build_getter_call): Lookup in protocol list also. + Radar 4959107 + * objc-act.c (objc_build_getter_call): Lookup in protocol list also. 2007-02-06 Fariborz Jahanian - Radar 4951615 - * objc-act.h (IVAR_PUBLIC_OR_PROTECTED): New macro. - * objc-act.c (ivar_offset_ref): Use IVAR_PUBLIC_OR_PROTECTED to - decide if 'ivar' offset variable is 'private extern' or not. - (add_instance_variable): Set IVAR_PUBLIC_OR_PROTECTED flag. + Radar 4951615 + * objc-act.h (IVAR_PUBLIC_OR_PROTECTED): New macro. + * objc-act.c (ivar_offset_ref): Use IVAR_PUBLIC_OR_PROTECTED to + decide if 'ivar' offset variable is 'private extern' or not. + (add_instance_variable): Set IVAR_PUBLIC_OR_PROTECTED flag. 2007-02-06 Fariborz Jahanian - Radar 4954480 - * objc-act.c (objc_v2_build_ivar_ref): Check for bad 'ivar' use. + Radar 4954480 + * objc-act.c (objc_v2_build_ivar_ref): Check for bad 'ivar' use. 2007-02-06 Fariborz Jahanian - Radar 4949034 - * objc-act.c (objc_init): Set default setting - for flag_objc_call_cxx_cdtors. + Radar 4949034 + * objc-act.c (objc_init): Set default setting + for flag_objc_call_cxx_cdtors. 2007-02-06 Fariborz Jahanian - Radar 4923634 - * objc-act.c (finish_objc): Use correct value for objc2's - CLS_HAS_CXX_STRUCTORS flag. + Radar 4923634 + * objc-act.c (finish_objc): Use correct value for objc2's + CLS_HAS_CXX_STRUCTORS flag. 2007-02-06 Fariborz Jahanian - Radar 4945770 - * objc-act.c (objc_build_struct): Check for corner cases before - building the TYPE_OBJC_INFO tree list. + Radar 4945770 + * objc-act.c (objc_build_struct): Check for corner cases before + building the TYPE_OBJC_INFO tree list. 2007-02-06 Fariborz Jahanian - Radar 4897159 - * objc-act.c (objc_synthesize_new_setter): Get the first argument - of setter in a fail-safe manner. + Radar 4897159 + * objc-act.c (objc_synthesize_new_setter): Get the first argument + of setter in a fail-safe manner. 2007-02-06 Fariborz Jahanian - Radar 4899564 - * objc-act.c (finish_class): Diagnose __weak on 'retain'/'copy'. + Radar 4899564 + * objc-act.c (finish_class): Diagnose __weak on 'retain'/'copy'. 2007-02-06 Fariborz Jahanian - Radar 4903391 - * objc-act.c (objc_common_type): Take a new value for argno - for property @synthesize type comparison. - (objc_declare_property_impl): Call objc_compare_types to - compare ivar and property's type according to objc's type - conversion rules. + Radar 4903391 + * objc-act.c (objc_common_type): Take a new value for argno + for property @synthesize type comparison. + (objc_declare_property_impl): Call objc_compare_types to + compare ivar and property's type according to objc's type + conversion rules. 2007-02-06 Fariborz Jahanian - Radar 4879524 - * objc-act.c (objc_add_property_variable): typo in warning fixed. + Radar 4879524 + * objc-act.c (objc_add_property_variable): typo in warning fixed. 2007-02-06 Fariborz Jahanian - Radar 4781080 - * objc-act.c (objc_finish_message_expr): Use umsg_fixup_decl for - float/double returning methods. + Radar 4781080 + * objc-act.c (objc_finish_message_expr): Use umsg_fixup_decl for + float/double returning methods. 2006-12-18 Fariborz Jahanian @@ -701,66 +1046,66 @@ 2006-12-15 Fariborz Jahanian - Radar 4449535 - * objc-act.c (objc_impl_forwardInvocation): New - (check_protocol): Call objc_impl_forwardInvocation + Radar 4449535 + * objc-act.c (objc_impl_forwardInvocation): New + (check_protocol): Call objc_impl_forwardInvocation 2006-12-16 Fariborz Jahanian - Radar 4838528 - * objc-act.c (objc_setter_func_call): Check type of - setter method. + Radar 4838528 + * objc-act.c (objc_setter_func_call): Check type of + setter method. 2006-12-14 Fariborz Jahanian - Radar 4841013 - * objc-act.h (PROPERTY_ASSIGN): Modified - * objc-act.c (objc_add_property_variable): No 'assign' - warning for 'readonly' property decl. + Radar 4841013 + * objc-act.h (PROPERTY_ASSIGN): Modified + * objc-act.c (objc_add_property_variable): No 'assign' + warning for 'readonly' property decl. 2006-12-14 Fariborz Jahanian - Radar 4712415 - * objc-act.c (objc_add_property_variable): Carry deprecated attribute - into property node. - (objc_add_property_setter_method): Carry deprecated attribute from - property node into instance method node. - (finish_class): Ditto + Radar 4712415 + * objc-act.c (objc_add_property_variable): Carry deprecated attribute + into property node. + (objc_add_property_setter_method): Carry deprecated attribute from + property node into instance method node. + (finish_class): Ditto 2006-12-14 Fariborz Jahanian - Radar 4854605 - * objc-act.c (objc_finish_foreach_loop): Set iterator - to nil. + Radar 4854605 + * objc-act.c (objc_finish_foreach_loop): Set iterator + to nil. 2006-12-14 Fariborz Jahanian - Radar 4855821 - * objc-act.c (objc_add_property_variable): Don't warn if 'assign' - storage attribute is explicit. + Radar 4855821 + * objc-act.c (objc_add_property_variable): Don't warn if 'assign' + storage attribute is explicit. 2006-12-13 Fariborz Jahanian - Radar 4531086 - * objc-act.c (OBJC_WARN_OBJC2_FEATURES): New macro to warn on - use of objc2 features for older OS's. - (objc_init): Warn - (objc_add_property_variable): Warn - (objc_build_foreach_components): Warn + Radar 4531086 + * objc-act.c (OBJC_WARN_OBJC2_FEATURES): New macro to warn on + use of objc2 features for older OS's. + (objc_init): Warn + (objc_add_property_variable): Warn + (objc_build_foreach_components): Warn 2006-12-13 Fariborz Jahanian - Radar 4862848 - * objc-act.c (OBJC_FLAG_OBJC_ABI): define macro if undefined. - (objc_init): Use OBJC_FLAG_OBJC_ABI - (objc_is_public): Error recovery found by accident. + Radar 4862848 + * objc-act.c (OBJC_FLAG_OBJC_ABI): define macro if undefined. + (objc_init): Use OBJC_FLAG_OBJC_ABI + (objc_is_public): Error recovery found by accident. 2006-12-11 Fariborz Jahanian - Radar 4869979 - * objc-act.c (objc_type_has_bycopy_attr): New - (objc_diagnose_bycopy_type): New - (objc_add_method_declaration): Call objc_diagnose_bycopy_type + Radar 4869979 + * objc-act.c (objc_type_has_bycopy_attr): New + (objc_diagnose_bycopy_type): New + (objc_add_method_declaration): Call objc_diagnose_bycopy_type 2006-12-07 Fariborz Jahanian @@ -772,20 +1117,20 @@ 2006-12-01 Fariborz Jahanian - Radar 4859096 + Radar 4859096 * objc-act.c (objc_property_call): New function. 2006-11-17 Fariborz Jahanian - Radar 4843145 - * objc-act.c (objc_visibly_hidden_class): Removed. - (objc_class_visibility): New - (objc_create_global_decl_for_class): New - (ivar_offset_ref): Call objc_create_global_decl_for_class. - (generate_v2_shared_structures): Call - objc_create_global_decl_for_class. - (objc_warn_on_class_attributes): Don't warn on "default" - visibility either. + Radar 4843145 + * objc-act.c (objc_visibly_hidden_class): Removed. + (objc_class_visibility): New + (objc_create_global_decl_for_class): New + (ivar_offset_ref): Call objc_create_global_decl_for_class. + (generate_v2_shared_structures): Call + objc_create_global_decl_for_class. + (objc_warn_on_class_attributes): Don't warn on "default" + visibility either. 2006-11-10 Fariborz Jahanian @@ -795,7 +1140,7 @@ 2006-11-09 Fariborz Jahanian - Radar 4810609 + Radar 4810609 * objc-act.c (objc_init): Set flag_objc_gc if flag_objc_gc_only is set. (generate_objc_image_info): For generate_objc_image_info @@ -803,7 +1148,7 @@ 2006-11-08 Fariborz Jahanian - Radar 4810587 + Radar 4810587 * objc-act.c (finish_objc): Generate objc section info. in all cases. (generate_objc_image_info): Force zeros in objc section not to @@ -811,26 +1156,26 @@ 2006-11-06 Fariborz Jahanian - Radar 4781080 (part 2) + Radar 4781080 (part 2) * objc-act.c (synth_module_prologue): Removed TARGET_i386 switch. (objc_finish_message_expr): Call objc_fpreturn_msgcall in new place. (build_objc_method_call) : Ditto 2006-11-06 Fariborz Jahanian - Radar 4781080 + Radar 4781080 * objc-act.c (objc_finish_message_expr): Call objc_fpreturn_msgcall (build_objc_method_call) : Ditto 2006-11-03 Fariborz Jahanian - Radar 4805612 + Radar 4805612 * objc-act.c (objc_is_public): Check for accessibility of 'ivar' in a c-function nested in an objective-c class. 2006-11-02 Fariborz Jahanian - Radar 4817072 + Radar 4817072 * objc-act.c (objc_lookup_property_ivar): New (objc_synthesize_new_getter, objc_synthesize_new_setter): Call objc_lookup_property_ivar. @@ -899,12 +1244,12 @@ 2006-10-06 Fariborz Jahanian - Radar 4725660 + Radar 4725660 * objc-act.c (objc_build_getter_call): Check for a valid class. 2006-09-29 Fariborz Jahanian - Radar 4757423 + Radar 4757423 * objc-act.c (should_call_super_finalize): New flag. (objc_finish_message_expr): if [super finalize] reset the flag. @@ -915,7 +1260,7 @@ 2006-09-28 Fariborz Jahanian - Radar 4477797 + Radar 4477797 * objc-act.c (objc_build_struct): Set DECL_IGNORED_P flag in 'super' class. @@ -927,7 +1272,7 @@ 2006-09-21 Fariborz Jahanian - Radar 4695274 + Radar 4695274 * objc-act.c (objc_add_internal_ivar): Insert property ivar before c++'s inserted type_decl field node. @@ -939,7 +1284,7 @@ 2006-09-19 Fariborz Jahanian - Radar 4734562 + Radar 4734562 * objc-act.c (objc_demangle): Takes new argument to decide if doing 'pretty' printing or not. (objc_printable_name): Pass down previously @@ -947,20 +1292,20 @@ 2006-09-18 Fariborz Jahanian - Radar 4667060 - * objc-act.c (objc_finish_foreach_loop): Add support for - setting of foreach loop controlling variable to 'nil' on - normal loop exit. + Radar 4667060 + * objc-act.c (objc_finish_foreach_loop): Add support for + setting of foreach loop controlling variable to 'nil' on + normal loop exit. 2006-09-15 Fariborz Jahanian - Radar 4727659 + Radar 4727659 * objc-act.c (really_start_method): Copy 'noreturn' attribute flag into FUNCTION_DECL node. 2006-09-14 Fariborz Jahanian - Radar 4724822 + Radar 4724822 * objc-act.c (lookup_property): Check for incomplete class. @@ -972,7 +1317,7 @@ 2006-09-11 Fariborz Jahanian - Radar 4625843 - part2 + Radar 4625843 - part2 * objc-act.c (object_setProperty_bycopy): New. (synth_module_prologue): Remove prototype declaration of object_getProperty_bycopy and object_setProperty_bycopy builtins. @@ -987,7 +1332,7 @@ 2006-09-07 Fariborz Jahanian - Radar 4660569 + Radar 4660569 * objc-act.c (objc_synthesize_getter): Look up for accessors in categories before issuing the warning. * (objc_synthesize_setter): Ditto. @@ -1001,28 +1346,28 @@ 2006-09-01 Fariborz Jahanian - Radar 4712269 - * objc-act.c (objc_build_compound_incr_decr_setter_call): New. - (objc_v2_build_incr_decl_setter_call): New. - (objc_build_incr_decr_setter_call): New. + Radar 4712269 + * objc-act.c (objc_build_compound_incr_decr_setter_call): New. + (objc_v2_build_incr_decl_setter_call): New. + (objc_build_incr_decr_setter_call): New. 2006-08-31 Fariborz Jahanian - Radar 4712188 + Radar 4712188 * objc-act.c (objc_build_compound_setter_call): Set TREE_NO_WARNING to suppress c++ warning. 2006-08-31 Fariborz Jahanian - Radar 4697411 - * objc-act.c (objc_volatilize_component_ref): New function. + Radar 4697411 + * objc-act.c (objc_volatilize_component_ref): New function. 2006-08-29 Fariborz Jahanian - Radar 4705298 + Radar 4705298 * objc-act.c (objc_visibly_hidden_class): New. (ivar_offset_ref): Select function to declare the symbol - according to setting of the 'visibility' attribute. + according to setting of the 'visibility' attribute. (generate_v2_shared_structures): Ditto. (objc_warn_on_class_attributes): Recognize visibility("hidden") setting attribute on a class. @@ -1048,19 +1393,19 @@ 2006-08-25 Fariborz Jahanian - Radar 4689268 + Radar 4689268 * objc-act.c (start_class): On duplicate class implementation error, return the old class for graceful recovery. 2006-08-25 Fariborz Jahanian - Radar 4699834 + Radar 4699834 * objc-act.c (synth_module_prologue): Removed _rtp suffix from objc_msgSend_fixup_rtp and variants. 2006-08-25 Fariborz Jahanian - Radar 4698856 + Radar 4698856 * objc-act.c (synth_module_prologue): Initialization of UOBJC_V2_CACHE_decl, UOBJC_V2_VTABLE_decl moved. (build_empty_cache_vtable_vars): New routine to declare UOBJC_V2_CACHE_decl @@ -1069,7 +1414,7 @@ 2006-08-24 Fariborz Jahanian - Radar 4695101 + Radar 4695101 * objc-act.h (PROTOCOL_IMPL_OBJ): Removed. * objc-act.c (build_v2_class_template): weakIvarLayout is the new field. @@ -1082,7 +1427,7 @@ 2006-08-24 Fariborz Jahanian - Radar 4695109 + Radar 4695109 * objc/objc-tree.def (PROTOCOL_IMPLEMENTATION_TYPE): Removed. * objc-act.c (objc_protocol_implementation): Now just issue error. (build_v2_protocol_template): New fields for optionalInstanceMethods and @@ -1108,18 +1453,18 @@ 2006-08-22 Fariborz Jahanian - Radar 4491211 + Radar 4491211 * objc-act.c (build_objc_method_call): Method return type must be complete (instantiated) before determining if it is memory bound. 2006-08-17 Fariborz Jahanian - Radar 4590221 + Radar 4590221 * objc-act.c (OFFS_MSGSEND_FAST, OFFS_ASSIGNIVAR_FAST): Moved to darwin.h. (synth_module_prologue): Replace POWERPC64 with check for OFFS_MSGSEND_FAST flag. - Move setting of umsg_fpret_decl to the top. + Move setting of umsg_fpret_decl to the top. Remove setting of flag_objc_direct_dispatch. (objc_build_ivar_assignment): Use objc_assign_ivar_decl unconditionally. (build_next_objc_exception_stuff): Replace TARGET_POWERPC with check @@ -1130,7 +1475,7 @@ 2006-08-16 Fariborz Jahanian - Radar 4660579 + Radar 4660579 * objc/objc-act.c (objc_add_property_setter_method): New. (objc_add_property_variable): Resolve conflict between 'readonly' interface property and writable implementation @@ -1141,14 +1486,14 @@ 2006-08-15 Fariborz Jahanian - Radar 4668023 + Radar 4668023 * objc/objc-act.c (build_property_reference): Removed. (objc_lookup_ivar): Supert for property name access without use of 'self' qualifier is removed. 2006-08-14 Fariborz Jahanian - Radar 4666559 + Radar 4666559 * objc/objc-act.c (objc_continue_interface): Postpone outputting debug info. for objective-c classes. (objc_finish_interface): Output debug info. for objective-c classes. @@ -1162,7 +1507,7 @@ 2006-08-03 Fariborz Jahanian - Radar 4664707 + Radar 4664707 * objc/objc-act.c (objc_create_named_tmp_var): Takes extra argument. (objc_build_compound_setter_call): New. (objc_v2_build_setter_call): Call objc_build_compound_setter_call to @@ -1173,20 +1518,20 @@ 2006-08-01 Fariborz Jahanian - Radar 4660366 + Radar 4660366 * objc/objc-act.c (objc_build_setter_stmt): Set flag_objc_gc so objc_assign_weak is generated on 'weak' setter ivar. 2006-08-01 Fariborz Jahanian - Radar 4660569 + Radar 4660569 * objc/objc-act.c (objc_synthesize_getter): Warn if no synthesized or user getter. (objc_synthesize_setter): Warn if no synthesized or user setter. 2006-07-31 Fariborz Jahanian - Radar 4653319 + Radar 4653319 * objc/objc-act.c (objc_add_property_variable): Issue diagnostic if class has no ivar attribute and implementation does not refer to a specific 'ivar' in the interface. @@ -1200,7 +1545,7 @@ 2006-07-28 Fariborz Jahanian - Radar 4656712 + Radar 4656712 * objc/objc-act.c (objc_build_setter_stmt): Recover when synthesized argument not found. (finish_class): Issue error when user declared accessor and compiler @@ -1208,13 +1553,13 @@ 2006-07-26 Fariborz Jahanian - Radar 4649718, 4651088 + Radar 4649718, 4651088 * objc/objc-act.c (objc_add_property_variable): err on bad property declarations. 2006-07-26 Fariborz Jahanian - Radar 4653242 + Radar 4653242 * objc/objc-act.c (objc_gen_one_property_data): Check for missing setter/getter in @implementation is removed. @@ -1232,7 +1577,7 @@ (objc_synthesize_getter): Remove method_decl argument in call to objc_build_getter_retval. (objc_build_setter_stmt): Remove meth_decl argument. - Use argument passed after 'self', called '_cmd' to build setter call. + Use argument passed after 'self', called '_cmd' to build setter call. (objc_synthesize_setter): Remove method_decl argument in call to objc_build_setter_stmt. @@ -1251,7 +1596,7 @@ 006-07-18 Fariborz Jahanian - Radar 4592503 + Radar 4592503 * objc/objc-act.c (objc_checkon_weak_attribute): New routine to check for __weak attribute use on declarations. @@ -1268,21 +1613,21 @@ 2006-07-14 Fariborz Jahanian - Radar 4621020 - * objc-act.c (objc_set_property_attr): Gather 'weak' attribute setting. - (objc_add_property_variable): 'weak' attribute setting into property node. - Diagnose a variety of mis-use. - (objc_v2_encode_prop_attr): Encode 'weak attribute as 'W'. + Radar 4621020 + * objc-act.c (objc_set_property_attr): Gather 'weak' attribute setting. + (objc_add_property_variable): 'weak' attribute setting into property node. + Diagnose a variety of mis-use. + (objc_v2_encode_prop_attr): Encode 'weak attribute as 'W'. ( objc_synthesize_getter): Call to objc_generate_weak_read for possible call to objc_read_weak of a __weak return ivar. - (objc_add_internal_ivar): For 'weak' property, declare inserted 'ivar' as + (objc_add_internal_ivar): For 'weak' property, declare inserted 'ivar' as __weak. (finish_class): Diagnose if 'weak', 'bycopy' and 'byref' are not mutually exclusive. On an existin 'ivar', make sure that it is declared weak. 2006-07-13 Fariborz Jahanian - Radar 4625843 + Radar 4625843 * objc-act.c (objc_add_property_variable): Issue diagnostic if category's 'ivar' attribute does not include an ivar name. (synth_module_prologue): Generate protocol qualified type for @@ -1298,13 +1643,13 @@ 2006-07-11 Fariborz Jahanian - Radar 4623423 + Radar 4623423 * objc-act.c (objc_type_valid_for_messaging): 'Class' is a valid selector type as well. 2006-07-10 Fariborz Jahanian - Radar 4398221 + Radar 4398221 * objc-act.c (lookup_and_install_protocols): Takes a new argument and warns on use of incomplete protocol in a class definition. @@ -1314,7 +1659,7 @@ 2006-06-29 Fariborz Jahanian - Radar 4585769 + Radar 4585769 * objc-act.h: Variety of new global declarations. * objc-act.c (OBJC_VERSION): Bump version to 7. (ivar_bytepos_cmp): New call back routine for qsort. @@ -1371,7 +1716,7 @@ 2006-06-26 Fariborz Jahanian - Radar 4591909 + Radar 4591909 * objc-act.h: New declarations to supprot the new property spec. * objc-act.c: (objc_set_property_attr): Changed to support @@ -1397,31 +1742,31 @@ 006-06-24 Fariborz Jahanian - Radar 4591756 - * objc-act.c (objc_build_weak_read): Pass address of 'id' expr - to objc_read_weak. - (objc_remove_weak_read): dereference 'exp'. - (objc_strip_off_indirection): New. - (objc_generate_write_barrier): Strip off tree - added in objc_remove_weak_read. - (build_next_objc_exception_stuff): Type of objc_read_weak is now - objc_read_weak(*id). + Radar 4591756 + * objc-act.c (objc_build_weak_read): Pass address of 'id' expr + to objc_read_weak. + (objc_remove_weak_read): dereference 'exp'. + (objc_strip_off_indirection): New. + (objc_generate_write_barrier): Strip off tree + added in objc_remove_weak_read. + (build_next_objc_exception_stuff): Type of objc_read_weak is now + objc_read_weak(*id). 2006-06-12 Fariborz Jahanian - Radar 4582997 + Radar 4582997 * objc-act.c (is_property): Lookup property in the interface, not in its implementation. 2006-06-12 Fariborz Jahanian - Radar 4582204 + Radar 4582204 * objc-act.c (build_message_ref_translation_table): Initializer tree-list is fixed. 2006-06-12 Fariborz Jahanian - Radar 4581680 + Radar 4581680 * objc-act.c (objc_start_method_definition): Generate nonlazy section for 'hybrid' abi as well. @@ -1434,7 +1779,7 @@ (add_objc_string): Ditto. (build_next_runtime_selector_reference): New. replaces build_selector_reference to do hash lookup instead of - linear search. + linear search. (objc_finish_message_expr): Call the new build_next_runtime_selector_reference. (hash_init): Initialize new hash tables. @@ -1465,7 +1810,7 @@ 2006-06-02 Fariborz Jahanian - Radar 4568791 + Radar 4568791 * objc-act.c (objc_method_inherited): New. (check_methods): Warn only if method is not declared in the inheritance hierarchy. @@ -1480,7 +1825,7 @@ 2006-05-31 Fariborz Jahanian - Radar 4564386 + Radar 4564386 * objc-act.c (objc_merge_proto_properties_in_class): New. (finish_class): Merge properties from protocol(s) of the class into the class. @@ -1498,7 +1843,7 @@ 2006-05-25 Fariborz Jahanian - Radar 4561192 + Radar 4561192 * objc-act.c (objc_set_alignment_attribute): (build_class_list_address_table, build_category_list_address_table, build_protocol_list_address_table): Set the alignment attribute to @@ -1510,7 +1855,7 @@ 2006-05-23 Fariborz Jahanian - Radar 4559114 + Radar 4559114 * objc-act.h (PROTOCOL_IMPL_OBJ): New macro for PROTOCOL_INTERFACE_TYPE nodes. * objc-act.c (generate_v2_property_tables): Takes a new argument to @@ -1522,19 +1867,19 @@ 2006-05-23 Fariborz Jahanian - Radar 4558088 - revised + Radar 4558088 - revised * objc-act.c (objc_add_property_variable): Diagnose mismatched property declarations by calling comptypes. 2006-05-23 Fariborz Jahanian - Radar 4558088 + Radar 4558088 * objc-act.c (objc_add_property_variable): Diagnose mismatched property declarations. 2006-05-22 Fariborz Jahanian - Radar 4557598 + Radar 4557598 * objc-act.c (objc_add_property_variable): Fix typo. (synth_module_prologue): Declare objc_msgSend_fpret_fixup_rtp function. @@ -1543,13 +1888,13 @@ 2006-05-19 Fariborz Jahanian - Radar 4550413 (optional protocol) + Radar 4550413 (optional protocol) * objc-act.c (lookup_method_in_protocol_list): Also search for methods in list of optional protocols. 2006-05-18 Fariborz Jahanian - Radar 4548636 (objc attributes on class) + Radar 4548636 (objc attributes on class) * objc-act.h (CLASS_ATTRIBUTES): New macro to access interface's attribute list. * objc-act.c (objc_warn_on_class_attributes): New. @@ -1571,7 +1916,7 @@ 2006-05-15 Fariborz Jahanian - radar 4529765 + radar 4529765 * objc-act.c (objc_delta_format_args): New. * (objc_any_recognized_attribute): New. * (objc_start_method_definition): Warn on attribute decl. @@ -1597,7 +1942,7 @@ 2006-05-08 Fariborz Jahanian - radar 4540451 + radar 4540451 * objc/objc-act.c (create_ivar_offset_name): Change ivar offset symbol name. @@ -1617,7 +1962,7 @@ 2006-05-05 Fariborz Jahanian - radar 4533974 - ObjC new protocol + radar 4533974 - ObjC new protocol * objc/objc-tree.def (PROTOCOL_IMPLEMENTATION_TYPE): New tree node. * objc/objc-act.h: Bunch of new global decls and enums. * objc/objc-act.c (objc_add_to_protocol_list_chain, @@ -1666,13 +2011,13 @@ 2006-04-26 Fariborz Jahanian - Radar 4523837 + Radar 4523837 * objc/objc-act.c (objc_build_getter_call): Restore 'receiver' to its original tree in call tree. 2006-04-26 Fariborz Jahanian - Radar 3803157 (method attributes) + Radar 3803157 (method attributes) * objc/objc-act.h (METHOD_TYPE_ATTRIBUTES): New macro. * objc/objc-act.c (objc_decl_method_attributes): New. (objc_add_method_declaration): Process method's attribute. @@ -1695,7 +2040,7 @@ 2006-04-12 Fariborz Jahanian - Radar 4506893 + Radar 4506893 * objc/objc-act.c (objc_setter_func_call): Set in_objc_property_setter_name_context. (objc_finish_message_expr): Issue proper error @@ -1710,13 +2055,13 @@ 2006-04-10 Fariborz Jahanian - Radar 4506903 + Radar 4506903 * objc/objc-act.c (objc_build_getter_call): Lookup property in id.property as well. 2006-04-12 Fariborz Jahanian - Radar 4507230 + Radar 4507230 * objc-act.c (objc_finish_message_expr): Don't warn on calling the internal objc runtime routine. (objc_type_valid_for_messaging): New routine to check for valid @@ -1726,7 +2071,7 @@ 2006-04-07 Fariborz Jahanian - Radar 4505126 + Radar 4505126 * objc-act.c (lookup_property, lookup_property_in_list, lookup_property_in_protocol_list): New. (objc_build_getter_call): Call lookup_property to find a property. @@ -1734,8 +2079,8 @@ 2006-04-06 Fariborz Jahanian - Radar 4436866 - (Missing copies attribute) + Radar 4436866 + (Missing copies attribute) * objc-act.h (PROPERTY_COPIES): New field in property node. * objc-act.c (objc_set_property_attr): Set property_copies flag. @@ -1747,8 +2092,8 @@ 2006-04-04 Fariborz Jahanian - Radar 4498373 - (Metadata for objective-c properties) + Radar 4498373 + (Metadata for objective-c properties) * objc-act.h (objc_v2_property_template, UOBJC_V2_PROPERTY_decl, prop_names_attr_chain, objc_prop_list_ptr): New global declarations. @@ -1763,7 +2108,7 @@ error. (synth_module_prologue): Define a new type for _prop_list_t*. (build_objc_string_decl): Add property name/attributes to their own - list. + list. (add_objc_string): Add support for property name/attribute names. (get_objc_string_decl): Add list of property name/attributes among those to search for. @@ -1807,7 +2152,7 @@ 2006-03-22 Fariborz Jahanian - Radar 4436866 + Radar 4436866 * objc-act.c (objc_gen_one_property_data): New. (objc_gen_property_datae): New. (objc_synthesize_getter): New. @@ -1842,13 +2187,13 @@ 2005-03-09 Fariborz Jahanian - Radar 4457381 + Radar 4457381 * objc/objc-act.c (objc_finish_message_expr): Look for message in @class's protocol list. 2005-03-08 Fariborz Jahanian - Radar 4468456 + Radar 4468456 * objc/objc-act.c (objc_finish_foreach_loop): 'continue' label belongs to current (inner) while-do loop. @@ -1860,21 +2205,21 @@ 2005-02-28 Fariborz Jahanian - Radar 4441049 + Radar 4441049 * objc/objc-act.c (objc_v2_bitfield_ivar_bitpos): New routine to compute ivar bitfield bit position from start of its starting byte. (ivar_offset_ref): ivar bitfield byte position recomputed. 2006-02-15 Fariborz Jahanian - Radar 4439126 - * objc/objc-act.c (objc_finish_file): call cp_finish_file before + Radar 4439126 + * objc/objc-act.c (objc_finish_file): call cp_finish_file before genertating any meta-data so all instantiation have taken place (some metadata (such as selectors) may go missing otherwise). 2006-02-15 Fariborz Jahanian - Radar 4441551 + Radar 4441551 * objc/objc-act.c (diagnose_selector_cast): New function definition. 2006-02-14 Fariborz Jahanian @@ -1923,7 +2268,7 @@ 2006-02-02 Fariborz Jahanian - Radar 4426814 + Radar 4426814 * objc/objc-act.h (objc_assign_weak_decl, objc_read_weak_decl): New globals for two weak function calls; objc_read_weak and objc_assign_weak. * objc/objc-act.c (objc_build_weak_read, objc_build_weak_read, @@ -1938,7 +2283,7 @@ 2006-01-30 Fariborz Jahanian - Radar 4386773 + Radar 4386773 * objc/objc-act.c (objc_set_method_opt): New function. (objc_start_protocol, objc_finish_interface): Reset objc_method_optional_flag flag. @@ -1970,7 +2315,7 @@ 2006-01-23 Fariborz Jahanian - Radar 4360146 + Radar 4360146 * objc/objc-act.h: (metaclasslist_ref_chain): New global declaration. * objc/objc-act.c (build_v2_method_list_template): New routine to declare "struct method_list_t". @@ -2043,13 +2388,13 @@ 2005-12-22 Fariborz Jahanian - Radar 4360146 - * objc/objc-act.c (generate_v2_ivar_lists): Remove generation of class + Radar 4360146 + * objc/objc-act.c (generate_v2_ivar_lists): Remove generation of class variabe offset for the root of inheritance in new abi. 2005-12-21 Fariborz Jahanian - Radar 4360146 + Radar 4360146 * objc/objc-act.c (create_hidden_decl): New. (ivar_offset_ref): Visibility of private ivar offset variables must be "hidden". @@ -2057,7 +2402,7 @@ 2005-12-21 Fariborz Jahanian Radar 4360146 - * objc/objc-act.c (objc_is_ivar): Perform correct name lookup for + * objc/objc-act.c (objc_is_ivar): Perform correct name lookup for ivar names when generating ivar offset variables. (finish_objc): Don't generate objc_module meta-data in new abi. (generate_objc_symtab_decl): Don't generate objc_symtab meta-data @@ -2070,7 +2415,7 @@ 2005-12-16 Fariborz Jahanian - Radar 4360146 + Radar 4360146 * objc/objc-act.c (ivar_offset_ref): Uniquify ivar offset variable names not based on offect value but based on their name. (generate_v2_ivar_lists): Use OBJC_TYPE_NAME macro so c++ works as well. @@ -2081,8 +2426,6 @@ (generate_v2_protocols): Type of protocol_t.protocol_list initizlier is protocol_list_t *. - - 2005-12-15 Fariborz Jahanian Radar 4229905 @@ -2090,7 +2433,7 @@ 2005-12-09 Fariborz Jahanian - Radar 4360146 + Radar 4360146 * objc/objc-act.h (PROTOCOL_LANG_SLOT_ELTS): Bump it by one. (PROTOCOL_V2_FORWARD_DECL): Correct its definition. @@ -2148,22 +2491,22 @@ 2005-12-06 Fariborz Jahanian - Radar 4360146 + Radar 4360146 - * objc/objc-act.c (objc_is_ivar, create_ivar_offset_name): - New utility routines. - (objc_v2_build_ivar_ref): Main routine to generate the new ivar - reference code. - (create_extern_decl): Modified to generate unique 'extern' variable - declarations at file scope. - (synth_module_prologue):Type of UOBJC_V2_VTABLE_decl is corrected. - (ivar_offset_ref): Use create_ivar_offset_name to create name for ivar - offset variable. Create global offset variables for public/protected - ivars. - (generate_v2_shared_structures): Miscellanous type correction and - cleanups. - (build_ivar_reference): For ivar references call objc_v2_build_ivar_ref - to generate ivar references using ivar offset variable. + * objc/objc-act.c (objc_is_ivar, create_ivar_offset_name): + New utility routines. + (objc_v2_build_ivar_ref): Main routine to generate the new ivar + reference code. + (create_extern_decl): Modified to generate unique 'extern' variable + declarations at file scope. + (synth_module_prologue):Type of UOBJC_V2_VTABLE_decl is corrected. + (ivar_offset_ref): Use create_ivar_offset_name to create name for ivar + offset variable. Create global offset variables for public/protected + ivars. + (generate_v2_shared_structures): Miscellanous type correction and + cleanups. + (build_ivar_reference): For ivar references call objc_v2_build_ivar_ref + to generate ivar references using ivar offset variable. 2006-05-24 Mike Stump @@ -2177,18 +2520,18 @@ 2006-04-27 Fariborz Jahanian - Radar 4399973 + Radar 4399973 Radar 4327263 * objc/objc-act.c (init_module_descriptor): Remove file name from module descriptors. 2006-03-10 Fariborz Jahanian - Radar 4407151 - * objc/objc-act.c (objc_is_class_name): template parameter is not - an objective class name. - (objc_generate_cxx_cdtors): Check for the null - objc_implementation_context. + Radar 4407151 + * objc/objc-act.c (objc_is_class_name): template parameter is not + an objective class name. + (objc_generate_cxx_cdtors): Check for the null + objc_implementation_context. 2006-02-07 Fariborz Jahanian @@ -2232,7 +2575,7 @@ (build_v2_descriptor_table_initializer): New (generate_v2_method_descriptors): New (synth_module_prologue): Declare type 'struct ivar_list_t*' - (build_message_reference_decl): Use a new indexing for building + (build_message_reference_decl): Use a new indexing for building message_ref names. (generate_descriptor_table): Added the 'newabi' arg to initilize the 'entsize' field for 'method_list_t' meta data. @@ -2321,7 +2664,7 @@ (build_class_t_initializer): New (generate_newabi_shared_structures): New (synth_module_prologue): Declare IMP type objc_imp_type - and use it as needed. + and use it as needed. Declare new globals and call build_newabi_protocol_template(...) when -fobjc-newabi is specified. (build_private_template): Save type of an Interface in CLASS_TYPE field. @@ -2344,20 +2687,20 @@ 2005-10-10 Fariborz Jahanian - Radar 4301047 + Radar 4301047 * objc-act.c (encode_type): Remove the hack. 2005-10-17 Fariborz Jahanian - Radar 4290840 + Radar 4290840 * objc-act.c (objc_start_method_definition): Check for error_mark_node for the selector name and make a quick exit. 2005-10-12 Fariborz Jahanian - Radar 4291785 + Radar 4291785 * objc-act.c (objc_get_interface_ivars): New function. (objc_detect_field_duplicates): Ditto. @@ -2373,7 +2716,7 @@ 2005-10-07 Fariborz Jahanian - Radar 4204796 + Radar 4204796 * objc-act.c (objc_build_volatilized_type): Build 'volatilzed' types with proper attribute set and correctly. (objc_volatilize_decl): Remove unneeded code. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.h?rev=54170&r1=54169&r2=54170&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.h (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.h Tue Jul 29 14:45:18 2008 @@ -515,7 +515,8 @@ && TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (TYPE))) #define IS_SUPER(TYPE) \ (TREE_CODE (TYPE) == POINTER_TYPE \ - && TREE_TYPE (TYPE) == objc_super_template) + /* APPLE LOCAL radar 6023694 */ \ + && TYPE_MAIN_VARIANT (TREE_TYPE (TYPE)) == objc_super_template) /* APPLE LOCAL radar 4345837 */ /* class_chain and alias_chain are removed */ Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def?rev=54170&r1=54169&r2=54170&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-tree.def Tue Jul 29 14:45:18 2008 @@ -47,6 +47,8 @@ DEFTREECODE (OBJC_WEAK_REFERENCE_EXPR, "weak_object_reference_expr", tcc_expression, 1) /* APPLE LOCAL radar 5285911 5494488 */ DEFTREECODE (OBJC_PROPERTY_REFERENCE_EXPR, "property_reference_expr", tcc_expression, 3) +/* APPLE LOCAL radar 5887355 */ +DEFTREECODE (OBJC_STRING_REFERENCE, "objc_string_reference_expr", tcc_expression, 1) /* Local variables: Modified: llvm-gcc-4.2/trunk/gcc/objcp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objcp/ChangeLog.apple?rev=54170&r1=54169&r2=54170&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objcp/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/objcp/ChangeLog.apple Tue Jul 29 14:45:18 2008 @@ -1,3 +1,15 @@ +2008-06-03 Fariborz Jahanian + + Radar 5887355 + * objcp-lang.c (objcp_tsubst_copy_and_build): Build + cfstring tree during template instantiation. + +2008-02-20 Fariborz Jahanian + + Radar 5732232 - code gen part 2. + * objcp-lang.c (c_finish_return): Defined these + templates to get a clean compile. + 2006-10-04 Fariborz Jahanian Radar 3904178 Modified: llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c?rev=54170&r1=54169&r2=54170&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c (original) +++ llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c Tue Jul 29 14:45:18 2008 @@ -133,6 +133,12 @@ return objc_get_class_reference (RECURSE (TREE_OPERAND (t, 0))); + /* APPLE LOCAL begin radar 5887355 */ + case OBJC_STRING_REFERENCE: + return objc_build_string_object + (RECURSE (TREE_OPERAND (t, 0))); + /* APPLE LOCAL end radar 5887355 */ + default: break; } @@ -208,4 +214,10 @@ objc_finish_file (); } +/* APPLE LOCAL begin radar 5732232 - blocks */ +tree c_finish_return (tree exp) +{ + return exp; +} +/* APPLE LOCAL end radar 5732232 - blocks */ #include "gtype-objcp.h" From natebegeman at mac.com Tue Jul 29 14:07:28 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jul 2008 19:07:28 -0000 Subject: [llvm-commits] [llvm] r54168 - in /llvm/trunk/lib: CodeGen/SelectionDAG/LegalizeDAG.cpp Target/CellSPU/SPUISelLowering.cpp Message-ID: <200807291907.m6TJ7SiV004183@zion.cs.uiuc.edu> Author: sampo Date: Tue Jul 29 14:07:27 2008 New Revision: 54168 URL: http://llvm.org/viewvc/llvm-project?rev=54168&view=rev Log: Fix broken CellSPU lowering, re-instate braces in Legalize Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=54168&r1=54167&r2=54168&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 29 14:07:27 2008 @@ -2976,12 +2976,10 @@ case TargetLowering::Legal: break; case TargetLowering::Custom: Tmp1 = TLI.LowerOperation(Result, DAG); - if (Tmp1.Val) - // FIXME: these braces are correct, but breaks CellSPU codegen. - //{ + if (Tmp1.Val) { Result = Tmp1; break; - //} + } // Fall through if the custom lower can't deal with the operation case TargetLowering::Expand: { MVT VT = Op.getValueType(); Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=54168&r1=54167&r2=54168&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Jul 29 14:07:27 2008 @@ -2481,8 +2481,9 @@ DAG.getNode(ISD::BUILD_VECTOR, VT, tcVec, tcVecSize)); } } - - return SDValue(); + // These operations (AND, OR, XOR) are legal, they just couldn't be custom + // lowered. Return the operation, rather than a null SDValue. + return Op; } //! Lower i32 multiplication From bruno.cardoso at gmail.com Tue Jul 29 14:29:50 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 29 Jul 2008 19:29:50 -0000 Subject: [llvm-commits] [llvm] r54169 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200807291929.m6TJToIN004989@zion.cs.uiuc.edu> Author: bruno Date: Tue Jul 29 14:29:50 2008 New Revision: 54169 URL: http://llvm.org/viewvc/llvm-project?rev=54169&view=rev Log: Changed some methods order. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54169&r1=54168&r2=54169&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 29 14:29:50 2008 @@ -145,17 +145,17 @@ { switch (Op.getOpcode()) { + case ISD::BRCOND: return LowerBRCOND(Op, DAG); case ISD::CALL: return LowerCALL(Op, DAG); + case ISD::ConstantPool: return LowerConstantPool(Op, DAG); case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG); - case ISD::RET: return LowerRET(Op, DAG); case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); - case ISD::ConstantPool: return LowerConstantPool(Op, DAG); + case ISD::RET: return LowerRET(Op, DAG); case ISD::SELECT: return LowerSELECT(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); case ISD::SETCC: return LowerSETCC(Op, DAG); - case ISD::BRCOND: return LowerBRCOND(Op, DAG); } return SDValue(); } @@ -342,6 +342,7 @@ //===----------------------------------------------------------------------===// // Misc Lower Operation implementation //===----------------------------------------------------------------------===// + SDValue MipsTargetLowering:: LowerBRCOND(SDValue Op, SelectionDAG &DAG) { @@ -382,48 +383,6 @@ } SDValue MipsTargetLowering:: -LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) -{ - GlobalValue *GV = cast(Op)->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); - - if (!Subtarget->hasABICall()) { - if (isa(GV)) return GA; - const MVT *VTs = DAG.getNodeValueTypes(MVT::i32); - SDValue Ops[] = { GA }; - - if (IsGlobalInSmallSection(GV)) { // %gp_rel relocation - SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, VTs, 1, Ops, 1); - SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); - return DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); - } - // %hi/%lo relocation - SDValue HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1); - SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); - return DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo); - - } else { // Abicall relocations, TODO: make this cleaner. - SDValue ResNode = DAG.getLoad(MVT::i32, DAG.getEntryNode(), GA, NULL, 0); - // On functions and global targets not internal linked only - // a load from got/GP is necessary for PIC to work. - if (!GV->hasInternalLinkage() || isa(GV)) - return ResNode; - SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); - return DAG.getNode(ISD::ADD, MVT::i32, ResNode, Lo); - } - - assert(0 && "Dont know how to handle GlobalAddress"); - return SDValue(0,0); -} - -SDValue MipsTargetLowering:: -LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) -{ - assert(0 && "TLS not implemented for MIPS."); - return SDValue(); // Not reached -} - -SDValue MipsTargetLowering:: LowerSELECT(SDValue Op, SelectionDAG &DAG) { SDValue Cond = Op.getOperand(0); @@ -466,6 +425,48 @@ } SDValue MipsTargetLowering:: +LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) +{ + GlobalValue *GV = cast(Op)->getGlobal(); + SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); + + if (!Subtarget->hasABICall()) { + if (isa(GV)) return GA; + const MVT *VTs = DAG.getNodeValueTypes(MVT::i32); + SDValue Ops[] = { GA }; + + if (IsGlobalInSmallSection(GV)) { // %gp_rel relocation + SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, VTs, 1, Ops, 1); + SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); + return DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); + } + // %hi/%lo relocation + SDValue HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1); + SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); + return DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo); + + } else { // Abicall relocations, TODO: make this cleaner. + SDValue ResNode = DAG.getLoad(MVT::i32, DAG.getEntryNode(), GA, NULL, 0); + // On functions and global targets not internal linked only + // a load from got/GP is necessary for PIC to work. + if (!GV->hasInternalLinkage() || isa(GV)) + return ResNode; + SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); + return DAG.getNode(ISD::ADD, MVT::i32, ResNode, Lo); + } + + assert(0 && "Dont know how to handle GlobalAddress"); + return SDValue(0,0); +} + +SDValue MipsTargetLowering:: +LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) +{ + assert(0 && "TLS not implemented for MIPS."); + return SDValue(); // Not reached +} + +SDValue MipsTargetLowering:: LowerJumpTable(SDValue Op, SelectionDAG &DAG) { SDValue ResNode; From bruno.cardoso at gmail.com Tue Jul 29 14:05:29 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 29 Jul 2008 19:05:29 -0000 Subject: [llvm-commits] [llvm] r54167 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsISelLowering.h MipsInstrFPU.td MipsInstrInfo.td Message-ID: <200807291905.m6TJ5TSt004092@zion.cs.uiuc.edu> Author: bruno Date: Tue Jul 29 14:05:28 2008 New Revision: 54167 URL: http://llvm.org/viewvc/llvm-project?rev=54167&view=rev Log: Added floating point lowering for select. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h llvm/trunk/lib/Target/Mips/MipsInstrFPU.td llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54167&r1=54166&r2=54167&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 29 14:05:28 2008 @@ -41,15 +41,16 @@ { switch (Opcode) { - case MipsISD::JmpLink : return "MipsISD::JmpLink"; - case MipsISD::Hi : return "MipsISD::Hi"; - case MipsISD::Lo : return "MipsISD::Lo"; - case MipsISD::GPRel : return "MipsISD::GPRel"; - case MipsISD::Ret : return "MipsISD::Ret"; - case MipsISD::SelectCC : return "MipsISD::SelectCC"; - case MipsISD::FPBrcond : return "MipsISD::FPBrcond"; - case MipsISD::FPCmp : return "MipsISD::FPCmp"; - default : return NULL; + case MipsISD::JmpLink : return "MipsISD::JmpLink"; + case MipsISD::Hi : return "MipsISD::Hi"; + case MipsISD::Lo : return "MipsISD::Lo"; + case MipsISD::GPRel : return "MipsISD::GPRel"; + case MipsISD::Ret : return "MipsISD::Ret"; + case MipsISD::SelectCC : return "MipsISD::SelectCC"; + case MipsISD::FPSelectCC : return "MipsISD::FPSelectCC"; + case MipsISD::FPBrcond : return "MipsISD::FPBrcond"; + case MipsISD::FPCmp : return "MipsISD::FPCmp"; + default : return NULL; } } @@ -87,8 +88,9 @@ setOperationAction(ISD::RET, MVT::Other, Custom); setOperationAction(ISD::JumpTable, MVT::i32, Custom); setOperationAction(ISD::ConstantPool, MVT::i32, Custom); + setOperationAction(ISD::SELECT, MVT::f32, Custom); + setOperationAction(ISD::SELECT, MVT::i32, Custom); setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); - setOperationAction(ISD::SELECT_CC, MVT::f32, Custom); setOperationAction(ISD::SETCC, MVT::f32, Custom); setOperationAction(ISD::BRCOND, MVT::Other, Custom); @@ -96,7 +98,6 @@ setOperationAction(ISD::BR_JT, MVT::Other, Expand); setOperationAction(ISD::BR_CC, MVT::Other, Expand); setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); - setOperationAction(ISD::SELECT, MVT::i32, Expand); setOperationAction(ISD::UINT_TO_FP, MVT::i32, Expand); setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); @@ -151,6 +152,7 @@ case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG); + case ISD::SELECT: return LowerSELECT(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); case ISD::SETCC: return LowerSETCC(Op, DAG); case ISD::BRCOND: return LowerBRCOND(Op, DAG); @@ -158,70 +160,6 @@ return SDValue(); } -MachineBasicBlock * -MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, - MachineBasicBlock *BB) -{ - const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); - switch (MI->getOpcode()) { - default: assert(false && "Unexpected instr type to insert"); - case Mips::Select_CC: { - // To "insert" a SELECT_CC instruction, we actually have to insert the - // diamond control-flow pattern. The incoming instruction knows the - // destination vreg to set, the condition code register to branch on, the - // true/false values to select between, and a branch opcode to use. - const BasicBlock *LLVM_BB = BB->getBasicBlock(); - MachineFunction::iterator It = BB; - ++It; - - // thisMBB: - // ... - // TrueVal = ... - // setcc r1, r2, r3 - // bNE r1, r0, copy1MBB - // fallthrough --> copy0MBB - MachineBasicBlock *thisMBB = BB; - MachineFunction *F = BB->getParent(); - MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); - MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, TII->get(Mips::BNE)).addReg(MI->getOperand(1).getReg()) - .addReg(Mips::ZERO).addMBB(sinkMBB); - F->insert(It, copy0MBB); - F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - sinkMBB->addSuccessor(*i); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - - // copy0MBB: - // %FalseValue = ... - // # fallthrough to sinkMBB - BB = copy0MBB; - - // Update machine-CFG edges - BB->addSuccessor(sinkMBB); - - // sinkMBB: - // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] - // ... - BB = sinkMBB; - BuildMI(BB, TII->get(Mips::PHI), MI->getOperand(0).getReg()) - .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) - .addReg(MI->getOperand(3).getReg()).addMBB(thisMBB); - - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. - return BB; - } - } -} - //===----------------------------------------------------------------------===// // Lower helper functions //===----------------------------------------------------------------------===// @@ -280,6 +218,16 @@ return Mips::BRANCH_INVALID; } +static unsigned FPBranchCodeToOpc(Mips::FPBranchCode BC) { + switch(BC) { + default: + assert(0 && "Unknown branch code"); + case Mips::BRANCH_T : return Mips::BC1T; + case Mips::BRANCH_F : return Mips::BC1F; + case Mips::BRANCH_TL : return Mips::BC1TL; + case Mips::BRANCH_FL : return Mips::BC1FL; + } +} static Mips::CondCode FPCondCCodeToFCC(ISD::CondCode CC) { switch (CC) { @@ -307,6 +255,90 @@ } } +MachineBasicBlock * +MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *BB) +{ + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); + bool isFPCmp = false; + + switch (MI->getOpcode()) { + default: assert(false && "Unexpected instr type to insert"); + case Mips::Select_FCC: + case Mips::Select_FCC_SO32: + case Mips::Select_FCC_AS32: + case Mips::Select_FCC_D32: + isFPCmp = true; // FALL THROUGH + case Mips::Select_CC: + case Mips::Select_CC_SO32: + case Mips::Select_CC_AS32: + case Mips::Select_CC_D32: { + // To "insert" a SELECT_CC instruction, we actually have to insert the + // diamond control-flow pattern. The incoming instruction knows the + // destination vreg to set, the condition code register to branch on, the + // true/false values to select between, and a branch opcode to use. + const BasicBlock *LLVM_BB = BB->getBasicBlock(); + MachineFunction::iterator It = BB; + ++It; + + // thisMBB: + // ... + // TrueVal = ... + // setcc r1, r2, r3 + // bNE r1, r0, copy1MBB + // fallthrough --> copy0MBB + MachineBasicBlock *thisMBB = BB; + MachineFunction *F = BB->getParent(); + MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); + MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + + // Emit the right instruction according to the type of the operands compared + if (isFPCmp) { + // Find the condiction code present in the setcc operation. + Mips::CondCode CC = (Mips::CondCode)MI->getOperand(4).getImm(); + // Get the branch opcode from the branch code. + unsigned Opc = FPBranchCodeToOpc(GetFPBranchCodeFromCond(CC)); + BuildMI(BB, TII->get(Opc)).addMBB(sinkMBB); + } else + BuildMI(BB, TII->get(Mips::BNE)).addReg(MI->getOperand(1).getReg()) + .addReg(Mips::ZERO).addMBB(sinkMBB); + + F->insert(It, copy0MBB); + F->insert(It, sinkMBB); + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), + e = BB->succ_end(); i != e; ++i) + sinkMBB->addSuccessor(*i); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while(!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + + // copy0MBB: + // %FalseValue = ... + // # fallthrough to sinkMBB + BB = copy0MBB; + + // Update machine-CFG edges + BB->addSuccessor(sinkMBB); + + // sinkMBB: + // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] + // ... + BB = sinkMBB; + BuildMI(BB, TII->get(Mips::PHI), MI->getOperand(0).getReg()) + .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) + .addReg(MI->getOperand(3).getReg()).addMBB(thisMBB); + + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + return BB; + } + } +} + //===----------------------------------------------------------------------===// // Misc Lower Operation implementation //===----------------------------------------------------------------------===// @@ -392,6 +424,34 @@ } SDValue MipsTargetLowering:: +LowerSELECT(SDValue Op, SelectionDAG &DAG) +{ + SDValue Cond = Op.getOperand(0); + SDValue True = Op.getOperand(1); + SDValue False = Op.getOperand(2); + + // this can be a fp select but with a setcc comming from a + // integer compare. + if (Cond.getOpcode() == ISD::SETCC) + if (Cond.getOperand(0).getValueType().isInteger()) + return DAG.getNode(MipsISD::SelectCC, True.getValueType(), + Cond, True, False); + + // Otherwise we're dealing with floating point compare. + SDValue CondRes; + if (Cond.getOpcode() == ISD::AND) + CondRes = Cond.getOperand(0); + else if (Cond.getOpcode() == MipsISD::FPCmp) + CondRes = Cond; + else + assert(0 && "Incoming condition flag unknown"); + + SDValue CCNode = CondRes.getOperand(2); + return DAG.getNode(MipsISD::FPSelectCC, True.getValueType(), + CondRes, True, False, CCNode); +} + +SDValue MipsTargetLowering:: LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) { SDValue LHS = Op.getOperand(0); @@ -400,10 +460,7 @@ SDValue False = Op.getOperand(3); SDValue CC = Op.getOperand(4); - const MVT *VTs = DAG.getNodeValueTypes(MVT::i32); - SDValue Ops[] = { LHS, RHS, CC }; - SDValue SetCCRes = DAG.getNode(ISD::SETCC, VTs, 1, Ops, 3); - + SDValue SetCCRes = DAG.getNode(ISD::SETCC, LHS.getValueType(), LHS, RHS, CC); return DAG.getNode(MipsISD::SelectCC, True.getValueType(), SetCCRes, True, False); } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=54167&r1=54166&r2=54167&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Tue Jul 29 14:05:28 2008 @@ -43,6 +43,9 @@ // Select CC Pseudo Instruction SelectCC, + // Floating Point Select CC Pseudo Instruction + FPSelectCC, + // Floating Point Branch Conditional FPBrcond, @@ -95,6 +98,7 @@ SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG); SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG); SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); + SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG); SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG); SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG); SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG); Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=54167&r1=54166&r2=54167&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Tue Jul 29 14:05:28 2008 @@ -28,9 +28,12 @@ SDTCisVT<1, OtherVT>]>; def SDT_MipsFPCmp : SDTypeProfile<0, 3, [SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2>]>; +def SDT_MipsFPSelectCC : SDTypeProfile<1, 4, [SDTCisInt<1>, SDTCisInt<4>, + SDTCisSameAs<0, 2>, SDTCisSameAs<2, 3>]>; def MipsFPBrcond : SDNode<"MipsISD::FPBrcond", SDT_MipsFPBrcond, [SDNPHasChain]>; -def MipsFPCmp : SDNode<"MipsISD::FPCmp", SDT_MipsFPCmp>; +def MipsFPCmp : SDNode<"MipsISD::FPCmp", SDT_MipsFPCmp>; +def MipsFPSelectCC : SDNode<"MipsISD::FPSelectCC", SDT_MipsFPSelectCC>; // Operand for printing out a condition code. let PrintMethod = "printFCCOperand" in @@ -285,6 +288,40 @@ } //===----------------------------------------------------------------------===// +// Floating Point Pseudo-Instructions +//===----------------------------------------------------------------------===// + +// For some explanation, see Select_CC at MipsInstrInfo.td. We also embedd a +// condiciton code to enable easy handling by the Custom Inserter. +let usesCustomDAGSchedInserter = 1, Uses=[FCR31] in { + class PseudoFPSelCC : + MipsPseudo<(outs RC:$dst), + (ins CPURegs:$CmpRes, RC:$T, RC:$F, condcode:$cc), asmstr, + [(set RC:$dst, (MipsFPSelectCC CPURegs:$CmpRes, RC:$T, RC:$F, + imm:$cc))]>; +} + +// The values to be selected are fp but the condition test is with integers. +def Select_CC_SO32 : PseudoSelCC, + Requires<[IsSingleFloat]>; +def Select_CC_AS32 : PseudoSelCC, + Requires<[In32BitMode]>; +def Select_CC_D32 : PseudoSelCC, + Requires<[In32BitMode]>; + +// The values to be selected are int but the condition test is done with fp. +def Select_FCC : PseudoFPSelCC; + +// The values to be selected and the condition test is done with fp. +def Select_FCC_SO32 : PseudoFPSelCC, + Requires<[IsSingleFloat]>; +def Select_FCC_AS32 : PseudoFPSelCC, + Requires<[In32BitMode]>; +def Select_FCC_D32 : PseudoFPSelCC, + Requires<[In32BitMode]>; + + +//===----------------------------------------------------------------------===// // Floating Point Patterns //===----------------------------------------------------------------------===// def : Pat<(f32 (sint_to_fp CPURegs:$src)), (CVTS_W32 (MTC1 CPURegs:$src))>; Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=54167&r1=54166&r2=54167&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Tue Jul 29 14:05:28 2008 @@ -19,8 +19,8 @@ def SDT_MipsRet : SDTypeProfile<0, 1, [SDTCisInt<0>]>; def SDT_MipsJmpLink : SDTypeProfile<0, 1, [SDTCisVT<0, iPTR>]>; -def SDT_MipsSelectCC : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, - SDTCisSameAs<1, 2>, SDTCisInt<3>]>; +def SDT_MipsSelectCC : SDTypeProfile<1, 3, [SDTCisSameAs<0, 2>, + SDTCisSameAs<2, 3>, SDTCisInt<1>]>; def SDT_MipsCallSeqStart : SDCallSeqStart<[SDTCisVT<0, i32>]>; def SDT_MipsCallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i32>, SDTCisVT<1, i32>]>; @@ -383,12 +383,13 @@ // (MipsSelectCC), use LowerSELECT_CC to generate this instruction and finally // replace it for real supported nodes into EmitInstrWithCustomInserter let usesCustomDAGSchedInserter = 1 in { - def Select_CC : MipsPseudo<(outs CPURegs:$dst), - (ins CPURegs:$CmpRes, CPURegs:$T, CPURegs:$F), "# MipsSelect_CC", - [(set CPURegs:$dst, (MipsSelectCC CPURegs:$CmpRes, - CPURegs:$T, CPURegs:$F))]>; + class PseudoSelCC: + MipsPseudo<(outs RC:$dst), (ins CPURegs:$CmpRes, RC:$T, RC:$F), asmstr, + [(set RC:$dst, (MipsSelectCC CPURegs:$CmpRes, RC:$T, RC:$F))]>; } +def Select_CC : PseudoSelCC; + //===----------------------------------------------------------------------===// // Instruction definition //===----------------------------------------------------------------------===// From isanbard at gmail.com Tue Jul 29 15:14:53 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jul 2008 20:14:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54171 - in /llvm-gcc-4.2/trunk: ChangeLog.apple gcc/ChangeLog.apple gcc/cp/ChangeLog.apple gcc/testsuite/ChangeLog.apple libgomp/ChangeLog.apple libiberty/ChangeLog.apple Message-ID: <200807292014.m6TKErDK006719@zion.cs.uiuc.edu> Author: void Date: Tue Jul 29 15:14:52 2008 New Revision: 54171 URL: http://llvm.org/viewvc/llvm-project?rev=54171&view=rev Log: Commit Apple ChangeLogs from Apple GCC 4.2's TOT. Added: llvm-gcc-4.2/trunk/libgomp/ChangeLog.apple llvm-gcc-4.2/trunk/libiberty/ChangeLog.apple Modified: llvm-gcc-4.2/trunk/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Modified: llvm-gcc-4.2/trunk/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/ChangeLog.apple?rev=54171&r1=54170&r2=54171&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -1,3 +1,70 @@ +2008-06-04 Josh Conner + + Radar 5961147 + * build_gcc: Use 4.2.1 libstdcxx headers for ARM. + +2008-05-09 Josh Conner + + Radar 5925341 + * build_libgcc (TRANSLATE_ARCH): Add s/armv6/arm/. + +2008-04-15 Josh Conner + + Radar 5866354 + * build_gcc: Translate armv6->arm in HOSTS and TARGETS. Also, + don't try to build libgomp for ARM. + +2008-02-07 Josh Conner + + Radar 5730761 + * driverdriver.c (do_compile_separately): New variable + ifn_found, provide a fatal error if set twice for a single + invocation. + +2008-01-17 Josh Conner + + * driverdriver.c (do_compile): Move malloc of + arch_specific_argv to after call to add_arch_options. + +2008-01-09 Josh Conner + + Radar 5256615 + * driverdriver.c (arch_conditional): New global... + (initialize): ...initialize it. + (filter_args_for_arch): New function... + (do_compile): ...use it. + (do_compile_separately): Maintain arch_conditional. + (main): Set arch_conditional. Configure and use + arch_specific_argc and arch_specific_argv. Pass args through + filter_args_for_arch. + +2007-11-07 Josh Conner + + Radar 5585401 + * GNUmakefile: Add install_libgcc target. + * build_libgcc: New file. + +2007-10-26 Josh Conner + + Radar 5562046 + * configure: Don't configure libgomp, libobjc, libstdc++-v3, or + libssp for arm-*-darwin*. + * configure.in: Likewise. + * driverdriver.c (arch_config_map): Add arm variants. + (add_arch_options): Likewise. + * build_gcc: For ARM, configure with sysroot. + +2007-08-30 Josh Conner + Radar 5448306 + * build_gcc: Add and use CROSS_TARGETS. + Use intermediate compiler instead of destination compiler when + building driver-driver. + +2007-07-31 Mike Stump + + Radar 5370764 + * REMOVED: Document removed files. + 2007-06-20 Eric Christopher Radar 5279253 Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=54171&r1=54170&r2=54171&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -1,3 +1,2396 @@ +2008-07-25 Fariborz Jahanian + + Radar 6014138 + * config/darwin-c.c (darwin_cpp_builtins): Define __block + same as __byref. + * c-parser.c: All __byref are renamed to __block. + * c-decl.c: Ditto + * c-typeck.c: Rename __byref to __block. + A __block variable is added to the 'byref' list now. + +2008-07-23 Fariborz Jahanian + + Radar 6096219 + * c-common.c (handle_blocks_attribute): __blocks' argument is now + 'byref'. + * config/darwin-c.c (darwin_cpp_builtins): Expand __byref into + __attribute__((__blocks__(byref))). + +2008-07-21 Stuart Hastings + + Radar 6050374 + * local-alloc.c (reg_inheritance_1): Check for int->fp SUBREG + cast, assume it uses the pic-base. + +2008-07-18 Fariborz Jahanian + + Radar 6068877 + * c-common.h (objc_create_init_utf16_var): Removed decl. + * stub-objc.c (objc_create_init_utf16_var): Removed definition. + * config/darwin-protos.h: Renamed objc_create_init_utf16_var, + objc_cvt_utf8_utf16 to create_init_utf16_var and cvt_utf8_utf16; + respectively. + * config/darwin.c (darwin_build_constant_cfstring): Call + create_init_utf16_var, instead of objc_create_init_utf16_var. + * config/darwin-c.c (create_init_utf16_var): New routine. + (cvt_utf8_utf16): Used to be called objc_cvt_utf8_utf16. + +2008-07-18 Fariborz Jahanian + + Radar 6084601 + * c-opts.c (c_common_post_options): Allow blocks in C99 for objc + programs. + +2008-07-18 Fariborz Jahanian + + Radar 6083129 - twiked + * c-decl.c (release_all_local_byrefs_at_return): Do not release + imported __byref variables in the block. + * c-parser.c (gen_block_byref_release_exp): Do not release __byref + variables outside of the block when returning from the block. + +2008-07-17 Fariborz Jahanian + + Radar 6083129 + * c-decl.c (push_scope): set byref_in_current_scope in the new scope. + (in_bc_stmt_block, outof_bc_stmt_block, + release_all_local_byrefs_at_return, diagnose_byref_var_in_current_scope, + release_local_byrefs_at_break): New. + (pop_scope): Call gen_block_byref_release_exp when a __byref variable + is exited. + * c-typeck.c (c_finish_goto_label): Diagnose __byref variables in presense of + gotos. + (c_finish_block_return_stmt): Much clean up and simplified. + (c_finish_return): Call the new and improved c_finish_block_return_stmt. + (c_finish_return): Release out-of-scope __byref locals when return/break + is seen. + * c-common.h: Several new declarations. + * c-parser.c (c_parser_switch_statement): call to in_bc_stmt_block + and outof_bc_stmt_block. + (c_parser_while_statement): Ditto. + (c_parser_do_statement): Ditto. + (c_parser_for_statement): Ditto. + (build_block_byref_release_decl, gen_block_byref_release_exp): New. + (synth_destroy_helper_block_func): Simplified to call + build_block_byref_release_decl. + +2008-07-15 Fariborz Jahanian + + Radar 6035389 + * convert.c (convert_to_integer): Can convert block pointer to integer. + +2008-07-15 Fariborz Jahanian + + Radar 5988451 + * c-decl.c (build_block_ref_decl): Insert copied in variable + in each enclosing block which does not use it. + (begin_block): Remove setting of "the_scope" field of the block. + (in_imm_block): Fix effect of changing the "the_scope" field. + (lookup_name_in_block): Do not skip over copied-in variables when + looking up a variable in the block. + * c-parser.c (c_parser_block_literal_expr): Set block's "the_scope" field + to the helper function's outer-most body scope. + +2008-07-09 Fariborz Jahanian + + Radar 6034839 + * c-parser.c (c_parser_block_literal_expr): Warning to error. + +2008-07-08 Fariborz Jahanian + + Radar 5988451 + * c-parser.c (build_block_struct_type): If inner block has copy/destroy + helpers, so does its outer block. + (c_parser_block_literal_expr): Fix unique_count so we get unique helpers + when having nested blocks. + +2008-07-08 Fariborz Jahanian + + Radar 6048570 + * c-typeck.c (c_finish_return): Error on returning a block on the stack. + +2008-07-07 Fariborz Jahanian + + Radar 6048397 (twik). + (causes build failure with enable-checking on). + * dwarf2out.c (gen_variable_die) check for node + kind. + +2008-07-03 Caroline Tice + + Radar 6048397 + * dwarf2out.c (find_closure_byref_var_real_type): New function. + (build_byref_var_location_expression): New function. + (add_closure_byref_var_location_attribute): New function. + (gen_variable_die): Check the type of the variable to see if it is a + pass-by-reference closure variable; if so, try to call + find_closure_byref_var_real_type) to get its type, and call + add_closure_byref_var_location_attribute to get its location; if those + calls fail, fall back on the old functionality. + +2008-06-19 Eugene Marinelli + + Radar 5923888 + * config/i386/i386.h (TARGET_IASM_OP_CONSTRAINT): Add addpd instruction. + +2008-06-16 Fariborz Jahanian + + Radar 5939894 (twik) + * c-typeck.c : Routine build_closure_internal_types moved + from here to: + * c-decl.c : Also, check for previous declaration of + "struct invoke_impl" before defining one. + * c-parser.c : Removed a comment, so makediff may be happy again. + (unrelated to this radar). + +2008-06-06 Fariborz Jahanian + + Radar 5988451 + * c-decl.c (lookup_name_in_closure): check for flags + only if having a var_decl in scope. + +2008-06-06 Fariborz Jahanian + + Radar 5992047 + * c-parser.c (synth_destroy_helper_closure): Lookup _Block_destroy + before declaring one. + +2008-06-05 Fariborz Jahanian + + Radar 5988995 + * c-typeck.c (types_are_closure_compatible): Nested block pointer + types must be considered when matching block types. + +2008-06-05 Fariborz Jahanian + + Radar 5982990 + * c-parser.c (c_parser_objc_synch_compound_statement): New + (c_parser_objc_synchronized_statement): Call + c_parser_objc_synch_compound_statement. + +2008-06-04 Fariborz Jahanian + + Radar 5985368 + * c-parser.c (c_parser_declaration_or_fndef): Better diagnostics for + a bad block definition. + +2008-05-30 Jim Grosbach + + Radar 5946347 + * gcc/doc/extend.texi: Add documentation for ARM Type Attributes + ms_struct and gcc_struct. Remove errant reference to ms_struct and + gcc_struct as variable attributes for x86 and PPC. + * gcc/doc/invoke.texi: Add documentation for -mms-bitfields for + x86, PPC, and ARM target options. + * gcc/doc/tm.texi: Add documenation for TARGET_FIELD_MS_STRUCT_ALIGN + and BIGGEST_MS_STRUCT_ALIGNMENT. + * gcc/testsuite/gcc.dg/bf-ms-layout.c: Run for ARM. Add correct + testcase values for ARM. + * gcc/testsuite/gcc.dg/bf-no-ms-layout.c: Ditto. + * gcc/testsuite/gcc.dg/attr-ms_struct-2.c: Run for ARM. + * gcc/testsuite/gcc.dg/attr-ms_struct-1.c: Run for ARM. + * gcc/testsuite/gcc.dg/bf-ms-layout-2.c: Run for ARM. + * gcc/defaults.h (TARGET_FIELD_MS_STRUCT_ALIGN): New macro. + If not explicitly set by the target, TARGET_FIELD_MS_STRUCT_ALIGN + is defined to TYPE_ALIGN of the type of the field. + (BIGGEST_MS_STRUCT_ALIGNMENT): Ditto. If not explicitly set by + the target, BIGGEST_MS_STRUCT_ALIGNMENT is defined to + BIGGEST_ALIGNMENT. + * gcc/stor-layout.c (start_record_layout): Allow a target to + override the default offset_alignment for ms_struct attributed + records by defining BIGGEST_MS_STRUCT_ALIGNMENT. + (update_alignment_for_field): Use TARGET_FIELD_MS_STRUCT_ALIGN + for determining the alignment for a field in an ms_struct attributed + record. + (place_field): Ditto. + * gcc/config/arm/arm.c (arm_handle_ms_struct_attribute): New function. + (arm_handle_gcc_struct_attribute): Ditto. + (arm_ms_bitfield_layout_p): Ditto. + (arm_field_ms_struct_align): Ditto. + (TARGET_MS_BITFIELD_LAYOUT_P): New macro. + (arm_attribute_table): New entries for ms_struct and gcc_struct + attributes. + (arm_set_default_type_attributes): If -mms-bitfields was specified, + or if #pragma ms_struct is on, apply an ms_struct attribute to + an structure type definition. + * gcc/config/arm/arm.h (TARGET_FIELD_MS_STRUCT_ALIGN): New macro. + (BIGGEST_MS_STRUCT_ALIGNMENT): Ditto. + * gcc/config/arm/arm-protos.h (arm_field_ms_struct_align): Prototype. + * gcc/config/arm/arm.opt (-m[no-]ms-btifields): New target options. + +2008-05-30 Josh Conner + + Radar 5974622 + * flow.c (flow_lite): Deallocate pic_rtx_inheritance. + * local-alloc.c (reg_inheritance): Only calculate if !optimize. + +2008-05-30 Josh Conner + + Radar 5933878 + Backport from 4.3: + 2007-07-09 Geoffrey Keating + PR 32617 + * c-common.c (c_alignof_expr): Look at DECL_ALIGN of + FUNCTION_DECLs. + (handle_aligned_attribute): Allow use on FUNCTION_DECLs. + * varasm.c (assemble_start_function): Honor DECL_ALIGN + for FUNCTION_DECLs. Don't use align_functions_log if + DECL_USER_ALIGN. + * print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN + even for FUNCTION_DECLs. + * c-decl.c (merge_decls): Propagate DECL_ALIGN even for + FUNCTION_DECLs. + * tree.h (DECL_ALIGN): Update for new location of 'align'. + (DECL_FUNCTION_CODE): Update for new location and name of + 'function_code'. + (DECL_OFFSET_ALIGN): Update for new location of 'off_align'. + (struct tree_decl_common): Move 'align' and 'off_align' out + of union, ensure they're still on a 32-bit boundary. Remove + other fields in union 'u1'. + (struct tree_function_decl): Add field 'function_code' replacing + 'u1.f' in tree_decl_common. + * tree.c (build_decl_stat): Set initial value of DECL_ALIGN. + * doc/extend.texi (Function Attributes): Add 'aligned' attribute. + (Variable Attributes): Cross-reference 'aligned' attribute + to Function Attributes. + * flags.h (force_align_functions_log): Delete. + * toplev.c (force_align_functions_log): Delete. + +2008-05-28 Josh Conner + + Radar 5939894 + * dwarf2out.c (gen_variable_die): Move special handling of + CLOSURE_POINTER_TYPE from here... + (gen_variable_die): ...to here. + * c-typeck.c (build_closure_call): Add assert of + invoke_impl_ptr_type. Move call of + build_closure_internal_types from here... + * c-decl.c (make_closure_pointer_declarator): ...to here. + * c-parser.c (build_closure_struct_initlist): Add assert + of invoke_impl_ptr_type. + +2008-05-27 Fariborz Jahanian + + Radar 5965787 - (some blocks clean up). + * c-decl.c (build_indirect_object_id_exp): Check correct + macro for size of a pointer. + (new_block_byref_decl): Better way of allocation a buffer. + (init_byref_decl): Some flags are renamed to match the runtime name. + End function type's typelist with a void. + * c-common.h: For blocks, use same flags as in its runtime. + * c-parser.c (build_closure_struct_type): More cleanup. + (build_closure_struct_initlist): More cleanup. + (synth_copy_helper_closure_fuction): All function type's type + list must end with a void type. + (synth_destroy_helper_closure): Ditto. + (c_parser_closure_literal_exp): Ditto. + +2008-05-27 Stuart Hastings + + Radar 5951842 + * config/i386/sse.md (sse2_lshrti3): Moved from here... + * config/i386/i386.md (sse2_lshrti3): ...to here. + * testsuite/gcc.apple/5951842.c: New. + +2008-05-23 Fariborz Jahanian + + Radar 5925639 + * c-parser.c: (c_parser_for_statement): Check for a non-null + collection expression before deciding that it is a fraeach + statement. + +2008-05-23 Fariborz Jahanian + + Radar 5957801 + * c-typeck.c (build_conditional_expr): Allow convesion + of a pointer type null to a block pointer in a + conditional expression. + +2008-05-23 Fariborz Jahanian + + Radar 5928316 + * c-typeck.c (build_binary_op): Added check for + block pointer. + +2008-05-23 Fariborz Jahanian + + Radar 5925781 + * c-common.c (handle_nonnull_attribute): Support block pointer + just like a pointer for nonnull attribute. + (check_nonnull_arg): Ditto. + +2008-05-20 Jon Ziegler + + Radar 5095227 + Back out Geoff's patch for -fstack-protector. + Leave in the test case. + +2008-05-20 Fariborz Jahanian + + Radar 5932809 - minor change for runtime delight. + * c-parser.c (build_closure_struct_type): Add strcutor fields + for __byref 'id' object blocks as well. + (build_closure_struct_initlist): And their initializers. + +2008-05-16 Geoff Keating + + Radar 5095227 + * common.opt (-fstack-protector): Default to -1. + * config/darwin.c (darwin_override_options): If on 10.5 and + -fstack-protector is unspecified, switch it on. + * toplev.c (process_options): If -fstack-protector is still + unspecified, switch it off. + +2008-05-16 Fariborz Jahanian + + Radar 5932809 + * tree.h: VAR_DECL node now use two new flags. + (COPYABLE_BYREF_LOCAL_VAR, COPYABLE_BYREF_LOCAL_NONPOD): + New macros to access these flags. + * c-decl.c (build_indirect_object_id_exp, + synth_block_byref_id_object_copy_func, + synth_block_byref_id_object_dispose_func, + new_block_byref_decl, init_byref_decl): New. + (finish_decl): Build a new type for a __byref local + variable and initialize it to a list of initializers. + (build_byref_local_var_access): New routine. + (build_closure_byref_decl): Merge the BYREF flags + into the newly declared variable. + (build_closure_ref_decl): decl' was previously declared byref. + Copy the value embedded in the above variable. + * c-typeck.c (build_external_ref): build_closure_ref_decl call + takes one less argument. + (do_digest_init): New. + * c-common.c (handle_blocks_attribute): New routine to + implement __byref attribute on variables. + * c-common.h: Bunch of new declarations to implement + __byref variables. + * stub-objc.c (cast_to_pointer_to_id): New stub. + * c-parser.c (c_parser_postfix_expression): Code to transform + a reference to a __byref variable X into + __Block_byref_X.forwarding->X. + (build_closure_struct_type): Go through list of __byref + variables for the blocks and set hasByrefNonPOD and hasByrefPOD + flags for NonPOD and POD of such variables. __byref POD variables + also require addition of the two strcutor pointer fields in the + block structure type. + (build_closure_struct_initlist): Initialzer list must also match the + new requiement for __byref PODs. + (synth_copy_helper_closure_func): For each __byref declared variable + used in |...| Must generate call to _Block_byref_assign_copy. + (synth_destroy_helper_closure): For each __byref declared variable + used in |...| Must generate call to _Block_byref_release. + (c_parser_closure_literal_exp): Must synthesize helper functions for + __byref local variables declared as byref in the block. + + * config/darwin-c.c (darwin_cpp_builtins): Define + __byref attribute if -fblocks. + +2008-05-15 Stuart Hastings + + Radar 5695218 + * stmt.c (expand_asm_operands): Revert last change. + +2008-05-13 Stuart Hastings + + Radar 5695218 + * common.opt (-fglobal-alloc-prefer-bytes): New flag. + * doc/invoke.texi (-fglobal-alloc-prefer-bytes): Document it. + * tree-pass.h (pass_life3): Declare new pass. + * passes.c (init_optimization_passes): Add pass_life3. + * flow.c (normal_flow, maybe_uses_pic_offset_table_rtx, + gate_flow_lite, flow_lite, pass_life3): New. + (verify_local_live_at_start): Tolerate picbase register + deaths. (update_life_info, alloc_reg_life_data, + free_propagate_block_info, mark_set_1): Check normal_flow + before setting REG_LIVE_LENGTH(). (attempt_auto_inc): Check + normal_flow before setting REG_LIVE_LENGTH(), call + maybe_uses_pic_offset_table_rtx(). + * global.c (global_alloc): Rebalance parenthesis, restore + un-alloc-ability status of PIC_OFFSET_TABLE_REGNUM. + (allocno_compare): Prefer byte registers. + (remove_invlidated_death_notes): Tolerate out-of-range + original regnos. (dump_global_regs): Dump RTXs instead of + numbers, add register names to hard reg list. + (dump_hard_regset, debug_hard_regset): New. + * local-alloc.c (pic_rtx_inheritance, reg_inheritance_matrix, + reg_inheritance_1, reg_inheritance, dump_inheritance, + debug_inheritance): New. (local_alloc): Initialize and free + reg_inheritance_matrix. (update_equiiv_regs): Call + reg_inheritance_1 on every insn. + * config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Rewrite. + * rtl.h (replace_regs): Declare. + * config/i386/i386.c (pic_labels_used): Add GTY marker. + (ix86_globally_replace_pic_reg): New. (ix86_save_reg): + Handle non-picbase useage of %ebx, call + ix86_globally_replace_pic_reg(). + (ix86_tieable_integer_mode_p): Convert integral return + expression into bool. + * stmt.c (expand_asm_operands): Revise to handle new %ebx + allocation policy. + +2008-05-12 Fariborz Jahanian + + Radar 5925784 + * c-parser (c_parser_closure_literal_exp): Set TREE_USED + flag on _self hiddent argument. + +2008-05-08 Josh Conner + + Radar 5901604 + * config/rs6000/t-darwin (MULTILIB_EXTRA_OPTS): Define. + +2008-05-08 Josh Conner + + Radar 5914860 + * config/arm/t-darwin (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): + Add armv6. + (TARGET_LIBGCC2_CFLAGS): Remove armv6. + (DARWIN_EXTRA_CRT_BUILD_FLAGS): Remove. + +2008-04-30 Caroline Tice + + Radar 5811961 + * c-decl.c: (declare_closure_prologue_local_vars): Set the source + location for the new decl expr statement to be the source location of + the decl tree. + +2008-04-25 Fariborz Jahanian + + Radar 5803005 (tweaked) + * c-typeck.c (build_external_ref): Refactored global decl checks. + +2008-04-24 Fariborz Jahanian + + Radar 5803005 + * c-typeck.c (build_external_ref): Treat globals as 'byref' by default. + +2008-04-24 Caroline Tice + + Radar 5811943 + * tree.h (TYPE_CLOSURE_IMPL_STRUCT): New macro. + (lang_flag_2): Use previously unused field in tree_type to indicate + closure structs. + * dwarf2out.c (c-common.h): New include statement. + (dwarf_attr_name): Add case for DW_AT_APPLE_closure. + (gen_variable_die): Give pointers to closures the + invoke_impl_ptr_type. + (gen_struct_or_union_type_die): Add DW_AT_APPLE_closure + to structs that define closures. + * dwarf2.h (DW_AT_APPLE_closure): New Dwarf attribute. + * c-typeck.c (invoke_impl_ptr_type): Move declaration from here to + c-common.c + (build_closure_internal_types): Set TYPE_CLOSURE_IMPL_STRUCT + flag for closure structs. + * c-common.c (invoke_impl_ptr_type): Move declaration to here from + c-typeck.c. + +2008-04-23 Fariborz Jahanian + + Radar 5882266 + * c-typeck.c (types_are_closure_compatible): Check for underlying + pointer types as well. + +2008-04-23 Fariborz Jahanian + + Radar 5882266 + * tree.c (reconstruct_complex_type): Add case for + closure pointer types. + * c-decl.c (make_closure_pointer_declarator): Get the 'itarget' + which has the attribute info. + +2008-04-22 Fariborz Jahanian + + Radar 5878380 + * c-typeck.c (convert_for_assignment): Check for a pointer type + before checking for its pointee type. + +2008-04-16 Fariborz Jahanian + + Radar 5868913 + * c-cppbuiltin.c (c_cpp_builtins): Do not define __BLOCKS__ + in c++/ObjC++ modes. + +2008-04-15 Stuart Hastings + + Radar 5862465 + * tree.h (PTR_OR_REF_CHECK, POINTER_TYPE_P): Add + CLOSURE_POINTER_TYPE. + * fold-const.c (fold_convert): Add CLOSURE_POINTER_TYPE. + * testsuite/gcc.apple/closure-5862465.c: New. + +2008-04-02 Fariborz Jahanian + + Radar 5811599 + * c-typeck.c (types_are_closure_compatible): Replaced "Reseverd" field + with "void *isa" in "struct invoke_impl". + * c-parser.c (build_closure_struct_type): Declared "void *_NSConcreteStackBlock" + if necessary and inisitlize 'isa' field with &_NSConcreteStackBlock. + +2008-04-01 Fariborz Jahanian + + Radar 5834569 + * c-parser.c (build_closure_struct_initlist): Variables used as + initializers to block structure must be flagged as TREE_USED. + +2008-04-01 Fariborz Jahanian + + Radar 5344182 + * dwarf2out.c (add_prototyped_attribute): Check for objc as + the language to generate DW_AT_prototyped dwarf attr. + +008-03-31 Fariborz Jahanian + + Radar 5831855 + * c-typeck.c (convert_for_assignment): Block and 'id' types + are interchangeable. + +2008-03-28 Fariborz Jahanian + + Radar 5809099 + * convert.c (convert_to_pointer): Allow typecast of closure + pointer to 'id'. + (convert_to_closure_pointer): Allow typecast of 'id' + of a closure pointer expression. + +2008-03-24 Fariborz Jahanian + + Radar 5824092 + * c-parser.c (c_parser_closure_literal_exp): Diagnose + declaration of block literal at global scope. + +2008-03-26 Caroline Tice + + Radar 5811952 + * dwarf2out.c (dwarf2out_decl): Special treatment for + Block helper function. + +2008-03-25 Fariborz Jahanian + + Radar 5811887 (minor change) + * c-opts.c (c_common_post_options): Remove conditional check + of pedantic when setting flag_blocks. + +2008-03-24 Fariborz Jahanian + + Radar 5811887 + * c-cppbuiltin.c: flag_closures renamed to flag_blocks + * c-parser.c: Ditto. + * c.opt: flag_closures renamed to flag_blocks. flag_blocks + defaulted to -1. + * c-opts.c (c_common_post_options): All flavors of c99, blocks are off by + default unless requested via -fblocks. + +2008-03-24 Fariborz Jahanian + + Radar 5814025 + * c-tree.h (make_closure_pointer_declarator): Takes + additional argument. + * c-decl.c (grokdeclarator): Get 'const'-ness of closure + pointer. + (make_closure_pointer_declarator): Takes additional argument for + const/volatile. + * c-parser.c (c_parser_declarator): Pass down attribute info. + to make_closure_pointer_declarator. + +2008-03-18 Fariborz Jahanian + + Radar 5803600 + * c-decl.c (add_closure_global_byref_list, + in_closure_global_byref_list): New defs. + * c-common.h (add_closure_global_byref_list, + in_closure_global_byref_list): New decls. + * c-typeck.c (build_external_ref): global variables + declared as 'byref' are enterred in their own list + of such declarations per each closure. + * c-parser.c (c_parser_postfix_expression): Remove previous fix. + (c_parser_closure_byref_declaration): Check for global + 'byref' by calling in_closure_global_byref_list. + +2008-03-18 Fariborz Jahanian + + Radar 5805175 + * c-decl.c (build_closure_ref_decl): Set TREE_READONLY flag + on readonly declaration. + +2008-03-17 Fariborz Jahanian + + Radar 5803600 + * c-typeck.c (build_external_ref): Access global 'byref' + variables directly. + * c-parser.c (c_parser_postfix_expression): We are accessing + global 'byref' variables directly. Do not indirect derefence + them. + +2008-03-13 Fariborz Jahanian + + Radar 5795493 + * c-typeck.c: Renamed typesAreClosureCompatible to + types_are_closure_compatible. + +2008-03-12 Fariborz Jahanian + + Radar 5795493 - type matching of closure types + * c-typeck.c (comptypes_internal): Added case for + CLOSURE_POINTER_TYPE. + +2008-03-12 Fariborz Jahanian + + Radar 5796058 - ivar in blocks + * c-decl (build_closure_byref_decl): Takes an additional + argument for the initializer expression. + (build_closure_ref_decl): Ditto. + * c-typeck.c (build_external_ref): Call to build_closure_byref_decl, + build_closure_ref_decl get extra argument. + * c-common.h (build_closure_ref_decl, build_closure_byref_decl): + Take additional argument. + +2008-03-11 Fariborz Jahanian + + Radar 5732232 (Related to change of command option/macro) + * c-cppbuiltin.c: __CLOSURES__ macro rename __BLOCKS__ + * c.opt: -fclosures change to -fblocks. + +2008-03-10 Fariborz Jahanian + + Radar 5782740 - part 2 (bug fix). + * c-parser.c (synth_copy_helper_closure, + synth_destroy_helper_closure): set DECL_ARG_TYPE field of input + arguments for the two synthesized helper functions. + +2008-03-06 Fariborz Jahanian + + Radar 5782740 + * stub-objc.c (retain_closure_component, release_closure_component, + copy_in_object, closure_requires_copying): New stubs. + * c-decl.c (build_helper_func_decl): Setting of CLOSURE_HELPER_FUNC + move at the call site. + (start_closure_helper_function): Changed first argument, added + 2nd argument to conditionally generate the result_decl node. + * c-common.h: Added two new fields to struct closure_sema_info + More extern function decls. + * c-parser.c (build_closure_struct_type): Conditionally add + two new fields to synthesize "struct closure" type. + (build_closure_struct_initlist): Conditionally add helper copy/destroy + function pointers to closure literals. + Set the 'flags' field properly. + (synth_copy_helper_closure_func): New routine to synthesize a closure + copy helper function. + (synth_destroy_helper_closure_func): New routine to synthesize a closure + destroy helper function. + (c_parser_closure_literal_exp): If needed, build closure copy/destroy helper + function declarations and ask for their synthesis. + +2008-03-01 Fariborz Jahanian + + Radar 5732232 - Fix a closure pointer type bug. + + * tree.c (build_closure_pointer_type): Do no add + CLOSURE_POINTER_TYPE to POINTER_TYPE's list. + +2008-02-28 Fariborz Jahanian + + Radar 5732232 - Fix nested closure bugs. + + * tree.h: Defined a new flag and CLOSURE_DECL_COPIED + * c-decl.c (build_closure_ref_decl): Set CLOSURE_DECL_COPIED + for copied variables. + (lookup_name_in_closure): Modified for nested closures. + * c-typeck.c (build_external_ref): Call to lookup_name_in_closure + returns user declaration of the variable if not in current + closure. + * c-common.h: lookup_name_in_closure takes an added argument. + +2008-02-27 Fariborz Jahanian + + Radar 5732232 + * c-parser.c: Use clean_and_exit function call + instead of EXIT_CLEAN macro. + +2008-02-27 Fariborz Jahanian + + Radar 5732232 - code gen part 2. + * tree.h: No need for closure_decl_ref, use + a new flag closure_helper_func instead. + (CLOSURE_HELPER_FUNC): New macro. + * c-decl.c (build_closure_byref_decl): Fix a type bug. + Enter variable in function's body scope. + (build_closure_ref_decl): Find function's body scope and + enter copied in variable in this scope. + (parent_is_closure, bind_closure_args, inside_closure): Removed. + (build_helper_func_decl): New routine to build a FUNCTION_DECL + for helper function. + (start_closure_helper_function): A stripped down version of + start_function used for helper functions only. + (closure_build_prologue, declare_closure_prologue_local_vars): + Builds prologue trees for the helper function. + * function.c (allocate_struct_function): Don't try to figure + out aggregate types for closures as it does not work. + * function.h (cur_closure): Need to declare it. + * c-typeck.c (build_closure_internal_types): Use the main + variant for type compares. + (c_finish_return): Removed dead code and added + code for building the return expressions for closure return + statements. + * tree.def: Removed not needded tree codes. + * c-gimplify.c (c_gimplify_expr): Build closure's return + expression tree. Remove dead code. + * c-common.h: Added/removed some declarations. + * c-parser.c (c_parser_postfix_expression): Dereference + use of byref variables in closures. + (build_closure_struct_type): Fixed a type. + (build_closure_struct_initlist): Must use the new list for + initialization. + (build_closure_literal_tmp): Moved some code around. + (c_parser_closure_literal_expr): Extensive changes to use + the nested function infrastructure for helper functions. + +2008-02-26 Bill Wendling + + * c-typeck.c (build_closure_internal_types) Fix warning. + +2008-02-20 Fariborz Jahanian + + Radar 5732232 - code gen part 1. + * tree.c: Changed apple local markers. + * c-decl.c (build_closure_byref_decl): Add byref decls + to the list of such decls for the closure. + (build_closure_ref_decl): New + (closure_end): Now returns the closure info. + (in_imm_closure_block): Fixed a bug. + (ascend_to_file_scope, restore_current_scope): Two + new routines to enter/exit file scope. + * c-typeck.c (build_external_ref): Allow importation + of variables only to the closure literal block. + (build_function_call): Call to build closure calls trees. + (build_closure_internal_types): New. + (build_closure_call): New. + (c_finish_return): Diagnose returning closure literals on + the stack. + * c-common.h: Added new macros, added couple of fields + to struct closure_sema_info. + * c-parser.c (build_closure_struct_type): New + (build_closure_struct_initlist): New + (build_closure_literal_tmp): New. + (c_parser_closure_literal_expr): Diagnose missing + argument list in closure literal expression. + Generate necessary code for closure literal block use. + * dwarf2out.c (root_type, is_base_type, gen_type_die): Treat + closure pointer types as function pointer types. + +2008-02-15 Fariborz Jahanian + + Radar 5732232 - minor twik + * tree.h: changed a comment. + * c-parser.c (c_parser_closure_byref_declarations): Better way to + report an error. + +2008-02-14 Fariborz Jahanian + + Radar 5732232 - part9 + * tree.h (CLOSURE_DECL_BYREF): New field for var_decl/parm/decl + * c-decl.c (build_closure_byref_decl, in_imm_closure_block): New + * c-typeck.c (build_external_ref): Build a new declaration in + current scope for a byref variable decl. + * c-common.h (in_imm_closure_block, build_closure_byref_decl, + building_closure_byref_decl): New decls. + * c-parser.c (c_parser_compound_statement_nostart): Parse byref + variable decls enclosed by '|'. + (c_parser_closure_byref_declarations): New + +2008-02-13 Fariborz Jahanian + + Radar 5732232 - part 8 + + *c-parser.c (c_parser_statement_after_labels): Diagnose use of gotos + in closures. + (c_parser_closure_literal_exp): Diagnose break/continue statement + used in a closure literal block which is nested in a while/for/switch + statement. + +2008-02-13 Fariborz Jahanian + + Radar 5732232 - part 7 + * c-typeck.c (build_conditional_expr): Add closure pointer expression + use in conditionals. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 - part 6 (closure literal expressions). + + * tree.def (CLOSURE_EXPR_EXPR): New closure tree node. + * c-gimplify.c (c_gimplify_expr): Hack to ignore gimplification + of CLOSURE_EXPR_EXPR expressions. + * c-parser.c (c_parser_postfix_expression): Remove restriction on + postfix expression after a caret. + (c_parser_block_expr): Now parse and build CLOSURE_EXPR_EXPR + for closure expressions. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 - part 5 + * c-typeck.c (c_finish_return): Warn when returning a closure block + literal expression. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 - part4 (argument declaration in closure literals). + * c-decl.c (bind_closure_args): New + (closure_end): pop the scope. + (inside_closure): Use c-style comments. + * c-typeck.c : (convert_arguments): Fix a diagnistic. + * c-gimplify.c (c_gimplify_expr): Fix type of the hack. + * c-common.h (closure_sema_info): Fix type of params field. + (bind_closure_args): New decl. + * c-parser.c (c_parser_postfix_expression): Check for '(' as + a new lookahead after '^'. + (c_parser_block_expr): Modified to handle argument decls. + before closure literal block. + +2008-02-11 Fariborz Jahanian + + Radar 5732232 - part3 (closure return statement). + * c-decl.c (cur_closure) Global decl. to keep track of + closure block literals. + (closure_start): Allocate and initialize a new + cur_closure object. + (closure_end): Free up cur_closure object and set it + to its predecessor, if any. + (inside_closure): Use cur_closure to know if inside a closure. + (lookup_name_in_closure): Use cur_closure instead. + * c-typeck.c (c_finish_return): Short circuit to closure-specific + routine if 'return' is inside a closure. + remove check for inside closure in two places (no longer + needed). + (c_finish_closure_return_stmt): New + * c-common.h (closure_sema_info): New overall data structure to + keep track of various closure context information. + * c-parser.c (c_parser_block_expr): Initialize and then use + closure's return type in building function type. + +2008-02-09 Fariborz Jahanian + + Radar 5732232 - part 2 (basic closure literals syntax). + * tree.h (closure_decl_ref): New flag + for variables used in closures and declared + outside its scope. + (CLOSURE_DECL_REF) : Macro for above flag. + * c-decl.c (closure_scope): New flag for the closure's scope. + (closure_start, closure_end, inside_closure, + lookup_name_in_closure, parent_is_closure): New + * c-typeck.c (build_external_ref): Record variables used in + closure but declared outside. + * (c_finish_return) don't issue return warning if + inside closure. + (c_finish_bc_stmt): issue diagnostic for continuation + inside closures (currently commented out). + * tree.def (CLOSURE_BLOCK_EXPR): New expression node + for closure literals. + * c-gimplify.c (c_gimplify_expr): For now ignore + gimplifying CLOSURE_BLOCK_EXPR tree. + * c-common.h (closure_start, closure_end, inside_closure, + lookup_name_in_closure, parent_is_closure): New decls. + * c-parser.c (c_parser_postfix_expression): Parse and + build a closure literal block. + (c_parser_block_expr) : New. + +2008-02-08 Fariborz Jahanian + + closures - part2 + * c-cppbuiltin.c (c_cpp_builtins) __CLOSURES__ to 1 if -fclosures + is passed. + +2008-02-08 Fariborz Jahanian + + closures - part1 + * tree.c (build_closure_pointer_type): New + * tree.h (build_closure_pointer_type): New decl. + * c-tree.h (cdk_closure_pointer): New enumerator for + enum c_declarator_kind. + * (make_closure_pointer_declarator): New decl. + * c-pretty-print.c (pp_c_caret): New + * c-pretty-print (pp_c_caret): New decl. + (pp_c_pointer): recognize CLOSURE_POINTER_TYPE and + translate it into '^'. + (pp_c_specifier_qualifier_list): Handle CLOSURE_POINTER_TYPE type. + (pp_c_abstract_declarator): Ditto. + (pp_c_direct_abstract_declarator): Ditto. + (pp_c_direct_declarator): Ditto. + * stor-layout.c (layout_type): Set mode for CLOSURE_POINTER_TYPE. + * c-typeck.c (typesAreClosureCompatible): New + (build_function_call): Allow call of a closure pointer. + (convert_arguments): Make diagnostic specific to a bad closure + pointer call. + (build_unary_op): Allow '!' unary operation on a closure pointer. + (build_c_cast): Allow cast of a closure pointer to void *. + (functionTypesAreClosureCompatible): New + (typesAreClosureCompatible): New + (convert_for_assignment): Handle assignment of two closue pointers, + int to a closure pointer, etc. + (build_binary_op): Handle comparing two closure pointers, closure pointer + and NULL. + * c.opt: New -fclosures option. + * calls.c (expand_call): Call can be to a closure pointer. + * tree.def: Define new CLOSURE_POINTER_TYPE type. + * c-convert.c (convert): Handle convertion to a CLOSURE_POINTER_TYPE. + * c-parser.c (c_parser_declarator): Supprt use of '^' in a declarator + under -fclosures flag only. + * convert.c (convert_to_pointer): Support convertion of a closure + pointer to "void *". + (convert_to_closure_pointer): New + * convert.h (convert_to_closure_pointer): New declaration. + +2008-07-22 Josh Conner + + Radar 6077274 + * config/darwin.c (machopic_symbol_defined_p): Return false + for a weak function declaration. + +2008-07-22 Josh Conner + + Radar 6083621 + * config/arm/arm.c (arm_adjust_insn_length): Add 2 bytes for + alignment to 32-bit thumb switch tables. + +2008-07-22 Josh Conner + + Radar 6067743 + * config/arm/arm.c (arm_reorg): Move label pad logic into... + (get_label_pad): ...here... + (create_fix_barrier): ...and call it here, too. + +2008-07-15 Josh Conner + + Radar 6062215 + * config/arm/arm.c (arm_encode_call_attribute): Check visibility + too. + (arm_darwin_encode_section_info): Likewise. + +2008-06-25 Josh Conner + + Radar 6008578 + * config/arm/arm.c (arm_reorg): Consider alignment of labels. + (arm_function_boundary): New function... + * config/arm/arm.h (FUNCTION_BOUNDARY): ...use it. + +2008-06-18 Josh Conner + + Radar 6013984 + * config/arm/darwin.h (CC1_SPEC): Ignore -pg. + +2008-06-06 Josh Conner + + Radar 5920116 + * config/arm/arm.c (arm_output_mi_thunk): Add longcall + handling. When indirecting, use a non-lazy ptr for weak + calls. + +2008-06-05 Josh Conner + + Radar 5914860 + * t-darwin (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Add armv6. + (TARGET_LIBGCC2_CFLAGS): Remove armv6. + (DARWIN_EXTRA_CRT_BUILD_FLAGS): Remove. + +2008-05-27 Josh Conner + + Radar 5960553 + * c.opt (iwithsysroot): Add -iwithsysroot. + * c-opts.c (c_common_missing_argument): Likewise. + (c_common_handle_option): Likewise. + * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Likewise. + * doc/invoke.texi: Describe -iwithsysroot option. + +2008-05-15 Josh Conner + + Radar 5938756 + * dwarf2out.c (modified_type_die): Verify that + TREE_TYPE (TYPE_NAME (type)) is non-null before using it. + +2008-05-14 Stuart Hastings + + Radar 5774356 + * config/rs6000/rs6000.c (debug_sp_offset, + debug_vrsave_offset): New. (rs6000_expand_builtin): Return 0 + when nothing matches. (rs6000_expand_prologue): Revise + sp_offset computation, set debug_sp_offset and + debug_vrsave_offset. (rs6000_expand_epilogue): Test + debug_sp_offset and debug_vrsave_offset. + * testsuite/gcc.apple/5774356.c: New. + +2008-05-12 Stuart Hastings + + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Moved APPLE + LOCAL. + +2008-05-09 Stuart Hastings + + Radar 5799099 + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Moved + cast-into-void* check after checks for losing volatile or + const. + * testsuite/gcc.apple/5799099.c: New. + +2008-05-09 Caroline Tice + + Radar 5914395 + * config/darwin-c.c (darwin_cpp_builtins): Define __OBJC_GC__ for + -fobjc-gc-only option as well. + +2008-05-06 Jim Grosbach + + Radar 5880719 + Merge from 4.0 + * combine.c: Add parameter to try_combine declaration. + (COMBINE_TRY_RETAIN): Define, if not already. + (try_combine): Add new parameter. If we had to add copies + of the original input(s) because their value(s) are used later, + and the resulting pattern does not match, try matching the + replacement without those copie(s) and leaving the original(s) + alone. + (combine_instructions): Adjust calls to try_combine. + (combine_validate_cost): Allow i2 to be 0. In retain_inputs + case, accept replacement when it is equal to original, not + necessarily a strict improvement. + * config/arm/arm.c (arm_size_rtx_costs): Adjust cost of DImode MULT. + * config/arm/arm.md (muldi3, *soft_muldi3): New. + * config/arm/cirrus.md (muldi3): Rename to cirrus_muldi3. + +2008-05-02 Josh Conner + + Radar 5905142 + * doc/invoke.texi: Add documentation for + MACOSX_DEPLOYMENT_TARGET and IPHONEOS_DEPLOYMENT_TARGET. + +2008-05-02 Jim Grosbach + + Radar 5903944 + * config/arm/arm.h (ASM_OUTPUT_ADDR_DIFF_VEC): Add missing + parentheses. + +2008-05-01 Caroline Tice + + Radar 5741731 + * dwarf2out.c (c-common.h): New include statement. + (modified_type_die): Temporarily remove volatile attribute, if it + was added because of objective '@try' block. + +2008-04-30 Josh Conner + + Radar 5702478 + * config/rs6000/rs6000.c (rs6000_override_options): Always + set TARGET_PIM_ALTIVEC if rs6000_altivec_pim is given. + +2008-04-29 Josh Conner + + Radar 5866634 + * cse.c (insert): Balance parentheses across #ifdefs. + +2008-04-29 Josh Conner + + Radar 5866634 + * cse.c (insert): Lower cost of SP+const addresses. + +2008-04-28 Josh Conner + + Radar 5883867 + * config.gcc (arm*-*-darwin*): Clear extra_headers. + +2008-04-16 Jim Grosbach + + Radar 5837498 + * config/arm/arm.h (ASM_OUTPUT_ADDR_DIFF_VEC): Use assembler + expression to calculate (L1-L2)/2 rather than relying on insn + length attributes. + +2008-04-22 Josh Conner + + Radar 5840600 + * common.opt (flocal-alloc): New command-line option and + corresponding variable, flag_local_alloc... + * local-alloc.c (block_alloc): ...use it. + * config/arm/arm.c (optimization_options): ...disable it by + default. + * doc/invoke.texi: Add -flocal-alloc documentation. + +2008-04-16 Jim Grosbach + + Radar 5831562 + Merge from 4.0 + * global.c (TIE_PSEUDOS): New macro. + (empty_reg_set): New variable. + (find_reg): Adjust heuristics of propagating preferences and + pseudo-pseudo ties after a reg is selected. + (set_preference): Allow for vector/nonvector SUBREGS. Use + TIE_PSEUDOS. + * config/arm/arm.h (TIE_PSEUDOS): Define. + +e008-04-15 Josh Conner + + Radar 5866711 + * config/darwin.h (DARWIN_DYLIB1_SPEC): When + -miphoneos-version-min is seen, use dylib1.o. + +2008-04-15 Josh Conner + + Radar 5866354 + * config.host (*-darwin*): Add DARWIN_PCH_ADDR_SPACE_SIZE to + host_xm_defines. + * config/host-darwin.c (pch_address_space): Use + DARWIN_PCH_ADDR_SPACE_SIZE to determine size. + * config/arm/x-darwin: New file. + * config/arm/host-arm-darwin.c: New file. + +2008-04-15 Jim Grosbach + + Radar 5831562 + Merge from 4.0 + * expr.c (expand_expr_real_1) (CONVERT_EXPR): + Improve codegen for (int)(long long >> 32). + +2008-04-11 Jim Grosbach + + Radar 5831562 + Merge from 4.0 + * config/arm/arm.c (const64_ok_for_arm_add, + const64_ok_for_arm_immediate): New. + * config/arm/arm-protos.h: Prototype them. + * config/arm/predicates.md (arm_immediate64_operand, + arm_rhs64_operand, arm_add_immediate64_operand, + arm_add64_operand): New. + * config/arm/constraints.md: Add 'Dd'. + * config/arm/arm.md (adddi3, *arm_adddi3, unnamed define_split + for logical binary operators, anddi3, iordi3, xordi3): Accept + 64-bit constants that match 'Dd' constraint. + (adddi3): Allow negative constants whose negation is in-range + for SUB; generate SUB for these. + (subdi3): Allow constants either in-range for SUB, or whose + negation is in-range for ADD. Generate ADD for the latter. + (*arm_adddi3, *arm_subdi3): Allow constants. + +2008-04-11 Josh Conner + + Radar 5840278 - part 2 + * (analyze_leg): Cast TREE_INT_CST_HIGH to unsigned. + +2008-04-10 Josh Conner + + Radar 5854251 + * config/arm/libgcc-iphoneos.ver: Remove __switch* functions. + +2008-04-09 Jim Grosbach + + Radar 5831562 + Merge from 4.0 + * local-alloc.c (find_free_reg): Use DIMODE_REG_ALLOC_ORDER, if + defined. + * regclass.c (dimode_reg_alloc_order, + dimode_inv_reg_alloc_order): New variables. + (init_reg_sets): Use DIMODE_REG_ALLOC_ORDER, if defined. + * global.c (find_reg): Use DIMODE_REG_ALLOC_ORDER, if defined. + * hard-reg-set.h (dimode_reg_alloc_order, + dimode_inv_reg_alloc_order): New declarations. + * config/arm/arm.h (IMODE_REG_ALLOC_ORDER): New macro. + (COMBINE_TRY_RETAIN): New macro. + * recog.c (peep2_find_free_register): Use + DIMODE_REG_ALLOC_ORDER, if defined. + * reload1.c (find_reg): Likewise. + +2008-04-09 Josh Conner + + Radar 5851089 + * config/arm/arm.md (insv): Enable for Thumb. + +2008-04-09 Josh Conner + + Radar 5847848 + * ifcvt.c (cond_exec_process_insns): Don't stop + conditionalization at a compare for TARGET_ARM. + (cond_exec_branch_targets_equiv): New function. + (cond_exec_process_if_block): Allow for null then_bb, + indicating merging of multiple && or || blocks only. + (process_if_block): Ditto. + (find_if_block): Ditto. + * config/arm/arm.c (arm_ifcvt_modify_multiple_tests): New + function. + * config/arm/arm.h (IFCVT_MODIFY_MULTIPLE_TESTS): New define. + * config/arm/arm-protos.h (arm_ifcvt_modify_multiple_tests): + New proto. + * config/arm/arm.md (*arm_cmpsi_insn): Mark predicable. + +2008-04-03 Josh Conner + + Radar 5840278 + * expr.c (look_for_bytemanip): New function... + (expand_expr_real_1): ...use it. + (struct bytemanip): New type. + (bswap32_shift_first): New variable. + (bswap32_and_first): New variable. + (bswap64_shift_first): New variable. + (bswap64_and_first): New variable. + (uxtb16_shift_first): New variable. + (uxtb16_and_first): New variable. + (find_and_record_values): New function. + (analyze_leg): New function. + * config/arm/arm.md (bswapsi2): New expand. + (arm_bswapsi2): New insn. + (thumb_bswapsi2): New insn. + (bswapdir2): New expand. + (arm_bswapdi2): New insn. + (thumb_bswapdi2): New insn. + (uxtb16): New insn. + +2008-04-03 Josh Conner + + Radar 5835816 + * config/arm/arm.md (arm_andsi3_insn): Remove non-immediate + operand permutation. Change from a define_insn_and_split to a + define_insn. + (arm_iorsi3): Likewise. + +2008-04-02 Jim Grosbach + + Radar 5831528 + * ifcvt.c (cond_exec_process_insns): Don't conditionally + execute calls with a NORETURN note attached. + * config/arm/arm.md (call_reg_armv6, call_reg_arm, call_mem, + call_value_reg_armv5, call_value_reg_arm, call_value_mem): + Make predicable. + (call_symbol_predicable): New. + (call_value_symbol_predicable): New. + (call_symbol): Only match for TARGET_INTERWORK. + (call_value_symbol): Likewise. + +2008-04-01 Josh Conner + + Radar 5829269 + * config/arm/arm.md (define_split 64-bit constants): Always + split 64-bit constants when generating Thumb code. + +2008-04-01 Fariborz Jahanian + + Radar 5344182 + * dwarf2out.c (add_prototyped_attribute): Check for objc as + the language to generate DW_AT_prototyped dwarf attr. + +2008-04-01 Josh Conner + + Radar 5829297 + * config/arm/arm.c (thumb_size_rtx_costs): New function... + (arm_size_rtx_costs): ...Use it. + +2008-03-31 Jim Grosbach + + Radar 5819088 + * cfglayout.c (duplicate_insn_chain): Add missing case to + copy NOTE_INSN_ALLOCA notes. + +2008-03-31 Stuart Hastings + + Radar 5814283 + * gcc/testsuite/gcc.apple/5814283.c: Tweaked to test on x86 + only. + +2008-03-28 Jim Grosbach + + Radar 5823776 + * config/darwin.h: Use crt1.o if iphoneos-version-min is + specified + +2008-03-27 Stuart Hastings + + Radar 5814283 + * config/i386/emmintrin.h (_mm_shuffle_pd, + _mm_shufflehi_epi16, _mm_shufflelo_epi16, + _mm_shuffle_epi32): Insert missing parens. + * config/i386/tmmintrin.h (_mm_alignr_epi8): Insert missing + parens. + * testsuite/gcc.apple/5814283.c: New. + +2008-03-24 Josh Conner + + Radar 5777572 - take 2 (cont.) + * config/darwin.h (LINK_SPEC): Change -iphone_version_min to + -iphoneos_version_min. + * config/arm/darwin.h (DARWIN_LD_MINVERSION_SPEC): Likewise. + +2008-03-24 Josh Conner + + Radar 5819018 + * config/darwin-driver.c (darwin_default_min_version): Don't + warn if both MACOSX_DEPLOYMENT_TARGET and + IPHONEOS_DEPLOYMENT_TARGET are set. + +2008-03-24 Josh Conner + + Radar 4382996 + * config/arm/predicates.md (binary_cc_noclobber_operator): New + special_predicate. + * config/arm/arm.md (arm_binary_ne_0) New define_insn_and_split. + (arm_add_ne_0): Likewise. + (arm_mul_ne_0): Likewise. + +2008-03-24 Stuart Hastings + + Radar 5612787 + * testsuite/lib/target-supports.exp + (check_no_compiler_messages, check_no_messages_and_pattern): + Remove redundant definitions. + +2008-03-24 Josh Conner + + Radar 4826373 + * config/arm/darwin.h (ASM_OUTPUT_ALIGNED_COMMON): Remove + undef. + +2008-03-20 Fariborz Jahanian + + Radar 5802025 + * c-common.h (objc_build_property_getter_func_call): New decl. + * stub-objc.c (objc_build_property_getter_func_call): New stub. + +2008-03-19 Bill Wendling + + Radar 5571540 + * config/i386/i386.c (output_pic_addr_const): darwin_stubs flag + is only available on Mach-O systems. + +2008-03-17 Josh Conner + + Radar 5619587 (Reverts 5342595) + * config/i386/darwin.h (DARWIN_DSYMUTIL_SPEC): Remove + definition. + * config/rs6000/darwin.h (DARWIN_DSYMUTIL_SPEC): Likewise. + * config/arm/darwin.h (DARWIN_DSYMUTIL_SPEC): Likewise. + (PREFERRED_DEBUGGING_TYPE): Remove definition. + * config/darwin.h (LINK_COMMAND_SPEC): Replace darwin_dsymutil + spec invocation with string. + (darwin_dsymutil): Remove spec definition. + +2008-03-15 Josh Conner + + Radar 5777572 - take 2 + * config.gcc: Replace all instances of 'iphone' with 'iphoneos'. + * config/darwin-c.c: Likewise. + * config/darwin.opt: Likewise. + * config/i386/darwin.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/darwin.h: Likewise. + * config/arm/darwin.h: Likewise. + * config/darwin-driver.c: Likewise. + * config/arm/t-slibgcc-iphone: Rename to... + * config/arm/t-slibgcc-iphoneos: ...new file. + * config/arm/libgcc-iphone.ver: Rename to... + * config/arm/libgcc-iphoneos.ver: ...new file. + +2008-03-14 Josh Conner + + Radar 5641084 + * config/arm/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Err on -pg. + +2008-03-13 Jim Grosbach + + Radar 5798689 + * testsuite/gcc.dg/sibcall-3.c: Skip test for thumb + * testsuite/gcc.dg/sibcall-4.c: Likewise + +2008-03-13 Josh Conner + + Undo Radar 5730079 + * config/i386/darwin.h (DARWIN_ALLOWED_VERSION_TYPES): Remove + definition. + * config/rs6000/darwin.h (CC1_SPEC): Don't err on + -miphone-version-min. + (DARWIN_ALLOWED_VERSION_TYPES): Remove definition. + * config/darwin.h (DARWIN_VERSION_MACOSX): Remove definition. + (DARWIN_VERSION_IPHONE): Remove definition. + (enum darwin_version_type): New enum. + (darwin_default_min_version): Remove allowable_vers_types + parameter. + * config/arm/darwin.h (CC1_SPEC): Don't err on + -mmacosx-version-min switch. + (DARWIN_ALLOWED_VERSION_TYPES): Remove definition. + * config/darwin-driver.c (darwin_default_min_version): Remove + allowable_vers_types parameter and logic to handle it. Rename + default_vers_type paramter to vers_type. + +2008-03-13 Josh Conner + + Radar 5777572 + * config.gcc: Replace all instances of 'aspen' with 'iphone'. + * config/darwin-c.c: Likewise. + * config/darwin.opt: Likewise. + * config/i386/darwin.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/darwin.h: Likewise. + * config/arm/darwin.h: Likewise. Also, set default minversion + to 2.0. + * config/darwin-driver.c: Likewise. + * config/arm/t-slibgcc-aspen: Rename to... + * config/arm/t-slibgcc-iphone: ...new file. + * config/arm/libgcc-aspen.ver: Rename to... + * config/arm/libgcc-iphone.ver: ...new file. + +2008-03-12 Stuart Hastings + + Radar 5612787 + * ChangeLog.apple: Fixed typo in two entries. + +2008-03-10 Stuart Hastings + + * config/i386/i386.c (ix86_builtins): Need APPLE LOCAL markers + around deletion. + +2008-03-07 Josh Conner + + Radar 5782111 + * config/darwin.h (ASM_OUTPUT_LABELREF): Add label prefix to + quoted names, too. + +2008-03-07 Stuart Hastings + + * c-common.c: Restore blank line to satisfy checklocals. + * config/i386/i386.c (ix86_builtins): APPLE LOCAL marker for + deletion. + * config/darwin.c (output_objc_section_asm_op): Insert blank + to force checklocal behavior. + +2008-03-07 Stuart Hastings + + Radar 5612787 + * config/i386/ammintrin.h: Added APPLE LOCAL file marker. + * config/i386/nmmintrin.h: Added APPLE LOCAL file marker. + * config/i386/smmintrin.h: Added APPLE LOCAL file marker. + * c-typeck.c (build_binary_op): Added APPLE LOCAL marker. + +2008-03-06 Stuart Hastings + + Radar 5612787 + * expr.h (expand_normal): New. + * config.gcc(extra_headers): For x86, added ammintrin.h, + smmintrin.h, and nmmintrin.h. (OPTION_MASK_ISA_SSE4_1, + OPTION_MASK_ISA_SSE4_2, OPTION_MASK_ISA_SSE4A): New. + * doc/invoke.texi (-flax-vector-conversions): New flag. + * c.opt (-flax-vector-conversions): New flag. + * c-common.h (vector_types_convertible_p): Update extern decl. + (-flax-vector-conversions): New. + * c-common.c (-flax-vector-conversions): New flag, defaulting + TRUE. (vector_types_convertible_p): Backport 4.3 code with + new emit_lax_note parameter. + * c-opts.c (-flax-vector-conversions): New flag. + * c-typeck.c (convert_for_assignment, digest_init): New parm + for vector_types_convertible_p. + * cp/call.c (standard_conversion): New parm for + vector_types_convertible_p. + * cp/typeck.c (convert_for_assignment, + ptr_reasonably_similar): New parm for + vector_types_convertible_p. + * cp/typeck2.c (digest_init): New parm for + vector_types_convertible_p. + * config/i386/i386.h (MASK_SSEREGPARM, MASK_SSSE3, + MASK_NO_RED_ZONE): Tweak bit masks. + (OPTION_MASK_ISA_SSE4_1, OPTION_MASK_ISA_SSE4_2, + OPTION_MASK_ISA_SSE4A, TARGET_SSE4_1, TARGET_SSE4_2, + TARGET_SSE4A): New. (TARGET_SWITCHES): New flags "sse4.1", + "sse4.2", "sse4", "no-sse4", "sse4a". + (TARGET_CPU_CPP_BUILTINS): New defines "__SSE4_1__", + "__SSE4_2__", "__SSE4A__". (reg_class, REG_CLASS_NAMES, + REG_CLASS_CONTENTS): New class: SSE_FIRST_REG. + (REG_CLASS_FROM_CONSTRAINT, CONSTRAINT_LEN): New; support + "Y0". + * config/i386/i386.md (UNSPEC_EXTRQI, UNSPEC_EXTRQ, + UNSPEC_INSERTQI, UNSPEC_INSERTQ, UNSPEC_BLENDV, + UNSPEC_INSERTPS, UNSPEC_DP, UNSPEC_MOVNTDQA, UNSPEC_MPSADBW, + UNSPEC_PHMINPOSUW, UNSPEC_PTEST, UNSPEC_ROUND, UNSPEC_CRC32, + UNSPEC_PCMPESTR, UNSPEC_PCMPISTR): New. (sseinsq, sseinsqi, + prefix_extra, negtf2, abstf2, *absnegtf2_sse, CRC32MODE, + crc32modesuffix, crcmodeconstraint, sse4_2_crc32, + sse4_2_crc32di): New. (length_immediate) Add support for + SSE4A insertq. + * config/i386/nmmintrin.h: New. + * config/i386/smmintrin.h: New. + * config/i386/ammintrin.h: New. + * config/i386/predicates.md (reg_not_xmm0_operand, + nonimm_not_xmm0_operand, const_pow2_1_to_2_operand, + const_pow2_1_to_32768_operand): New. + * config/i386/smmintrin.h: New file. + * config/i386/i386-modes.def + (CCA, CCC, CCO, CCS, V2QI): New modes. + * config/i386/sse.md (SSEMODE14, sse4_2_crc32, + sse4_2_crc32di, *vec_setv4sf_sse4_1, sse4_1_insertps, + sse4_1_mulv2siv2di3, *sse4_1_mulv4si3, *sse4_1_smax3, + *sse4_1_umax3, *sse4_1_smin3, + *sse4_1_umin3, sse4_1_eqv2di3, sse4_2_gtv2di3, + *sse4_1_pinsrb, *sse4_1_pinsrd, *sse4_1_pinsrq, + *sse4_1_pextrb, *sse4_1_pextrb_memory, sse2_pextrw, + *sse4_1_pextrw_memory, *sse4_1_pextrd, *sse4_1_pextrq, + sse4a_vmmovntv2df, sse4a_movntdf, sse4a_vmmovntv4sf, + sse4a_movntsf, sse4a_extrqi, sse4a_extrq, sse4a_insertqi, + sse4a_insertq, sse4_1_blendpd, sse4_1_blendps, + sse4_1_blendvpd, sse4_1_blendvps, sse4_1_dppd, sse4_1_dpps, + sse4_1_movntdqa, sse4_1_mpsadbw, sse4_1_packusdw, + sse4_1_pblendvb, sse4_1_pblendw, sse4_1_phminposuw, + sse4_1_extendv8qiv8hi2, *sse4_1_extendv8qiv8hi2, + sse4_1_extendv4qiv4si2, *sse4_1_extendv4qiv4si2, + sse4_1_extendv2qiv2di2, *sse4_1_extendv2qiv2di2, + sse4_1_extendv4hiv4si2, *sse4_1_extendv4hiv4si2, + sse4_1_extendv2hiv2di2, *sse4_1_extendv2hiv2di2, + sse4_1_extendv2siv2di2, *sse4_1_extendv2siv2di2, + sse4_1_zero_extendv8qiv8hi2, *sse4_1_zero_extendv8qiv8hi2, + sse4_1_zero_extendv4qiv4si2, *sse4_1_zero_extendv4qiv4si2, + sse4_1_zero_extendv2qiv2di2, *sse4_1_zero_extendv2qiv2di2, + sse4_1_zero_extendv4hiv4si2, *sse4_1_zero_extendv4hiv4si2, + sse4_1_zero_extendv2hiv2di2, *sse4_1_zero_extendv2hiv2di2, + sse4_1_zero_extendv2siv2di2, *sse4_1_zero_extendv2siv2di2, + sse4_1_ptest, sse4_1_roundpd, sse4_1_roundps, + sse4_1_roundsd, sse4_1_roundss, sse4_2_pcmpestr, + sse4_2_pcmpestri, sse4_2_pcmpestrm, sse4_2_pcmpestr_cconly, + sse4_2_pcmpistr, sse4_2_pcmpistri, sse4_2_pcmpistrm, + sse4_2_pcmpistr_cconly): New. (sse2_smulv8hi3_highpart): + Split and renamed to smulv8hi3_highpart and + *smulv8hi3_highpart. (sse2_umulv8hi3_highpart): Split and + renamed to umulv8hi3_highpart and *umulv8hi3_highpart. + (sse2_umulv2siv2di3): Tweaked to V4SImode, added + prefix_data16. (umaxv4si3): Support pmaxud. (umin3): + Support pminud. * config/i386/darwin.h + (MASK_MACHO_DYNAMIC_NO_PIC, MASK_ALIGN_NATURAL, + MASK_ALIGN_MAC68K): Tweak mask bits. * + config/i386/i386-protos.h (ix86_expand_sse_unpack, + ix86_expand_sse4_unpack): New. * config/i386/i386.c + (x86_popcnt) New. (enum pta_flags): Added PTA_CX16, + PTA_POPCNT, PTA_ABM, PTA_SSE4A, PTA_NO_SAHF, PTA_SSE4_1, + PTA_SSE4_2. (override_options): Support + OPTION_MASK_ISA_SSE4_1, OPTION_MASK_ISA_SSE4_2, + OPTION_MASK_ISA_SSE4A, x86_popcnt. (ix86_expand_int_vcond): + Backport 4.3 code. (ix86_expand_sse_unpack, + ix86_expand_sse4_unpack): New. (IX86_BUILTIN_MOVNTSD, + IX86_BUILTIN_MOVNTSS, IX86_BUILTIN_EXTRQI, + IX86_BUILTIN_EXTRQ, IX86_BUILTIN_INSERTQI, + IX86_BUILTIN_INSERTQ, IX86_BUILTIN_BLENDPD, + IX86_BUILTIN_BLENDPS, IX86_BUILTIN_BLENDVPD, + IX86_BUILTIN_BLENDVPS, IX86_BUILTIN_PBLENDVB128, + IX86_BUILTIN_PBLENDW128, IX86_BUILTIN_DPPD, + IX86_BUILTIN_DPPS, IX86_BUILTIN_INSERTPS128, + IX86_BUILTIN_MOVNTDQA, IX86_BUILTIN_MPSADBW128, + IX86_BUILTIN_PACKUSDW128, IX86_BUILTIN_PCMPEQQ, + IX86_BUILTIN_PHMINPOSUW128, IX86_BUILTIN_PMAXSB128, + IX86_BUILTIN_PMAXSD128, IX86_BUILTIN_PMAXUD128, + IX86_BUILTIN_PMAXUW128, IX86_BUILTIN_PMINSB128, + IX86_BUILTIN_PMINSD128, IX86_BUILTIN_PMINUD128, + IX86_BUILTIN_PMINUW128, IX86_BUILTIN_PMOVSXBW128, + IX86_BUILTIN_PMOVSXBD128, IX86_BUILTIN_PMOVSXBQ128, + IX86_BUILTIN_PMOVSXWD128, IX86_BUILTIN_PMOVSXWQ128, + IX86_BUILTIN_PMOVSXDQ128, IX86_BUILTIN_PMOVZXBW128, + IX86_BUILTIN_PMOVZXBD128, IX86_BUILTIN_PMOVZXBQ128, + IX86_BUILTIN_PMOVZXWD128, IX86_BUILTIN_PMOVZXWQ128, + IX86_BUILTIN_PMOVZXDQ128, IX86_BUILTIN_PMULDQ128, + IX86_BUILTIN_PMULLD128, IX86_BUILTIN_ROUNDPD, + IX86_BUILTIN_ROUNDPS, IX86_BUILTIN_ROUNDSD, + IX86_BUILTIN_ROUNDSS, IX86_BUILTIN_PTESTZ, + IX86_BUILTIN_PTESTC, IX86_BUILTIN_PTESTNZC, + IX86_BUILTIN_VEC_EXT_V16QI, IX86_BUILTIN_VEC_SET_V2DI, + IX86_BUILTIN_VEC_SET_V4SF, IX86_BUILTIN_VEC_SET_V4SI, + IX86_BUILTIN_VEC_SET_V16QI, IX86_BUILTIN_VEC_PACK_SFIX, + IX86_BUILTIN_CRC32QI, IX86_BUILTIN_CRC32HI, + IX86_BUILTIN_CRC32SI, IX86_BUILTIN_CRC32DI, + IX86_BUILTIN_PCMPESTRI128, IX86_BUILTIN_PCMPESTRM128, + IX86_BUILTIN_PCMPESTRA128, IX86_BUILTIN_PCMPESTRC128, + IX86_BUILTIN_PCMPESTRO128, IX86_BUILTIN_PCMPESTRS128, + IX86_BUILTIN_PCMPESTRZ128, IX86_BUILTIN_PCMPISTRI128, + IX86_BUILTIN_PCMPISTRM128, IX86_BUILTIN_PCMPISTRA128, + IX86_BUILTIN_PCMPISTRC128, IX86_BUILTIN_PCMPISTRO128, + IX86_BUILTIN_PCMPISTRS128, IX86_BUILTIN_PCMPISTRZ128, + IX86_BUILTIN_PCMPGTQ, IX86_BUILTIN_INFQ, IX86_BUILTIN_FABSQ, + IX86_BUILTIN_COPYSIGNQ): New. (def_builtin_const, + bdesc_ptest, bdesc_pcmpestr, bdesc_pcmpistr, bdesc_crc32, + bdesc_sse_3arg): New. (bdesc_2arg): + __builtin_ia32_pmulhw128 and __builtin_ia32_pmulhuw128 + updated for new code. CODE_FOR_sse4_1_mulv2siv2di3, + __builtin_ia32_packusdw128, __builtin_ia32_pcmpeqq, + __builtin_ia32_pmaxsb128, __builtin_ia32_pmaxsd128, + __builtin_ia32_pmaxud128, __builtin_ia32_pmaxuw128, + __builtin_ia32_pminsb128, __builtin_ia32_pminsd128, + __builtin_ia32_pminud128, __builtin_ia32_pminuw128, + __builtin_ia32_pmulld128, __builtin_ia32_pcmpgtq: New. + (bdesc_1arg): CODE_FOR_sse4_1_extendv8qiv8hi2, + CODE_FOR_sse4_1_extendv4qiv4si2, + CODE_FOR_sse4_1_extendv2qiv2di2, + CODE_FOR_sse4_1_extendv4hiv4si2, + CODE_FOR_sse4_1_extendv2hiv2di2, + CODE_FOR_sse4_1_extendv2siv2di2, + CODE_FOR_sse4_1_zero_extendv8qiv8hi2, + CODE_FOR_sse4_1_zero_extendv4qiv4si2, + CODE_FOR_sse4_1_zero_extendv2qiv2di2, + CODE_FOR_sse4_1_zero_extendv4hiv4si2, + CODE_FOR_sse4_1_zero_extendv2hiv2di2, + CODE_FOR_sse4_1_zero_extendv2siv2di2, + CODE_FOR_sse4_1_phminposuw, CODE_FOR_sse4_1_roundpd, + CODE_FOR_sse4_1_roundps: New. (ix86_init_mmx_sse_builtins): + Added SSE4 builtin signatures, including + v2di_ftype_v2di_unsigned_unsigned, + v2di_ftype_v2di_v2di_unsigned_unsigned, + v2di_ftype_v2di_v16qi, v2df_ftype_v2df_v2df_v2df, + v4sf_ftype_v4sf_v4sf_v4sf, v8hi_ftype_v16qi, + v4si_ftype_v16qi, v2di_ftype_v16qi, v4si_ftype_v8hi, + v2di_ftype_v8hi, v2di_ftype_v4si, v2di_ftype_pv2di, + v16qi_ftype_v16qi_v16qi_int, v16qi_ftype_v16qi_v16qi_v16qi, + v8hi_ftype_v8hi_v8hi_int, v4si_ftype_v4si_v4si_int, + int_ftype_v2di_v2di, int_ftype_v16qi_int_v16qi_int_int, + v16qi_ftype_v16qi_int_v16qi_int_int, and + int_ftype_v16qi_v16qi_int. Added __builtin_ia32_movntdqa, + __builtin_ia32_pmovsxbw128, __builtin_ia32_pmovsxbd128, + __builtin_ia32_pmovsxbq128, __builtin_ia32_pmovsxwd128, + __builtin_ia32_pmovsxwq128, __builtin_ia32_pmovsxdq128, + __builtin_ia32_pmovzxbw128, __builtin_ia32_pmovzxbd128, + __builtin_ia32_pmovzxbq128, __builtin_ia32_pmovzxwd128, + __builtin_ia32_pmovzxwq128, __builtin_ia32_pmovzxdq128, + __builtin_ia32_pmuldq128, __builtin_ia32_roundpd, + __builtin_ia32_roundps, __builtin_ia32_roundsd, + __builtin_ia32_roundss, __builtin_ia32_movntsd, + __builtin_ia32_movntss, __builtin_ia32_extrqi, + __builtin_ia32_extrq, __builtin_ia32_insertqi, + __builtin_ia32_insertq, __builtin_ia32_crc32di, + __builtin_ia32_crc32qi, __builtin_ia32_crc32hi, + __builtin_ia32_crc32si, __builtin_ia32_vec_set_v2di, + __builtin_ia32_vec_set_v4sf, __builtin_ia32_vec_set_v4si, + __builtin_ia32_vec_set_v16qi, and + __builtin_ia32_vec_ext_v16qi. + (ix86_expand_sse_4_operands_builtin, ix86_expand_crc32, + ix86_expand_sse_ptest, ix86_expand_sse_pcmpestr, + ix86_expand_sse_pcmpistr): New. (ix86_expand_unop_builtin, + ix86_expand_builtin, ix86_expand_vector_set, + ix86_expand_vector_extract): Backport 4.3 code. + (ix86_expand_vec_set_builtin): Backport PR31582 fix from + 4.2. + * config/darwin.c (machopic_select_section): Backport 4.3 code. + * testsuite/gcc.dg/vect/vect-none.c: Adjust for improved + SSE4 vectorization. + * testsuite/lib/target-supports.exp (get_compiler_message): + Backport additional parameters. + (check_no_compiler_messages, check_no_messages_and_pattern): + New. (check_visibility_available, + check_named_sections_available, + check_effective_target_ilp32, check_effective_target_lp64): + New parm for get_compiler_message(). + * testsuite/gcc.target/i386/sse4_1-pmovsxwq.c: New. + * testsuite/gcc.target/i386/sse4_1-dpps-2.c: New. + * testsuite/gcc.target/i386/sse4_1-insertps-1.c: New. + * testsuite/gcc.target/i386/sse4_1-pcmpeqq.c: New. + * testsuite/gcc.target/i386/sse4_1-roundsd-1.c: New. + * testsuite/gcc.target/i386/sse4_1-roundsd-3.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovsxbq.c: New. + * testsuite/gcc.target/i386/sse4_2-popcntq.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovsxbw.c: New. + * testsuite/gcc.target/i386/sse4_1-pminsb.c: New. + * testsuite/gcc.target/i386/sse4_1-pminsd.c: New. + * testsuite/gcc.target/i386/sse4_1-pmaxsb.c: New. + * testsuite/gcc.target/i386/sse4_1-pblendw.c: New. + * testsuite/gcc.target/i386/sse4_1-roundss-1.c: New. + * testsuite/gcc.target/i386/sse4_1-pblendvb.c: New. + * testsuite/gcc.target/i386/sse4_1-pmaxsd.c: New. + * testsuite/gcc.target/i386/sse4_1-roundss-3.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxwd.c: New. + * testsuite/gcc.target/i386/sse4_1-ptest-2.c: New. + * testsuite/gcc.target/i386/sse4_1-pextrb.c: New. + * testsuite/gcc.target/i386/sse4a-montss.c: New. + * testsuite/gcc.target/i386/sse4_1-pextrd.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c: New. + * testsuite/gcc.target/i386/i386.exp: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxbd.c: New. + * testsuite/gcc.target/i386/sse4_1-roundpd-1.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c: New. + * testsuite/gcc.target/i386/sse4_1-roundpd-3.c: New. + * testsuite/gcc.target/i386/sse4_1-pinsrq.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c: New. + * testsuite/gcc.target/i386/sse4_1-pminuw.c: New. + * testsuite/gcc.target/i386/sse4_1-packusdw.c: New. + * testsuite/gcc.target/i386/sse4_1-pmaxuw.c: New. + * testsuite/gcc.target/i386/sse4_1-check.h: New. + * testsuite/gcc.target/i386/sse4_2-check.h: New. + * testsuite/gcc.target/i386/sse4_1-dppd-1.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovsxwd.c: New. + * testsuite/gcc.target/i386/sse4_1-blendps.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxdq.c: New. + * testsuite/gcc.target/i386/sse4_1-roundps-1.c: New. + * testsuite/gcc.target/i386/sse4_1-roundps-3.c: New. + * testsuite/gcc.target/i386/sse4a-extract.c: New. + * testsuite/gcc.target/i386/sse4_2-crc32q.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpstr.h: New. + * testsuite/gcc.target/i386/sse4_1-pmuldq.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovsxbd.c: New. + * testsuite/gcc.target/i386/sse4_1-dpps-1.c: New. + * testsuite/gcc.target/i386/sse4_2-crc32w.c: New. + * testsuite/gcc.target/i386/sse4_1-insertps-2.c: New. + * testsuite/gcc.target/i386/sse4_1-phminposuw.c: New. + * testsuite/gcc.target/i386/sse4_2-popcnt.h: New. + * testsuite/gcc.target/i386/sse4_1-extractps.c: New. + * testsuite/gcc.target/i386/sse4_1-blendvps.c: New. + * testsuite/gcc.target/i386/sse4_1-roundsd-2.c: New. + * testsuite/gcc.target/i386/sse4_1-roundsd-4.c: New. + * testsuite/gcc.target/i386/sse4_2-popcntl.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovsxdq.c: New. + * testsuite/gcc.target/i386/sse4_2-crc32.h: New. + * testsuite/gcc.target/i386/sse4a-insert.c: New. + * testsuite/gcc.target/i386/sse4a-montsd.c: New. + * testsuite/gcc.target/i386/sse4_1-round.h: New. + * testsuite/gcc.target/i386/sse4_1-pminud.c: New. + * testsuite/gcc.target/i386/sse4_1-roundss-2.c: New. + * testsuite/gcc.target/i386/sse4_1-pinsrb.c: New. + * testsuite/gcc.target/i386/sse4_1-ptest-1.c: New. + * testsuite/gcc.target/i386/sse4_1-mpsadbw.c: New. + * testsuite/gcc.target/i386/sse4_1-pmaxud.c: New. + * testsuite/gcc.target/i386/sse4_1-roundss-4.c: New. + * testsuite/gcc.target/i386/sse4_1-pinsrd.c: New. + * testsuite/gcc.target/i386/sse4_1-ptest-3.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c: New. + * testsuite/gcc.target/i386/sse4_1-blendpd.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c: New. + * testsuite/gcc.target/i386/sse4_1-roundpd-2.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxwq.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpgtq.c: New. + * testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c: New. + * testsuite/gcc.target/i386/sse4_2-crc32b.c: New. + * testsuite/gcc.target/i386/sse4_1-pextrq.c: New. + * testsuite/gcc.target/i386/sse4_1-dppd-2.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxbq.c: New. + * testsuite/gcc.target/i386/sse4_1-pextrw.c: New. + * testsuite/gcc.target/i386/sse4_1-movntdqa.c: New. + * testsuite/gcc.target/i386/sse4_1-roundps-2.c: New. + * testsuite/gcc.target/i386/sse4_2-crc32l.c: New. + * testsuite/gcc.target/i386/sse4_1-pmovzxbw.c: New. + * testsuite/gcc.target/i386/sse4_1-pmulld.c: New. + * testsuite/gcc.target/i386/sse4_1-blendvpd.c: New. + +2008-03-05 Josh Conner + + Radar 5603763 + * config/darwin.h (GEN_SUFFIXED_NAME_FOR_SYMBOL): New macro... + (GEN_LAZY_PTR_NAME_FOR_SYMBOL): ...use it. + * config/arm/arm.c (machopic_output_stub): Generate stub lazy + ptr label using GEN_SUFFIXED_NAME_FOR_SYMBOL instead of simple + concatenation. + +2008-03-04 Josh Conner + + Radar 5603792 + * config/arm/arm.c (arm_darwin_encode_section_info): New + function... + (TARGET_ENCODE_SECTION_INFO): ...use for TARGET_MACHO. + (arm_encode_section_info): Remove TARGET_MACHO-specific bits. + +2008-03-03 Jim Grosbach + + Radar 5316398 + * config/arm/t-darwin (LIB2FUNCS_EXTRA, LIB2FUNCS_EXCLUDE): + Override libgcc functions for double/single float to DI + conversion with arm specific versions. + * config/arm/_fixdfdi.c: New file. ARM specific __fixdfdi() + * config/arm/_fixunsdfdi.c: New file. ARM specific __fixunsdfdi() + * config/arm/_fixsfdi.c: New file. ARM specific __fixsfdi() + * config/arm/_fixunssfdi.c: New file. ARM specific __fixunssfdi() + +2008-03-03 Josh Conner + + Radar 5757769 + * config/arm/arm.c (arm_dbx_register_number): Start VFP + debug register numbering from 256. + +2008-02-29 Josh Conner + + Radar 5730079 + * config/i386/darwin.c (DARWIN_ALLOWED_VERSION_TYPES): New + macro. + * config/rs6000/darwin.h (CC1_SPEC): Generate an error for + -maspen-version-min. + (DARWIN_ALLOWED_VERSION_TYPES): New macro. + * config/darwin.h: Change DARWIN_VERSION from enums to + bitfield macros. + (darwin_default_min_version): Add allowable types parameter. + * config/arm/darwin.c (CC1_SPEC): Generate an error for + -mmacosx-version-min. + (DARWIN_ALLOWED_VERSION_TYPES): New macro. + * config/darwin-driver.c (darwin_default_min_version): Add + allowable_vers_types parameter and logic to handle it. Rename + vers_type parameter to default_vers_type. + +2008-02-26 Caroline Tice + + Radar 5743691 + * dwarf2out.c (DW_ISA_*): New defines. + (dwarf_attr_name): Recognize DW_AT_APPLE_isa. + (gen_subprogram_die): For ARM, emit DW_AT_APPLE_isa. + * dwarf2.h (enum dwarf_attribute): Add DW_AT_APPLE_isa. + +2008-02-21 Caroline Tice + + Radar 5741070 + * objc/objc-act.c (objc_finish_message_expr): Find + the record-type tree from the class interface, and mark the record + type as used, for emitting debug info. + * cp/cp-objcp-common.c (c_return_interface_record_type): New function. + * cp/cp-tree.h (c_return_interface_record_type): New extern function + declaration. + * c-tree.h (c_return_interface_record_type): Likewise + * c-decl.c (c_return_interface_record_type): New function. + +2008-02-18 Jim Grosbach + Radar 5752613 + * fold-const.c (fold_inf_compare): equality comparisons to + infinity are not equivalent to relatives comparison to DBL_MAX + due to, e.g., different treatment of the "invalid" flag. Remove the + conversions which make those transformations. + +2008-02-19 Caroline Tice + + Radar 2338865 + * dwarf2out.c (options.h): New include statement. + (dwarf_attr_name): Add cases for DW_AT_APPLE_flags and + DW_AT_APPLE_optimized. + (gen_subprogram_die): Add DW_AT_APPLE_optimized to subprogram die if + optimization level for the subroutine is greater than zero. + (dwarf2out_finish): Add DW_AT_APPLE_optimized to the comp unit die if + the optimization level is greater than zero. + * dwarf2.h (DW_AT_APPLE_optimized): Add new Apple attribute. + +2008-02-08 Josh Conner + + Radar 5681645 + Radar 5717692 + * config.gcc: Move t-slibgcc-darwin from *-*-darwin* into + i[34567]86-*-darwin*, powerpc-*-darwin*, and + powerpc64-*-darwin*. Add t-libgcc-aspen to arm*-*-darwin*. + * config/i386/darwin.h (DARWIN_ASPEN_LIBGCC_SPEC): New macro. + * config/rs6000/darwin.h (DARWIN_ASPEN_LIBGCC_SPEC): New macro. + * config/darwin.h (REAL_LIBGCC_SPEC): If -maspen-version-min is + seen, use darwin_aspen_libgcc spec. + (DARWIN_EXTRA_SPECS): Add darwin_aspen_libgcc. + * config/arm/t-darwin (SHLIB_VERPFX): Remove. + * config/arm/t-slibgcc-aspen: New file. + * config/arm/darwin.h (DARWIN_ASPEN_LIBGCC_SPEC): New macro. + * config/arm/libgcc-aspen.ver: New file. + * config/arm/darwin-libgcc.10.4.ver: Remove file. + * config/arm/darwin-libgcc.10.5.ver: Remove file. + +2008-02-06 Josh Conner + + Radar 5723857 + * config/arm/t-darwin: No longer create multilibs. Add + -march=armv6k to the library build options. + +2008-02-06 Josh Conner + + Radar 5726269 + * config/arm/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Don't set + flag_objc_abi or flag_objc_legacy_dispatch here. + (OBJC_TARGET_FLAG_OBJC_ABI): New macro. + +2008-02-06 Hui-May Chang + + Radar 5103201 + * config/i386/mmx.md (mov_internal_rex64, + mov_internal) : Resolved the conflict between mainline + and the patch for radar 4043818. + +2008-02-04 Josh Conner + + Radar 5717579 + * config/arm/arm.c (arm_encode_section_info): On darwin, invoke + arm_encode_call_attribute even if !first. + +2008-01-30 Josh Conner + + Radar 5683689 + * config/darwin-c.c (iphone_version_as_macro): Rename to... + (aspen_version_as_macro): ...this. Also, replace all iphone + references with aspen. + (darwin_cpp_builtins): Likewise. + * config/darwin.opt (miphone-version-min): Rename to... + (maspen-version-min): ...this. Also, replace all iphone + references with aspen. + * config/i386/darwin.h (CC1_SPEC): Replace all iphone references + with aspen. + (SUBTARGET_OVERRIDE_OPTIONS): Likewise. + (TARGET_DWARF_UNINIT_VARS): Likewise. + * config/rs6000/darwin.h (C_COMMON_OVERRIDE_OPTIONS): Likewise. + (CC1_SPEC): Likewise. + (HAVE_OFFS_MSGSEND_FAST): Likewise. + (TARGET_C99_FUNCTIONS): Likewise. + (TARGET_DWARF_UNINIT_VARS): Likewise. + * config/rs6000/rs6000.c (darwin_rs6000_override_options): + Likewise. + * config/darwin.h (enum darwin_version_type): Likewise. + (SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise. + (LINK_SPEC): Likewise. + (REAL_LIBGCC_SPEC): Likewise. + (DARWIN_DYLIB1_SPEC): Likewise. + (DARWIN_CRT1_SPEC): Likewise. + (OBJC_FLAG_OBJC_ABI): Likewise. + * config/arm/darwin.h (CC1_SPEC): Likewise. + (DARWIN_CC1_MINVERSION_SPEC): Likewise. + (DARWIN_LD_MINVERSION_SPEC): Likewise. + (DARWIN_DEFAULT_VERSION_TYPE): Likewise. + (SUBTARGET_OVERRIDE_OPTIONS): Likewise. + * config/darwin-driver.c (darwin_default_min_version): Likewise. + +2008-01-30 Josh Conner + + Radar 5713583 + * config/darwin.h (REAL_LIBGCC_SPEC): When -maspen-version-min + is seen, also pass -lgcc. + +2008-01-30 Josh Conner + + Radar 5482675 + * config/arm/arm.md (define_expand "call"): Test for longcall + before calling machopic_indirect_call_target. + (define_expand "call_value"): Likewise. + +2008-01-30 Hui-May Chang + + Radar 5103201 + Backport from mainline: + 2007-06-05 H.J. Lu + 2007-02-06 Richard Henderson + * config/i386/mmx.md (mov_internal_rex64, + mov_internal, movv2sf_internal_rex64, movv2sf_internal, + vec_extractv2si_1): Change Y constraints to Yt. + +2008-01-25 Josh Conner + + Radar 5660282 + * config/darwin.h (OBJC_FLAG_OBJC_ABI): Warn and ignore + flag_objc_gc and flag_objc_gc_only if darwin_iphone_version_min + is set. + +2008-01-23 Hui-May Chang + + Radar 5618945 + * config/i386/emmintrin.h : Replace "static __inline" by "__liline" + if __GNUC_STDC_INLINE__ is defined. + * config/i386/pmmintrin.h : Likewise. + * config/i386/tmmintrin.h : Likewise. + * config/i386/xmmintrin.h : Likewise. + * config/i386/mmintrin.h : Likewise. + +2008-01-22 Josh Conner + + Radar 5683689 + * config/darwin-c.c (version_as_macro): Renamed to... + (macosx_version_as_macro): ...this. + (iphone_version_as_macro): New function. + (darwin_cpp_builtins): Define + __ENVIRONMENT_IPHONE_VERSION_MIN_REQUIRED__, as needed. + * config/darwin.opt (mmacosx-version-min): Initialize to + NULL. + (miphone-version-min): New option. + * config/i386/darwin.h (CC1_SPEC): Use darwin_cc1_minversion + if -miphone-version-min and -mmacosx-version-min not seen. + (DARWIN_CC1_MINVERSION_SPEC): New define. + (DARWIN_LD_MINVERSION_SPEC): New define. + (DARWIN_DEFAULT_VERSION_TYPE): New define. + (SUBTARGET_OVERRIDE_OPTIONS): Set darwin_macosx_version_min, + if needed. + (TARGET_DWARF_UNINIT_VARS): Check darwin_iphone_version_min. + * config/rs6000/darwin.h (C_COMMON_OVERRIDE_OPTIONS): Don't + clear flag_use_cxa_get_exception_ptr if + darwin_iphone_version_min is set. + (CC1_SPEC): Use darwin_cc1_minversion if -miphone-version-min + and -mmacosx-version-min not seen. + (DARWIN_CRT2_SPEC): Verify that -mmacosx-version-min is set + before using it. + (DARWIN_CC1_MINVERSION_SPEC): New define. + (DARWIN_LD_MINVERSION_SPEC): New define. + (DARWIN_DEFAULT_VERSION_TYPE): New define. + (HAVE_OFFS_MSGSEND_FAST): Set if darwin_iphone_version_min is + set. + (TARGET_C99_FUNCTIONS): Likewise. + (TARGET_DWARF_UNINIT_VARS): Likewise. + * config/rs6000/rs6000.c (darwin_rs6000_override_options): + Set darwin_macosx_version_min, if needed. Set + darwin_constant_cfstrings, but not altivec target_flags, if + darwin_iphone_version_min is set. + * config/darwin.c (darwin_override_options): Verify that + darwin_macosx_version_min is set before using it. + * config/darwin.h (enum darwin_version_type): New type. + (SUBSUBTARGET_OVERRIDE_OPTIONS): Err if both + darwin_macosx_version_min and darwin_iphone_version_min are + set. + (LINK_SPEC): Use darwin_ld_minversion as default. Pass + -iphone_version_min to linker, if -miphone-version-min was + given. + (REAL_LIBGCC_SPEC): Use -lgcc_s.10.5 if -miphone-version-min + was seen. + (DARWIN_EXTRA_SPECS): Add darwin_cc1_minversion and + darwin_ld_minversion. + (DARWIN_DYLIB1_SPEC): Use dylib1.10.5.o if -miphone-version-min + was given. + (DARWIN_CRT1_SPEC): Use crt1.10.5.o if -miphone-version-min was + given. + (OBJC_FLAG_ZEROCOST_EXCEPTIONS): Verify that + darwin_macosx_version_min is set before using it. + (OBJC_WARN_OBJC2_FEATURES): Only perform this check if + darwin_macosx_version_min is set. + (darwin_default_min_version): Add parameter to prototype. + (GCC_DRIVER_HOST_INITIALIZATION): Add new parameter to + darwin_default_min_version call. + * config/arm/darwin.h (CC1_SPEC): Use darwin_cc1_minversion if + -miphone-version-min and -mmacosx-version-min not seen. + (DARWIN_MINVERSION_SPEC): Change to "1.2". + (DARWIN_CC1_MINVERSION_SPEC): New define. + (DARWIN_LD_MINVERSION_SPEC): New define. + (DARWIN_DEFAULT_VERSION_TYPE): New define. + (SUBTARGET_OVERRIDE_OPTIONS): Set darwin_iphone_version_min, + if needed. + * config/darwin-driver.c (darwin_default_min_version): Add new + parameter, vers_type, and logic to handle it. Change size of + new_flag. Don't use default if any of the *-version-min options + were given. Check for IPHONE_DEPLOYMENT_TARGET environment + variable. + +2008-01-11 Caroline Tice + + Radar 5636185 + * dwarf2out.c (contained_in_subroutine): New function. + (add_sibling_attributes): Add code to test for & remove + DW_AT_MIPS_linkage_name, if appropriate. + (assembler_name_exists_and_is_different): New function. + (add_src_coords_attributes): Modify test condition for adding + DW_AT_MIPS_linkage_name attribute: Change TREE_PUBLIC to + TREE_PUBLIC || TREE_STATIC || DECL_EXTERNAL, and replace + DECL_ASSEMBLER_NAME test with call to + assembler_name_exists_and_is_different. + +2008-01-10 Josh Conner + + Radar 5680184 + * c.opt (fobjc-legacy-dispatch): New option. + * config/darwin.h (OBJC_FLAG_OBJC_ABI): Specify a default + for flag_objc_legacy_dispatch. + * config/arm/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): + Specify a default for flag_objc_abi and + flag_objc_legacy_dispatch. + +2008-01-09 Josh Conner + + Radar 5256615 + * doc/invoke.texi: Document -Xarch_* option. + +2008-01-08 Hui-May Chang + + Radar 5596043 & 5645144 + * cse.c (cse_insn) : Ignore the asm source operand of an + inline assembly instruction when finding all the SETs in the + instruction and invalidate its target. + +2007-12-21 Josh Conner + + Radar 5651192 + * config/arm/arm.md (adjustable_thumb_movdi_insn): Fix + pool_range. + (thumb_movdf_insn): Likewise. + +2007-12-19 Caroline Tice + + Radar 5645155 + * dwarf2out.c (dwarf2out.c): Add call to maybe_emit_file, to + make sure current compilation unit filename is added to + line table info. + * testsuite/gcc.apple/dwarf-files.c: New testcase. + +2007-12-18 Stuart Hastings + + Radar 5562718 + * tree-vrp.c (value_inside_range): Return can't-tell if cmp1 + or cmp2 is not a bool constant. (range_includes_zero_p): + Handle can't-tell case. + * testsuite/g++.apple/R5562718.C: New. + +2007-12-18 Josh Conner + + Radar 5622318 (continued) + * config/arm/darwin-libgcc.10.5.ver: Remove aeabi functions. + +2007-12-18 Josh Conner + + Radar 5622318 + * config/arm/ieee754-df.S (muldf3vfp, adddf3vfp, subdf3vfp, + divdf3vfp, eqdf2vfp, nedf2vfp, ltdf2vfp, ledf2vfp, gtdf2vfp, + gedf2vfp, unorddf2vfp, fixdfsivfp, fixunsdfsivfp, + extendsfdf2vfp, truncdfsf2vfp, floatsidfvfp, floatunssidfvfp): + New functions. + * config/arm/ieee754-sf.S (mulsf3vfp, addsf3vfp, subsf3vfp, + divsf3vfp, eqsf2vfp, nesf2vfp, ltsf2vfp, lesf2vfp, gtsf2vfp, + gesf2vfp, unordsf2vfp, fixsfsivfp, fixunssfsivfp, + floatsisfvfp, floatunssisfvfp): New functions. + * config/arm/t-darwin (LIB1ASMFUNCS): Add all of the above. + * config/arm/arm.c (arm_init_libfuncs): Set up optabs to call + the above in Thumb, non-soft-float, non-static mode. + (indirect_sibreturn_reg): New function. + (indirect_sibreturn_mem): New function. + (use_return_insn): Add support for indirect sibcalls. + (arm_function_ok_for_sibcall): Allow indirect sibcalls. + (arm_legitimize_address): Improve code for addresses including + large constants, or including stack address + constant. + (arm_rtx_costs_1): Allow an extra cycle for shifted operands + in arithmetic instructions (leading to better decisions + about expanding multiplies). + (arm_cannot_copy_p): Recognize MEM(UNSPEC_PIC_BASE) within a + set insn. + (arm_gen_movmemqi): Choose smallest alternative at -Os. + (arm_expand_prologue): Use extra register saves instead of a + subtract from SP when possible at -Os. + (arm_output_epilogue): Likewise. Handle indirect sibcalls + that use a callee-saved reg. + * config/arm/arm.h (FUNCTION_BOUNDARY): Allow halfword alignment + for thumb functions, when possible. + (LOCAL_ALIGNMENT): New definition. + * config/arm/darwin.h (FLOAT_LIB_COMPARE_RETURNS_BOOL): New. + * config/arm/lib1funcs.asm (ARM_FUNC_START): Mandate word- + alignment of all ARM functions. + * config/arm/arm.md (define_peephole2, line 583): New peephole. + (define_peephole2, line 6110): New peephole. + (arm_pic_ldrsi): New define_insn. + (arm_pic_strsi): New define_insn. + (sibcall_insn): Add support for indirect sibcalls. + (sibcall_value_insn): Likewise. + (movmemqi): Choose smallest alternative at -Os (Thumb variant). + * config/arm/darwin-libgcc.10.5.ver: Update for Leopard. + +2007-12-16 Hui-May Chang + + Radar 5645144 + * cse.c (cse_insn) : Undo the patch of 5596043 for the ld64 failure + found in SWB. + +2007-12-14 Josh Conner + + Radar 5635246 + * final.c (calculate_alignments): New function. + (shorten_branches): Move calculations of uid_align into + calculate_alignments. Invoke when alignments change. + +2007-12-12 Josh Conner + + Radar 5643197 + * config/rs6000/rs6000.c (rs6000_vector_alignment_reachable): + Implement TARGET_MACHO+TARGET_64BIT logic. + +2007-12-11 Eric Christopher + + Radar 5582941 + * config/i386/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Use correct + bitmask for default setting variables. + +2007-12-11 Josh Conner + + Radar 5569774 + + Backport from FSF 4.2: + 2007-07-25 Dorit Nuzman + Devang Patel + PR tree-optimization/25413 + * targhooks.c (default_builtin_vector_alignment_reachable): New. + * targhooks.h (default_builtin_vector_alignment_reachable): New. + * tree.h (contains_packed_reference): New. + * expr.c (contains_packed_reference): New. + * tree-vect-analyze.c (vector_alignment_reachable_p): New. + (vect_enhance_data_refs_alignment): Call + vector_alignment_reachable_p. + * target.h (vector_alignment_reachable): New builtin. + * target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New. + * config/rs6000/rs6000.c (rs6000_vector_alignment_reachable): + New. + (TARGET_VECTOR_ALIGNMENT_REACHABLE): Define. + + Revert the following: + 2005-12-07 Devang Patel + Radar 4333194 + * tree-vect-analyze.c (vect_compute_data_ref_alignment): Check + misalignment where natural alignment is not reachable using loop + peeling. + +2007-12-05 Stuart Hastings + + Radar 5591571 + * config/i386/i386.c (override_options): Disable instruction scheduler. + * doc/invoke.texi (-fschedule-insns, -fschedule-insns2): Disabled for x86. + +2007-12-05 Hui-May Chang + + Radar 5596043 + * cse.c (cse_insn) : Ignore the asm source operand of an + inline assembly instruction when finding all the SETs in the + instruction and invalidate its target memory reference. + +2007-12-03 Caroline Tice + + Radar 5619139 + * dwarf2out.c (gen_typedef_die): Don't add typedef to + pubtypes table unless renamed type is fully defined in + current file. + +2007-11-30 Hui-May Chang + + Radar 5596043 + * cse.c (cse_insn) : Ignore the asm source operand of an + inline assembly instruction when finding all the SETs in the + instruction. + +2007-11-29 Hui-May Chang + + Radar 5612779 + * fold-const.c (extract_muldiv_1) : Do not move a negative + constant from an ABS_EXPR. + +2007-11-28 Josh Conner + + Radar 5594980 + * defaults.h (TARGET_EXTRA_CASES): New definition. + * final.c (compute_alignments): Always compute alignments if + TARGET_EXACT_SIZE_CALCULATIONS is defined. + (shorten_branches): Figure out asms_present and disallow + CASE_VECTOR_SHORTEN_MODE shortening if true. Account for + prologue size if TARGET_UNEXPANDED_PROLOGUE_SIZE is defined. + Invoke ADJUST_INSN_LENGTH for switch tables. Give table + label the same alignment as the table if + TARGET_ALIGN_ADDR_DIFF_VEC_LABEL is defined. + * function.c (struct function): Add needs_4byte_alignment + field. + * config/arm/t-darwin (LIB1ASMFUNCS): Add _switchu8, _switch8, + _switch16, and _switch32. + * config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Set for both + ARM and Thumb. + * config/arm/arm.c (thumb_exit): Rename handle_thumb_exit, + rewrite to count bytes as well as emit code. + (thumb_pushpop): Rename handle_thumb_pushpop, rewrite + similarly. + (thumb_unexpanded_epilogue): Rename + handle_thumb_unexpanded_epilogue, rewrite similarly. + (thumb_output_function_prologue): Rename + handle_thumb_unexpanded_prologue, rewrite similarly. + (switch8_libfunc, switchu8_libfunc, switch16_libfunc, + switch32_libfunc, register_switch8_libfunc, + register_switchu8_libfunc, register_switch16_libfunc, + register_switch32_libfunc, arm_adjust_insn_length, + count_thumb_unexpanded_prologue, arm_label_align): New + functions. + (arm_reorg): Initialize address with + count_thumb_unexpanded_prologue. + (thumb_load_double_from_address): Disallow *[reg+reg] + addressing. + * config/arm/lib1funcs.asm: Add switchu8, switch8, switch16, and + switch32 functions. + * config/arm/arm.h (CASE_VECTOR_PC_RELATIVE, + CASE_VECTOR_SHORTEN_MODE, ASM_OUTPUT_ADDR_DIFF_VEC, + ASM_OUTPUT_ADDR_VEC, ADJUST_INSN_LENGTH, LABEL_ALIGN, + TARGET_EXTRA_CASES, TARGET_EXACT_SIZE_CALCULATIONS, + TARGET_UNEXPANDED_PROLOGUE_SIZE, + TARGET_ALIGN_ADDR_DIFF_VEC_LABEL): New definitions. + * config/arm/arm-protos.h (arm_adjust_insn_length, + register_switch8_libfunc, register_switchu8_libfunc, + register_switch16_libfunc, register_switch32_libfunc, + count_thumb_unexpanded_prologue, arm_label_align): New protos. + * config/arm/predicates.md (thumb_low_register_operand): + New predicate. + * config/arm/arm.md (VUNSPEC_POOL_STRING): New VUNSPEC. + (*thumb_zero_extendhisi2): Rename + adjustable_thumb_zero_extendhisi2. + (*thumb_zero_extendhisi2_v6): Rename + adjustable_thumb_zero_extendhisi2_v6. + (*thumb_extendhisi2_insn_v6): Rename + adjustable_thumb_extendhisi2_insn_v6. + (*thumb_extendqisi2): Rename adjustable_thumb_extendqisi2. + (*thumb_extendqisi2_v6): Rename + adjustable_thumb_extendqisi2_v6. Fix typo. + (*thumb_movdi_insn): Rename + adjustable_thumb_movdi_insn. Fix length. + (*pic_load_addr_based_insn): Fix length. + (*thumb_movhi_insn): Rename adjustable_thumb_movhi_insn. + (*thumb_movdf_insn): Fix length. + (*ldmsi_postinc4_thumb): Fix length. + (*stmsi_postinc4_thumb): Fix length. + (casesi): Add TARGET_THUMB support. + (thumb_casesi_internal): New define_insn. + (align_4): Fix length. + (align_8): Fix length. + (consttable_end): Fix length. + (prologue_use): Fix length. + * stmt.c (expand_case): Allow for ADDR_DIFF_VEC being + handled by ASM_OUTPUT_ADDR_DIFF_VEC. Add TARGET_EXTRA_CASES at + the end of the table as needed. + +2007-11-28 Hui-May Chang + + Radar 5591491 + * tree-sra.c (generate_element_zero) : Built a zero expression + when the decision is an integer copy. + +2007-11-14 Josh Conner + + Radar 5595814 + * config/arm/arm.c (symbol_mentioned_with_filter): Recurse + through symbol_mentioned_with_filter, not symbol_mentioned_p. + +2007-11-14 Josh Conner + + Radar 5597292 + * dbxout.c (dbxout_type_xref): For a TYPE_DECL, also check if + DECL_NAME(TYPE_NAME) is NULL. + +2007-11-14 Josh Conner + + Radar 5595749 + * dwarf2out.c (frame_pointer_fb_offset_from): New variable... + (based_loc_descr): ...use it... + (compute_frame_pointer_to_fb_displacement): ...set it. + * var-tracking.c (find_src_status): Add COND_EXEC handling. + (find_src_set_src): Likewise. + +2007-11-13 Hui-May Chang + + Radar 4877693 + * config/i386/i386.c (ix86_internal_arg_pointer) : Emit an error + message when -mstackrealign -m64 options were specified. + +2007-11-13 Josh Conner + + Radar 5595934 + * config/arm/arm.md (pic_load_addr_thumb): Change pool_range + to 1022. + +2007-11-09 Eric Christopher + + Radar 5582941 + * config/i386/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Add + cpu features that don't have masks if we haven't specified an + arch. + * config/i386/i386.h: Make above variables non-const. + * config/i386/i386.c: Ditto. Fix cmpxchg16b definition. + +2007-11-09 Eric Christopher + + * c-common.c (iasm_stmt): Replace use of MACHO_DYNAMIC_NO_PIC_P + with !flag_pic. + +2007-11-08 Josh Conner + + Radar 5589109 + * gcc/config/arm/darwin-libgcc.10.4.ver (adddf3, extendsfdf2, + floatdidf, floatsidf, subdf3): Remove. + 2007-11-07 Josh Conner Radar 5581683 @@ -409,11 +2802,11 @@ 2007-09-04 Hui-May Chang Radar 5155743 * target.h (have_dynamic_stack_space): New. - * target-def.h (TARGET_HAVE_DYNAMIC_STACK_SPACE) : New. - * explow.c (allocate_dynamic_stack_space) : Reserve space - for outgoing args and registers saved area if - DYNAMIC_STACK_OFFSET is defined. - * rs6000.c (TARGET_HAVE_DYNAMIC_STACK_SPACE): New. + * target-def.h (TARGET_HAVE_DYNAMIC_STACK_SPACE) : New. + * explow.c (allocate_dynamic_stack_space) : Reserve space + for outgoing args and registers saved area if + DYNAMIC_STACK_OFFSET is defined. + * rs6000.c (TARGET_HAVE_DYNAMIC_STACK_SPACE): New. 2007-08-23 Hui-May Chang @@ -434,7 +2827,7 @@ 2007-08-22 Fariborz Jahanian - Radar 4947311 + Radar 4947311 * c-common.h (objc_declare_protocols, objc_start_protocol): Decl changed. * stub-objc.c (objc_declare_protocols, objc_start_protocol): Changed. * c-parser.c (c_parser_external_declaration): Call to @@ -458,13 +2851,13 @@ 2007-08-20 Hui-May Chang - Radar 4708086 - * passes.c (rest_of_compilation): Removed after confirming the + Radar 4708086 + * passes.c (rest_of_compilation): Removed after confirming the patch to radar 4548482 is no longer needed in gcc 4.2. 2007-08-20 Fariborz Jahanian - Radar 5422751 + Radar 5422751 * c-common.h (objc_protocol_implementation): decl removed. * stub-objc.c (objc_protocol_implementation): stub removed. * c-parser.c (c_parser_objc_class_definition): Misplaced syntax @@ -472,10 +2865,10 @@ 2007-08-17 Hui-May Chang - Radar 5134231 - * gcc/config/rs6000/rs6000.c (rs6000_handle_option): Set - rs6000_alignment_flags to OPTION_MASK_ALIGN_MAC68K instead of - OPTION_ALIGN_MAC68K for -malign-mac68k option. + Radar 5134231 + * gcc/config/rs6000/rs6000.c (rs6000_handle_option): Set + rs6000_alignment_flags to OPTION_MASK_ALIGN_MAC68K instead of + OPTION_ALIGN_MAC68K for -malign-mac68k option. 2007-08-17 Hui-May Chang @@ -497,15 +2890,15 @@ 2007-08-10 Fariborz Jahanian - Radar 5376125 - * doc/invoke.texi (-Wdirect-ivar-access): New option - * c.opt (-Wdirect-ivar-access): New warning + Radar 5376125 + * doc/invoke.texi (-Wdirect-ivar-access): New option + * c.opt (-Wdirect-ivar-access): New warning 2007-08-10 Stuart Hastings Radar 5379188 * config/i386/i386.md (*darwin_cmpstrnqi_nz_1, - *darwin_cmpstrqi_1): Mark destination with earlyclobber. + *darwin_cmpstrqi_1): Mark destination with earlyclobber. 2007-08-10 Stuart Hastings @@ -537,11 +2930,11 @@ 2007-07-17 Stuart Hastings * config/i386.c (ix86_init_mmx_sse_builtins): Delete - twice-merged definition of __builtin_ia32_vec_ext_v16qi. + twice-merged definition of __builtin_ia32_vec_ext_v16qi. 2007-07-13 Fariborz Jahanian - Radar 5277239 + Radar 5277239 * c-parser.c (c_parser_next_token_starts_declspecs): Exclude objc2's property dot-syntax as a declarator. (c_parser_postfix_expression): Convert property dot-syntax on @@ -565,19 +2958,19 @@ 2007-06-29 Stuart Hastings * gcc/cfghooks.c (split_block): One-line APPLE LOCAL needs - begin and end markers. + begin and end markers. * gcc/objc/objc-act.c (objc2_build_indirect_ref_ivar2): Add a - comment to prevent '}' from matching in the wrong place. + comment to prevent '}' from matching in the wrong place. * gcc/testsuite/gcc.dg/invalid-call-1.c: Missing APPLE LOCAL. * gcc/c-common.h (objc_build_weak_reference_tree, - objc_v2_build_ivar_ref, diagnose_selector_cast, - objc_check_format_nsstring): One-line APPLE LOCAL needs - begin and end markers. + objc_v2_build_ivar_ref, diagnose_selector_cast, + objc_check_format_nsstring): One-line APPLE LOCAL needs + begin and end markers. * gcc/stub-objc.c: Remove a blank line to appease checklocals. - (objc_build_weak_reference_type): Move an APPLE LOCAL from - here... (objc_weak_reference_expr): ...to here. + (objc_build_weak_reference_type): Move an APPLE LOCAL from + here... (objc_weak_reference_expr): ...to here. * gcc/loop-doloop.c (doloop_valid_p): Remove a blank line to - appease checklocals. + appease checklocals. * gcc/predict.c (predict_loops): Likewise. * gcc/tree-flow.c: Likewise. * gcc/tree-ssa-loop-niter.c: Likewise. @@ -608,17 +3001,17 @@ 2007-06-29 Fariborz Jahanian - Radar 5276085 - * c-parser.c (c_parser_binary_expression) : objc_generate_weak_read + Radar 5276085 + * c-parser.c (c_parser_binary_expression) : objc_generate_weak_read replaced with call to objc_build_weak_reference_tree - * c-typeck.c (build_modify_expr, c_objc_common_truthvalue_conversion): + * c-typeck.c (build_modify_expr, c_objc_common_truthvalue_conversion): objc_remove_weak_read replaced with call to objc_weak_reference_expr. - * c-common.h (objc_weak_reference_expr, - objc_build_weak_reference_tree) : New decl. - (objc_generate_weak_read, objc_remove_weak_read): remove. - * stub-objc.c (objc_weak_reference_expr, - objc_build_weak_reference_tree): New stub. - (objc_generate_weak_read, objc_remove_weak_read): remove. + * c-common.h (objc_weak_reference_expr, + objc_build_weak_reference_tree) : New decl. + (objc_generate_weak_read, objc_remove_weak_read): remove. + * stub-objc.c (objc_weak_reference_expr, + objc_build_weak_reference_tree): New stub. + (objc_generate_weak_read, objc_remove_weak_read): remove. 2007-06-28 Geoffrey Keating @@ -672,8 +3065,8 @@ 2007-06-22 Eric Christopher - Radar 5289384 - * config/i386/darwin.h: Remove duplicate apple local code. + Radar 5289384 + * config/i386/darwin.h: Remove duplicate apple local code. 2007-06-22 Geoffrey Keating @@ -730,30 +3123,30 @@ Radar 5150147 * gcc/tree-ssa-loop-niter.c (unmark_surely_finite_loop, - mark_maybe_infinite_loops): Remove. + mark_maybe_infinite_loops): Remove. * gcc/tree-pass.h (pass_mark_maybe_inf_loops): Remove. * gcc/builtins.c (BUILT_IN_MAYBE_INFINITE_LOOP): Remove. * gcc/cfghooks.c (split_block, make_forwarder_block): Remove - APPLE LOCAL LNO code. + APPLE LOCAL LNO code. * gcc/toplev.c (lang_dependent_init): Remove APPLE LOCAL LNO - code. + code. * gcc/builtins.def (BUILT_IN_MAYBE_INFINITE_LOOP): Remove. * gcc/opts.c (set_flags_from_O): Remove APPLE LOCAL LNO code. * gcc/tree-ssa-loop.c (tree_mark_maybe_inf_loops, - gate_tree_mark_maybe_inf_loops, pass_mark_maybe_inf_loops): - Remove. + gate_tree_mark_maybe_inf_loops, pass_mark_maybe_inf_loops): + Remove. * gcc/predict.c (predict_loops): Remove APPLE LOCAL LNO code. * gcc/loop-doloop.c (doloop_valid_p): Remove APPLE LOCAL LNO - comment. + comment. * gcc/cfgloop.c (flow_loops_find): Remove APPLE LOCAL LNO - code. + code. * gcc/tree-flow.h (mark_maybe_inf_loops): Remove. * gcc/tree-cfg.c (tree_redirect_edge_and_branch): Remove APPLE - LOCAL LNO code. + LOCAL LNO code. * gcc/passes.c (init_optimization_passes): Remove reference to - pass_mark_maybe_inf_loops. + pass_mark_maybe_inf_loops. * gcc/cfgrtl.c (purge_dead_edges): Remove APPLE LOCAL LNO - code. + code. 2007-06-16 Hui-May Chang @@ -771,7 +3164,7 @@ 2007-06-06 Fariborz Jahanian - Radar 5250860 (Remove old property) + Radar 5250860 (Remove old property) * config/darwin-c.c (darwin_cpp_builtins): Define OBJC_NEW_PROPERTIES unconditionally. * c-common.h: Remove enums and macros which defined @@ -799,7 +3192,7 @@ 2007-05-31 Fariborz Jahanian - Radar 5172645 + Radar 5172645 * c.opt (Wproperty-assign-default): New warning option. * doc/invoke.texi: Document -Wproperty-assign-default @@ -813,7 +3206,7 @@ 2007-05-23 Fariborz Jahanian - Radar 5195402 + Radar 5195402 * c-format.c (handle_format_arg_attribute): Check for NSString * and CFStringRef as valid formatting types. (check_format_string): Ditto. @@ -828,20 +3221,20 @@ 2007-05-17 Eric Christopher - Radar 4663646 - * config/rs6000/rs6000.c (rs6000_emit_prologue): If the stack frame - is large then save r12 if we're going to save altivec registers and - use the frame pointer. + Radar 4663646 + * config/rs6000/rs6000.c (rs6000_emit_prologue): If the stack frame + is large then save r12 if we're going to save altivec registers and + use the frame pointer. 2007-05-18 Fariborz Jahanian - Radar 2996215 (twik) - * config/darwin.c (darwin_build_constant_cfstring): Change error to - warning when character is not valid utf-8. + Radar 2996215 (twik) + * config/darwin.c (darwin_build_constant_cfstring): Change error to + warning when character is not valid utf-8. 2007-05-18 Fariborz Jahanian - Radar 5202926 + Radar 5202926 * c-common.h (objc_anonymous_local_objc_name): New decl. * config/darwin-protos.h (objc_anonymous_local_objc_name): Decl. * stub-objc.c (objc_anonymous_local_objc_name): New stub. @@ -850,14 +3243,14 @@ 2007-05-17 Fariborz Jahanian - Radar 2996215 - * c-common.h (objc_create_init_utf16_var): New decl. - * stub-objc.c (objc_create_init_utf16_var): New stub - * config/darwin-c.c (objc_cvt_utf8_utf16): New - * config/darwin-protos.h (objc_create_init_utf16_var): New decl. - (objc_cvt_utf8_utf16): New decl. - * config/darwin.c (darwin_build_constant_cfstring): Add support for - native char-set to UTF-16. + Radar 2996215 + * c-common.h (objc_create_init_utf16_var): New decl. + * stub-objc.c (objc_create_init_utf16_var): New stub + * config/darwin-c.c (objc_cvt_utf8_utf16): New + * config/darwin-protos.h (objc_create_init_utf16_var): New decl. + (objc_cvt_utf8_utf16): New decl. + * config/darwin.c (darwin_build_constant_cfstring): Add support for + native char-set to UTF-16. 2007-05-09 Caroline Tice @@ -947,7 +3340,7 @@ 2007-05-07 Fariborz Jahanian - Radar 4157812 + Radar 4157812 * c-common.h (objc_build_keyword_decl): Takes a new argument. * stub-objc.c (objc_build_keyword_decl): Ditto. * c-parser.c (c_parser_objc_method_decl): Recognize optional @@ -968,9 +3361,9 @@ 2007-05-02 Fariborz Jahanian - Radar 4502186 - * c-typeck.c (convert_for_assignment): Remove synthesized 'volatile' - type before doing type comparison. + Radar 4502186 + * c-typeck.c (convert_for_assignment): Remove synthesized 'volatile' + type before doing type comparison. 2007-04-25 Hui-May Chang @@ -1003,7 +3396,7 @@ 2007-04-20 Fariborz Jahanian - Radar 5130983 + Radar 5130983 * c-common.h (enum lvalue_use): New enumerator lv_foreach added. * c-common.c (lvalue_error): Diagnose on lv_foreach. @@ -1015,44 +3408,44 @@ 2007-04-13 Fariborz Jahanian - Radar 4899595 - * c.opt (-fobjc-new-property) on by default. - * config/darwin-c.c (darwin_cpp_builtins): Define OBJC_NEW_PROPERTIES - when new property flag is on. + Radar 4899595 + * c.opt (-fobjc-new-property) on by default. + * config/darwin-c.c (darwin_cpp_builtins): Define OBJC_NEW_PROPERTIES + when new property flag is on. 2007-03-12 Fariborz Jahanian - Radar 5023725 - * c-opts.c: Remove flag_objc_zerocost_exceptions check. - * config/darwin.h - (OBJC_FLAG_ZEROCOST_EXCEPTIONS): New macro to issue diagnostic. - (OBJC_FLAG_OBJC_ABI): Set -fobjc-zerocost-exceptions as - default for objc2 abi. - * config/darwin-c.c (darwin_cpp_builtins): Define OBJC_ZEROCOST_EXCEPTIONS - when zero-cost exception flag is on. + Radar 5023725 + * c-opts.c: Remove flag_objc_zerocost_exceptions check. + * config/darwin.h + (OBJC_FLAG_ZEROCOST_EXCEPTIONS): New macro to issue diagnostic. + (OBJC_FLAG_OBJC_ABI): Set -fobjc-zerocost-exceptions as + default for objc2 abi. + * config/darwin-c.c (darwin_cpp_builtins): Define OBJC_ZEROCOST_EXCEPTIONS + when zero-cost exception flag is on. 2007-04-10 Fariborz Jahanian - Fix bootstrap problem caused by radar 5096648. - * c-format.c (tm_p.h): Include it. - * config/darwin-protos.h: (objc_check_format_cfstring): Add decl. + Fix bootstrap problem caused by radar 5096648. + * c-format.c (tm_p.h): Include it. + * config/darwin-protos.h: (objc_check_format_cfstring): Add decl. 2007-04-09 Fariborz Jahanian - Radar 5096648 - * c-format.c (tm_p.h): header file include. - (format_type): cfstring_format_type enum added. - (format_kind_info): New entry for CFString format added. - (objc_check_nsformat_arg): Renamed to objc_check_cfformat_arg - and modified. - (check_format_info): Added support for CFString format. - (handle_format_attribute): Ditto. - * c-common.h (objc_NSString_format): decl removed. - * stub-objc.c (objc_NSString_format): def removed. - * config/darwin.h (TARGET_CFSTRING_P): Removed. - (CHECK_FORMAT_CFSTRING, CFSTRING_TYPE_NODE): Added. - * Makefile.in (tmp.h): c-format.o now depends on. - * config/darwin-c.c (objc_check_format_cfstring): New + Radar 5096648 + * c-format.c (tm_p.h): header file include. + (format_type): cfstring_format_type enum added. + (format_kind_info): New entry for CFString format added. + (objc_check_nsformat_arg): Renamed to objc_check_cfformat_arg + and modified. + (check_format_info): Added support for CFString format. + (handle_format_attribute): Ditto. + * c-common.h (objc_NSString_format): decl removed. + * stub-objc.c (objc_NSString_format): def removed. + * config/darwin.h (TARGET_CFSTRING_P): Removed. + (CHECK_FORMAT_CFSTRING, CFSTRING_TYPE_NODE): Added. + * Makefile.in (tmp.h): c-format.o now depends on. + * config/darwin-c.c (objc_check_format_cfstring): New 2007-04-09 Mike Stump @@ -1063,7 +3456,7 @@ 2007-04-06 Fariborz Jahanian - Radar 4792158 + Radar 4792158 * config/darwin.c: (output_objc_section_asm_op): Arrays tomark and tomarkv2 streamlined. darwin_sections initializations streamlined. (machopic_select_section): Switch to objc_v2_constant_string_object_section for objc2's @@ -1079,17 +3472,17 @@ 2007-03-29 Fariborz Jahanian - Radar 4947014 - objc atomic property - * c-common.h (RID_NONATOMIC): Add - * c-parse.c (c_parser_objc_property_attribute) : Recognize 'nonatomic' + Radar 4947014 - objc atomic property + * c-common.h (RID_NONATOMIC): Add + * c-parse.c (c_parser_objc_property_attribute) : Recognize 'nonatomic' as new property. 2007-03-29 Fariborz Jahanian - Radar 4564694 - * c-parse.c (c_parser_objc_class_instance_variables): Add @package + Radar 4564694 + * c-parse.c (c_parser_objc_class_instance_variables): Add @package support to syntax. - * c-common.h (RID_AT_PACKAGE): Add + * c-common.h (RID_AT_PACKAGE): Add 2007-03-06 Mike Stump @@ -1099,51 +3492,51 @@ 2007-03-23 Fariborz Jahanian - Radar 4985544 - * c-format.c (enum format_type): New entry for NSString format. - (format_typ): Has a new entry for NSString format. - (decode_format_attr): Error on use of NSString format on a - non-objective-c program. - (objc_check_nsformat_arg): New. - (check_format_info): Call back for NSString is objc_check_nsformat_arg - (handle_format_attribute): Use objc_check_format_nsstring for - NSString format. - * c-common.h (objc_NSString_format): New decl. - (objc_check_format_nsstring): New decl. - * stub-objc.c (objc_NSString_format, objc_check_format_nsstring): New - stubs. - * config/darwin-protos.h (darwin_cfstring_type_node): New decl. - * config/darwin.c (darwin_cfstring_type_node): New - * config/darwin.h (TARGET_CFSTRING_P): New macro + Radar 4985544 + * c-format.c (enum format_type): New entry for NSString format. + (format_typ): Has a new entry for NSString format. + (decode_format_attr): Error on use of NSString format on a + non-objective-c program. + (objc_check_nsformat_arg): New. + (check_format_info): Call back for NSString is objc_check_nsformat_arg + (handle_format_attribute): Use objc_check_format_nsstring for + NSString format. + * c-common.h (objc_NSString_format): New decl. + (objc_check_format_nsstring): New decl. + * stub-objc.c (objc_NSString_format, objc_check_format_nsstring): New + stubs. + * config/darwin-protos.h (darwin_cfstring_type_node): New decl. + * config/darwin.c (darwin_cfstring_type_node): New + * config/darwin.h (TARGET_CFSTRING_P): New macro 2007-03-22 Fariborz Jahanian - Radar 4965989 - * c-parser.c (c_parser_objc_class_definition): Add supprt for anonymous + Radar 4965989 + * c-parser.c (c_parser_objc_class_definition): Add supprt for anonymous category syntax. 2007-03-22 Fariborz Jahanian - Removed objc2 hybrid abi - * c-parsec (c_parser_struct_or_union_specifier): removed flag_objc_abi == 3. - * config/darwin-c.c: Removed checking for - hybrid abi. - * config/darwin.c: Ditto. - * config/darwin.h: Issue error if use of hybrid abi is - attempted. Removed checking for hybrid abi. + Removed objc2 hybrid abi + * c-parsec (c_parser_struct_or_union_specifier): removed flag_objc_abi == 3. + * config/darwin-c.c: Removed checking for + hybrid abi. + * config/darwin.c: Ditto. + * config/darwin.h: Issue error if use of hybrid abi is + attempted. Removed checking for hybrid abi. 2007-03-21 Fariborz Jahanian - Radar 2848255 + Radar 2848255 * c-parser.c (c_parser_objc_try_catch_statement): Parse @catch(...). - * c.opt: Add -fobjc-zerocost-exceptions option. - * c-opts.c (c_common_post_options): Set the flags for - -fobjc-zerocost-exceptions. - * c-common.h: Add some declarations. - * stub-objc.c (objc2_valid_objc_catch_type, objc2_build_throw_call): - New stubs. - * config/darwin.h (OBJC_FLAG_OBJC_ABI): Check for proper - use of -fobjc-zerocost-exceptions option. + * c.opt: Add -fobjc-zerocost-exceptions option. + * c-opts.c (c_common_post_options): Set the flags for + -fobjc-zerocost-exceptions. + * c-common.h: Add some declarations. + * stub-objc.c (objc2_valid_objc_catch_type, objc2_build_throw_call): + New stubs. + * config/darwin.h (OBJC_FLAG_OBJC_ABI): Check for proper + use of -fobjc-zerocost-exceptions option. 2007-03-21 Stuart Hastings @@ -1158,9 +3551,9 @@ 2007-03-14 Eric Christopher - Radar 5006196 - * cfgexpand.c (expand_used_vars): Do not create a guard - for iasm functions. + Radar 5006196 + * cfgexpand.c (expand_used_vars): Do not create a guard + for iasm functions. 2007-03-14 Hui-May Chang @@ -1203,8 +3596,8 @@ 2007-02-06 Fariborz Jahanian - Radar 4949034 - * c.opt: Update -fobjc-call-cxx-cdtors settings. + Radar 4949034 + * c.opt: Update -fobjc-call-cxx-cdtors settings. 2007-02-05 Hui-May Chang @@ -1225,12 +3618,12 @@ Radar 4134510 * gcc/config/i386/i386.md (cmpstrsi): Prefer libcall for - indefinite or length > 30. + indefinite or length > 30. 2007-01-29 Bill Wendling - * config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): - Removed extra def'n. + * config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): + Removed extra def'n. 2007-01-24 Josh Conner @@ -1264,17 +3657,17 @@ Backport from mainline: 2007-01-17 Eric Christopher - * config.gcc: Support core2 processor. + * config.gcc: Support core2 processor. 2007-01-19 Eric Christopher Backport from mainline: 2007-01-15 Eric Christopher - * config/darwin.h: Update copyright. - (TARGET_OPTION_TRANSLATE_TABLE): Add umbrella. - (LINK_COMMAND_SPEC): Add -u. - (LINK_SPEC): Fix umbrella for above. + * config/darwin.h: Update copyright. + (TARGET_OPTION_TRANSLATE_TABLE): Add umbrella. + (LINK_COMMAND_SPEC): Add -u. + (LINK_SPEC): Fix umbrella for above. 2007-01-19 Eric Christopher @@ -1286,9 +3679,9 @@ Radar 4875159 Backport from mainline: 2007-01-18 Josh Conner - PR target/30485 - * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add - support for UNLE, UNLT, UNGE, and UNGT. + PR target/30485 + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add + support for UNLE, UNLT, UNGE, and UNGT. 2007-01-15 Eric Christopher @@ -1368,7 +3761,7 @@ * passes.c (execute_todo): Remove TODO_write_loop_closed logic. * tree-pass.h: Likewise. * tree-ssa-loop-niter.c (unmark_surely_finite_loop): Remove - unneeded comments. + unneeded comments. (maybe_mark_infinite_loops): Mark call to builtin_maybe_infinite_loop for SSA renaming. * tree-ssa-loop.c (tree_mark_maybe_inf_loops): Re-enable. @@ -1379,7 +3772,7 @@ Radar 4859866 * opts.c (option_enabled): Dump options that use the - access_flag mechanism. + access_flag mechanism. * opt-functions.awk (switch_flags): Handle CL_VARUINT, CL_PERFUNC correctly. @@ -1444,8 +3837,8 @@ 2006-12-14 Fariborz Jahanian - Radar 4841447 - * c.opt (-fobjc-new-property): Modified its language description + Radar 4841447 + * c.opt (-fobjc-new-property): Modified its language description 2006-12-14 Josh Conner @@ -1471,20 +3864,20 @@ 2006-12-13 Fariborz Jahanian - Radar 4531086 - * config/darwin.h (OBJC_WARN_OBJC2_FEATURES): New macro. + Radar 4531086 + * config/darwin.h (OBJC_WARN_OBJC2_FEATURES): New macro. 2006-12-13 Fariborz Jahanian - Radar 4862848 - * common.opt (flag_objc_abi): Defaulted to -1 - * config/darwin.h (OBJC_FLAG_OBJC_ABI): New macro. + Radar 4862848 + * common.opt (flag_objc_abi): Defaulted to -1 + * config/darwin.h (OBJC_FLAG_OBJC_ABI): New macro. 2006-12-12 Fariborz Jahanian Radar 4865576 * tree.c (type_hash_eq): Check for TYPE_NAME of two colliding - tentative struct/union types. + tentative struct/union types. 2006-12-11 Josh Conner @@ -1519,9 +3912,9 @@ 2006-12-07 Eric Christopher - Radar 4869218 - * doc/extend.texi: Replace mni with ssse3. - * doc/invoke.texi: Ditto. + Radar 4869218 + * doc/extend.texi: Replace mni with ssse3. + * doc/invoke.texi: Ditto. 2006-12-06 Dale Johannesen @@ -1539,7 +3932,7 @@ Radar 4859096 * c-typeck.c (build_modify_expr): Skip property calls - when checking for lvalue-ness. + when checking for lvalue-ness. * c-common.h (objc_property_call): New decl. * stub-objc.c (stub-objc.c): New function stub. * c-parser.c (reswords): Add new objc property keywords. @@ -1556,13 +3949,13 @@ 2006-11-15 Eric Christopher - * config/darwin.h (LINK_COMMAND_SPEC): Remove {u*} from - options passed through. + * config/darwin.h (LINK_COMMAND_SPEC): Remove {u*} from + options passed through. 2006-11-15 Eric Christopher - Radar 4839411 - * config/i386/tmmintrin.h: Depend on SSSE3. + Radar 4839411 + * config/i386/tmmintrin.h: Depend on SSSE3. 2006-11-15 Dale Johannesen @@ -1584,17 +3977,17 @@ 2006-10-05 Hui-May Chang - Radar 4708086 - * passes.c (MaxAlignForThisBlock, LargestAlignmentOfVariables): - Moved to local-alloc.c. - (rest_of_compilation) : patch involved save_PREFERRED_STACK_BOUNDARY - as moved to final.c. - * local-alloc.c (MaxAlignForThisBlock, LargestAlignmentOfVariables): - Moved from passes.c. - * final.c (rest_of_clean_state) : patch involved + Radar 4708086 + * passes.c (MaxAlignForThisBlock, LargestAlignmentOfVariables): + Moved to local-alloc.c. + (rest_of_compilation) : patch involved save_PREFERRED_STACK_BOUNDARY + as moved to final.c. + * local-alloc.c (MaxAlignForThisBlock, LargestAlignmentOfVariables): + Moved from passes.c. + * final.c (rest_of_clean_state) : patch involved save_PREFERRED_STACK_BOUNDARY was moved from passes.c. - * i386.h : define SAVE_PREFERRED_STACK_BOUNDARY. - * i386.c : define ix86_preferred_stack_boundary. + * i386.h : define SAVE_PREFERRED_STACK_BOUNDARY. + * i386.c : define ix86_preferred_stack_boundary. 2006-09-29 Hui-May Chang @@ -1610,7 +4003,7 @@ 1006-11-09 Fariborz Jahanian - Radar 4810609 + Radar 4810609 * c.opt (-fobjc-gc-only): New option * doc/invoke.texi (Objective-C GC Options): Add -fobjc-gc-only. @@ -1696,7 +4089,7 @@ 2006-11-01 Fariborz Jahanian - Radar 4805321 (new property). + Radar 4805321 (new property). * c-common.h (RID_AT_SYNTHESIZE, RID_AT_DYNAMIC, RID_READWRITE, RID_ASSIGN, RID_RETAIN, RID_COPY): New enums. (OBJC_IS_NEW_PATTR_KEYWORD): New macro. @@ -1734,13 +4127,13 @@ Temporarily revert: 2006-09-25 Eric Christopher - Radar 4574849 - * config/t-slibgcc-darwin (SHLIB_LINK): Use - -dylib_install_name. - * config/darwin.h (LINK_COMMAND_SPEC): Remove use - of libtool. - (LINK_SPEC): Adjust options for above. - (STARTFILE_SPEC): Ditto. + Radar 4574849 + * config/t-slibgcc-darwin (SHLIB_LINK): Use + -dylib_install_name. + * config/darwin.h (LINK_COMMAND_SPEC): Remove use + of libtool. + (LINK_SPEC): Adjust options for above. + (STARTFILE_SPEC): Ditto. 2006-10-19 Caroline Tice @@ -1821,19 +4214,19 @@ 2006-10-09 Caroline Tice - Radar 4755586 - * config/i386/i386.h: Rename mni to ssse3. - * config/i386/i386.md: Ditto. - * config/i386/tmmintrin.h: Ditto. - * config/i386/i386.c: Ditto. - * config/i386/sse.md: Ditto. + Radar 4755586 + * config/i386/i386.h: Rename mni to ssse3. + * config/i386/i386.md: Ditto. + * config/i386/tmmintrin.h: Ditto. + * config/i386/i386.c: Ditto. + * config/i386/sse.md: Ditto. 2006-10-05 Dale Johannesen @@ -1948,7 +4341,7 @@ 2006-09-26 Fariborz Jahanian - Radar 4733555 + Radar 4733555 *config/darwin.c (darwin_handle_weak_import_attribute): Ignore 'weak_import' on objc methods. @@ -1980,13 +4373,13 @@ 2006-09-25 Eric Christopher - Radar 4574849 - * config/t-slibgcc-darwin (SHLIB_LINK): Use - -dylib_install_name. - * config/darwin.h (LINK_COMMAND_SPEC): Remove use - of libtool. - (LINK_SPEC): Adjust options for above. - (STARTFILE_SPEC): Ditto. + Radar 4574849 + * config/t-slibgcc-darwin (SHLIB_LINK): Use + -dylib_install_name. + * config/darwin.h (LINK_COMMAND_SPEC): Remove use + of libtool. + (LINK_SPEC): Adjust options for above. + (STARTFILE_SPEC): Ditto. 2006-09-25 Bill Wendling @@ -2009,21 +4402,21 @@ 2006-09-18 Fariborz Jahanian - Radar 4667060 + Radar 4667060 * c-gimplify.c (gimplify_c_loop): Add support for setting of foreach loop controlling variable to 'nil' on normal loop exit. 2006-09-15 Fariborz Jahanian - Radar 4727659 + Radar 4727659 * c-common.c (handle_noreturn_attribute): Handle method_decl nodes as well. 2006-09-14 Bill Wendling - Radar 4731660 - * config/darwin.h (REDO_SECTION_INFO_P): Removed + Radar 4731660 + * config/darwin.h (REDO_SECTION_INFO_P): Removed 2006-09-11 Josh Conner @@ -2063,7 +4456,7 @@ 2006-09-06 Caroline Tice Radar 4707854 - * dwarf2out.c (dwar2out_abstract_function): Remove call_site test + * dwarf2out.c (dwar2out_abstract_function): Remove call_site test from condition determining if an abstract origin die needs to be generated. @@ -2085,15 +4478,15 @@ 006-09-01 Fariborz Jahanian - Radar 4712269 - * c-common.h (objc_build_incr_decr_setter_call): New decl. - * stub-objc.c (objc_build_incr_decr_setter_call): New stub. - * c-typeck.c (build_unary_op): Call objc_build_incr_decr_setter_call - for potential ince/decr pre/post expressions involving properties. + Radar 4712269 + * c-common.h (objc_build_incr_decr_setter_call): New decl. + * stub-objc.c (objc_build_incr_decr_setter_call): New stub. + * c-typeck.c (build_unary_op): Call objc_build_incr_decr_setter_call + for potential ince/decr pre/post expressions involving properties. 2006-08-31 Fariborz Jahanian - Radar 4697411 + Radar 4697411 * c-common.h (objc_volatilize_component_ref): New decl. * c-typeck.c (build_component_ref): Call objc_volatilize_component_ref. * stub-objc.c (objc_volatilize_component_ref): New stub. @@ -2112,12 +4505,12 @@ 2006-08-28 Bill Wendling - Radar 4679943 - * doc/extend.texi (Structure-Packing Pragmas): Changed #pragma pack - documentation to reflect Apple's implementation. - * config/darwin-c.c (push_field_alignment, darwin_pragma_pack): - If #pragma pack([N]), don't clear out the natural alignment flag - on PPC64. + Radar 4679943 + * doc/extend.texi (Structure-Packing Pragmas): Changed #pragma pack + documentation to reflect Apple's implementation. + * config/darwin-c.c (push_field_alignment, darwin_pragma_pack): + If #pragma pack([N]), don't clear out the natural alignment flag + on PPC64. 2006-08-25 Fariborz Jahanian @@ -2133,12 +4526,12 @@ 2006-08-24 Bill Wendling - Radar 4699019 - * doc/invoke.texi (C Language Options, Linker Options, - Warning Options): Removed -Wpragma-once, -no-c++filt, - and -Wpragma-once options' documentation. - * gcc/common.opt (fppc): Removed fppc flag. - * gcc/toplev.c (flag_fppc): Removed flag_fppc variable. + Radar 4699019 + * doc/invoke.texi (C Language Options, Linker Options, + Warning Options): Removed -Wpragma-once, -no-c++filt, + and -Wpragma-once options' documentation. + * gcc/common.opt (fppc): Removed fppc flag. + * gcc/toplev.c (flag_fppc): Removed flag_fppc variable. 2006-08-22 Hui-May Chang @@ -2168,7 +4561,7 @@ Radar 4106131 * gcc/config/i386/darwin.h (TARGET_DEEP_BRANCH_PREDICTION): - Remove NOCONA. + Remove NOCONA. * gcc/testsuite/gcc.apple/execute/picbase-1.c (xsqrt): Replace references to __builtin functions with their portable equivalents. @@ -2281,11 +4674,11 @@ 2006-07-18 Fariborz Jahanian - Radar 4592503 - * c-decl.c (finish_struct): Check on illegal use of __weak - on struct fields. - * decl.c (start_decl): Check on illegal use of __weak on - variable declarations. + Radar 4592503 + * c-decl.c (finish_struct): Check on illegal use of __weak + on struct fields. + * decl.c (start_decl): Check on illegal use of __weak on + variable declarations. * stub-objc.c (objc_checkon_weak_attribute): New stub. * c-common.h (objc_checkon_weak_attribute): New decl. @@ -2391,7 +4784,7 @@ 2006-07-07 Fariborz Jahanian - Radar 4585769 + Radar 4585769 * config/darwin-protos.h: New declarations. * config/darwin.c (machopic_select_section): New sections for objc1 extensions. @@ -2414,7 +4807,7 @@ 2006-06-27 Fariborz Jahanian - Radar 4600999 + Radar 4600999 * config/darwin.c (darwin_handle_objc_gc_attribute): Fix main variant after attribute insertion. @@ -2552,9 +4945,9 @@ 2006-06-01 Fariborz Jahanian - Radar 4570979 + Radar 4570979 * config/darwin.h: Change certain 'type' of objc2 sections - to 'regular' from 'literal_pointers' (reversing radar + to 'regular' from 'literal_pointers' (reversing radar 4561264).. 2006-06-01 Hui-May Chang @@ -2702,11 +5095,11 @@ 2006-05-08 Fariborz Jahanian - radar 4535676 - * config/darwin-protos.h: New declarations. - * config/darwin.c (machopic_select_section): Code to generate - new section __super_refs. - * config/darwin.h: Macros for new section declarations. + radar 4535676 + * config/darwin-protos.h: New declarations. + * config/darwin.c (machopic_select_section): Code to generate + new section __super_refs. + * config/darwin.h: Macros for new section declarations. 2006-05-05 Fariborz Jahanian @@ -2727,7 +5120,7 @@ 2006-04-28 Fariborz Jahanian - Radar 4512786 + Radar 4512786 * doc/invoke.texi (fobjc-exceptions): Say it is on by default. @@ -2747,7 +5140,7 @@ 2006-04-13 Devang Patel Radar 4503682 - * c-lex.c (c_lex_with_flags): CPP_BINCL and CPP_EINCL tokens do not block PCH. + * c-lex.c (c_lex_with_flags): CPP_BINCL and CPP_EINCL tokens do not block PCH. 2006-04-12 Devang Patel @@ -2781,33 +5174,33 @@ 2006-04-13 Fariborz Jahanian - Radar 4502236 + Radar 4502236 * c-parse.in (c99_block_lineno_labeled_stmt): Pass same flags to c_end_compound_stmt to match c_begin_compound_stmt. 2006-04-12 Fariborz Jahanian - Radar 4507230 + Radar 4507230 * c-common.h (objc_type_valid_for_messaging): Declare. * stub-objc.c (objc_type_valid_for_messaging): New stub. 2006-04-06 Fariborz Jahanian - Radar 4436866 - (Missing copies attribute) + Radar 4436866 + (Missing copies attribute) * c-parse.in: Add grammer for 'copies' attribute. * c-common.h (RID_COPIES): New enumerator. 2006-04-04 Fariborz Jahanian - Radar 4498373 - (Metadata for objective-c properties) + Radar 4498373 + (Metadata for objective-c properties) * config/darwin.c (machopic_select_section): Put metadata name/attribute strings in .data section. 2006-03-29 Fariborz Jahanian - Radar 4493912 + Radar 4493912 * config/darwin.c (darwin_init_cfstring_builtins): Make type of CFString.length 'long'. (darwin_init_cfstring_builtins): Initialize CFString.length to @@ -2815,7 +5208,7 @@ 2006-03-27 Fariborz Jahanian - Radar 4133425 + Radar 4133425 * c-common.h (objc_diagnose_private_ivar): New decl. * stub-objc.c (objc_diagnose_private_ivar): New stub. * c-decl.c (undeclared_variable): Issue disnostic on @@ -2830,12 +5223,12 @@ 2006-03-24 Devang Patel Radar 4485223 - * opts.c (decode_options): Issue warning if -ftree-vectorize - overrides -fno-strict-aliasing. + * opts.c (decode_options): Issue warning if -ftree-vectorize + overrides -fno-strict-aliasing. 2006-03-23 Fariborz Jahanian - Radar 4193359 + Radar 4193359 * c-typeck.c (convert_for_assignment): Remove Objective-C EH machinery 'volatile' qualifier before doing type comparison. @@ -2853,7 +5246,7 @@ 2006-03-22 Fariborz Jahanian - Radar 4436866 + Radar 4436866 * c-parse.in: Add all the needed grammar and lexical support for objective-c @property. * c-typeck.c (build_component_ref): Call objc_build_getter_call. @@ -2878,7 +5271,7 @@ 2006-03-08 Fariborz Jahanian - Radar 4468456 + Radar 4468456 * c-gimplify.c (gimplify_c_loop): 'continue' label is generated as in normal case and belongs to current loop. @@ -2900,16 +5293,16 @@ Ziemowit Laski Radar 4137741 - * Makefile.in (c-lex.o): Revert langhooks.h dependency. - (langhooks.o): Revert debug.h dependency. - * c-lex.c: Do not include langhooks.h. - (fe_file_change): Revert lang_hooks calls; issue debug_hooks - calls only if defer_file_change_debug_hooks flag is cleared. - (c_lex_with_flags): Propagate line number information for - CPP_BINCL and CPP_EINCL tokens. - * langhooks-def.h: Revert Radar 4133801 changes. - * langhooks.c: Likewise. - * langhooks.h: Likewise. + * Makefile.in (c-lex.o): Revert langhooks.h dependency. + (langhooks.o): Revert debug.h dependency. + * c-lex.c: Do not include langhooks.h. + (fe_file_change): Revert lang_hooks calls; issue debug_hooks + calls only if defer_file_change_debug_hooks flag is cleared. + (c_lex_with_flags): Propagate line number information for + CPP_BINCL and CPP_EINCL tokens. + * langhooks-def.h: Revert Radar 4133801 changes. + * langhooks.c: Likewise. + * langhooks.h: Likewise. 2006-02-15 Fariborz Jahanian @@ -2965,7 +5358,7 @@ 2006-01-30 Fariborz Jahanian - Radar 4386773 + Radar 4386773 * c-common.h (RID_AT_OPTIONAL, RID_AT_REQUIRED): Two new objective-c keywords. (objc_set_method_opt): New declaration. @@ -2979,8 +5372,8 @@ 2006-01-23 Fariborz Jahanian - Radar 4391705 - * config/darwin-protos.h + Radar 4391705 + * config/darwin-protos.h (objc_v2_selector_refs_section): New declaration. * config/darwin.c: use section __OBJC2,__selector_refs for @selector expressions in new-ABI and hybrid-ABI. @@ -2990,7 +5383,7 @@ 2006-01-18 Fariborz Jahanian - Radar 4294910 + Radar 4294910 * c-parse.in: Add grammar supprt for the foreach initialization part. * c-gimplify.c (obj_reuse_bc_block): New function. @@ -3028,9 +5421,9 @@ 2005-12-06 Fariborz Jahanian - Radar 4360146 - * c-common.h (objc_v2_build_ivar_ref): New declaration. - * stub-objc.c (objc_v2_build_ivar_ref): New stub. + Radar 4360146 + * c-common.h (objc_v2_build_ivar_ref): New declaration. + * stub-objc.c (objc_v2_build_ivar_ref): New stub. * c-typeck.c (build_component_ref): Generate the new ivar reference tree. @@ -3231,7 +5624,7 @@ Radar 4434601 Backport from mainline: 2006-01-19 Jan Hubicka - H.J. Lu + H.J. Lu Evandro Menezes * invoke.texi (generic): Document @@ -3291,16 +5684,16 @@ 2006-05-02 Eric Christopher - Radar 4533898 - * global.c (flag_cw_asm_blocks): Change to - flag_iasm_blocks. - * config/i386/i386.h (IASM_VALID_PIC): Move... - * config/i386/darwin.h: ... here. + Radar 4533898 + * global.c (flag_cw_asm_blocks): Change to + flag_iasm_blocks. + * config/i386/i386.h (IASM_VALID_PIC): Move... + * config/i386/darwin.h: ... here. 2006-05-01 Eric Christopher - Radar 4533757 - * global.c (flag_cw_asm_blocks): Declare. + Radar 4533757 + * global.c (flag_cw_asm_blocks): Declare. 2006-04-10 Eric Christopher @@ -3654,7 +6047,7 @@ 2006-04-18 Stuart Hastings Radar 4505290 - * config/rs6000/rs6000.c (rs6000_initialize_trampoline): Use + * config/rs6000/rs6000.c (rs6000_initialize_trampoline): Use pmode for SYMBOL_REFs. 2006-04-18 Dale Johannesen @@ -3666,11 +6059,11 @@ 2006-04-18 Stuart Hastings Radar 4505290 - * config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New. - * config/t-darwin (crt3.o): Use it. - * config/rs6000/rs6000.md (call_indirect_nonlocal_sysv, - call_nonlocal_sysv, call_value_indirect_nonlocal_sysv, - call_value_nonlocal_sysv, sibcall_nonlocal_sysv, + * config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New. + * config/t-darwin (crt3.o): Use it. + * config/rs6000/rs6000.md (call_indirect_nonlocal_sysv, + call_nonlocal_sysv, call_value_indirect_nonlocal_sysv, + call_value_nonlocal_sysv, sibcall_nonlocal_sysv, sibcall_value_nonlocal_sysv): Use the P macro for 32/64 support. 2006-04-18 Devang Patel @@ -3860,8 +6253,8 @@ 2005-12-16 Jeff Law - * tree-ssa-dse.c (dse_optimize_stmt): Correctly handle PHI nodes which - represent a use and definition of the same SSA_NAME. + * tree-ssa-dse.c (dse_optimize_stmt): Correctly handle PHI nodes which + represent a use and definition of the same SSA_NAME. 2006-02-28 Stuart Hastings @@ -3874,15 +6267,15 @@ Dorit Nuzman Radar 4375453 - * targhooks.h (vector_alignment_reachable): New. - * targhooks.c (default_vector_alignment_reachable): New. - * target.h (gcc_target): Add vector_alignment_reachable. - * target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New. - * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Avoid - peeling when natural alignment is not reachable due to known - misalignment. Use target hook to check unknown alignment. - * config/rs6000.c (TARGET_VECTOR_ALIGNMENT_REACHABLE, - rs6000_vector_alignment_reachable): New. + * targhooks.h (vector_alignment_reachable): New. + * targhooks.c (default_vector_alignment_reachable): New. + * target.h (gcc_target): Add vector_alignment_reachable. + * target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New. + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Avoid + peeling when natural alignment is not reachable due to known + misalignment. Use target hook to check unknown alignment. + * config/rs6000.c (TARGET_VECTOR_ALIGNMENT_REACHABLE, + rs6000_vector_alignment_reachable): New. 2006-02-27 Stuart Hastings @@ -4038,7 +6431,7 @@ 2006-02-10 Dale Johannesen - Radar 4420531 + Radar 4420531 * doc/invoke.texi: Warn that -ftree-loop-linear is buggy. 2006-02-10 Dale Johannesen @@ -4163,8 +6556,8 @@ 2006-01-23 Devang Patel - Radar 4334498 - * dbxout.c (dbxout_init): Queue void type. + Radar 4334498 + * dbxout.c (dbxout_init): Queue void type. 2006-01-23 Dale Johannesen @@ -4360,8 +6753,8 @@ 2005-12-09 Zdenek Dvorak Radar 4233898 - * tree-chrec.c (chrec_fold_multiply_poly_poly): Associate chrecs - correctly. + * tree-chrec.c (chrec_fold_multiply_poly_poly): Associate chrecs + correctly. 2005-12-09 Stuart Hastings @@ -4406,17 +6799,17 @@ 2005-12-07 Devang Patel Ziemowit Laski - Radar 4137741 - * Makefile.in (c-lex.o): Revert langhooks.h dependency. - (langhooks.o): Revert debug.h dependency. - * c-lex.c: Do not include langhooks.h. - (fe_file_change): Revert lang_hooks calls; issue debug_hooks - calls only if defer_file_change_debug_hooks flag is cleared. - (c_lex_with_flags): Propagate line number information for - CPP_BINCL and CPP_EINCL tokens. - * langhooks-def.h: Revert Radar 4133801 changes. - * langhooks.c: Likewise. - * langhooks.h: Likewise. + Radar 4137741 + * Makefile.in (c-lex.o): Revert langhooks.h dependency. + (langhooks.o): Revert debug.h dependency. + * c-lex.c: Do not include langhooks.h. + (fe_file_change): Revert lang_hooks calls; issue debug_hooks + calls only if defer_file_change_debug_hooks flag is cleared. + (c_lex_with_flags): Propagate line number information for + CPP_BINCL and CPP_EINCL tokens. + * langhooks-def.h: Revert Radar 4133801 changes. + * langhooks.c: Likewise. + * langhooks.h: Likewise. 2005-12-07 Dale Johannesen @@ -4483,7 +6876,7 @@ when nested functions are on. 2005-11-30 Dale Johannesen - Andrew Pinski + Andrew Pinski Radar 4347034 * combine.c (find_split_point): Sign extend bitmask @@ -4507,8 +6900,8 @@ 2005-11-18 Eric Christopher Radar 4324160 - * config/i386/i386.md (*zero_extendqihi2_movzbw): Avoid partial - register stalls by zero extending to the full register. + * config/i386/i386.md (*zero_extendqihi2_movzbw): Avoid partial + register stalls by zero extending to the full register. 2005-11-17 Devang Patel @@ -4536,9 +6929,9 @@ 2005-11-15 Dale Johannesen - * config/darwin-c.c (darwin_pragma_call_on_load): - Give an error for 64-bit targets. - (darwin_pragma_call_on_unload): Ditto. + * config/darwin-c.c (darwin_pragma_call_on_load): + Give an error for 64-bit targets. + (darwin_pragma_call_on_unload): Ditto. 2005-11-15 Dale Johannesen @@ -4603,7 +6996,7 @@ 2005-11-08 Fariborz Jahanian - Radar 4330422 + Radar 4330422 * c-common.h (objc_non_volatilized_type): New declaration * stub-objc.c (objc_non_volatilized_type): New stub. @@ -4614,35 +7007,35 @@ * config/i386/i386.c (standard_sse_constant_p) Check for vector constant -1. (standard_sse_constant_opcode) New function to return the opcode - associated with standard_sse_constant_p. - (ix86_expand_vector_move) Use standard_sse_constant_p. - * config/i386/predicates.md (vector_move_operand) Use + associated with standard_sse_constant_p. + (ix86_expand_vector_move) Use standard_sse_constant_p. + * config/i386/predicates.md (vector_move_operand) Use standard_sse_constant_p. (nonimmediate_or_0_operand) Return true if operand is a nonimmediate or a constant zero. - * config/i386/sse.md (*mov_internal) Use + * config/i386/sse.md (*mov_internal) Use standard_sse_constant_opcode. - (*movv4sf_internal) Use standard_sse_constant_opcode. - (*movv2df_internal) Use standard_sse_constant_opcode. + (*movv4sf_internal) Use standard_sse_constant_opcode. + (*movv2df_internal) Use standard_sse_constant_opcode. (sse_movlhps) Replace vector_move_operand with nonimmediate_or_0_operand. (*sse_concatv2sf) Replace vector_move_operand with nonimmediate_or_0_operand. - (*vec_setv4sf_0) Replace vector_move_operand with + (*vec_setv4sf_0) Replace vector_move_operand with nonimmediate_or_0_operand. - (sse2_loadlpd) Replace vector_move_operand with + (sse2_loadlpd) Replace vector_move_operand with nonimmediate_or_0_operand. - (*vec_concatv2df) Replace vector_move_operand with + (*vec_concatv2df) Replace vector_move_operand with nonimmediate_or_0_operand. (sse2_loadld) Replace vector_move_operand with nonimmediate_or_0_operand. - (*vec_concatv2di) Replace vector_move_operand with + (*vec_concatv2di) Replace vector_move_operand with nonimmediate_or_0_operand. * testsuite/gcc.apple/4283414.c: New. 2005-11-01 Fariborz Jahanian - objc new meta-data definitions - part 1 + objc new meta-data definitions - part 1 * common.opt: Add new -fobjc-abi-version=n option. @@ -4665,26 +7058,26 @@ Radar 4053179 Backport from Mainline. 2005-04-14 Richard Henderson - * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): Split ... - (ix86_expand_sse_fp_minmax): ... from ... - (ix86_expand_fp_movcc): ... here. - (ix86_expand_sse_movcc): Rewrite from ix86_split_sse_movcc. - * config/i386/i386-protos.h: Update. - * config/i386/i386.md (UNSPEC_IEEE_MIN, UNSPEC_IEEE_MAX): New. - (sse_setccsf, sse_setccdf): Allow before reload. - (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): Remove. - (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): Remove. - (ieee_sminsf3, ieee_smaxsf3, ieee_smindf3, ieee_smaxdf3): New. - * config/i386/sse.md (andsf3, nandsf3, iorsf3, xorsf3): New. - (anddf3, nanddf3, iordf3, xordf3): New. - * config/i386/i386.c (ix86_expand_sse_cmp): Split out from ... - (ix86_expand_sse_movcc): ... here. Take cmp as a pre-computed - register. - (ix86_expand_fp_movcc): Update to match. - (ix86_expand_fp_vcond, ix86_expand_int_vcond): New. - * config/i386/i386-protos.h: Update. - * config/i386/sse.md (vcondv4sf, vcondv2df): New. - (vcond, vcondu): New. + * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): Split ... + (ix86_expand_sse_fp_minmax): ... from ... + (ix86_expand_fp_movcc): ... here. + (ix86_expand_sse_movcc): Rewrite from ix86_split_sse_movcc. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (UNSPEC_IEEE_MIN, UNSPEC_IEEE_MAX): New. + (sse_setccsf, sse_setccdf): Allow before reload. + (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): Remove. + (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): Remove. + (ieee_sminsf3, ieee_smaxsf3, ieee_smindf3, ieee_smaxdf3): New. + * config/i386/sse.md (andsf3, nandsf3, iorsf3, xorsf3): New. + (anddf3, nanddf3, iordf3, xordf3): New. + * config/i386/i386.c (ix86_expand_sse_cmp): Split out from ... + (ix86_expand_sse_movcc): ... here. Take cmp as a pre-computed + register. + (ix86_expand_fp_movcc): Update to match. + (ix86_expand_fp_vcond, ix86_expand_int_vcond): New. + * config/i386/i386-protos.h: Update. + * config/i386/sse.md (vcondv4sf, vcondv2df): New. + (vcond, vcondu): New. 2005-10-31 Devang Patel @@ -4867,8 +7260,8 @@ 2005-10-14 Devang Patel - Radar 4300871 - * dbxout.c (dbxout_start_source_file): Flush type queue. + Radar 4300871 + * dbxout.c (dbxout_start_source_file): Flush type queue. 2005-10-13 Stuart Hastings @@ -4922,7 +7315,7 @@ 2005-10-07 Evan Cheng - Radar 4109832 + Radar 4109832 * config/i386/xmmintrin.h (_MM_TRANSPOSE4_PS): Rewrite using high/low moves and unpack to speed up. @@ -4943,11 +7336,11 @@ 2005-10-04 Devang Patel - Radar 4278470 - * dbxout.c (dbxut_init): Flush type queue. - (type_queue, type_queue_index, type_queue_size): GTY'ed. - (dbxout_queue_type): Use ggc_realloc. - (dbxout_free_type_queue): Use ggc_free. + Radar 4278470 + * dbxout.c (dbxut_init): Flush type queue. + (type_queue, type_queue_index, type_queue_size): GTY'ed. + (dbxout_queue_type): Use ggc_realloc. + (dbxout_free_type_queue): Use ggc_free. 2005-01-03 Devang Patel @@ -4974,7 +7367,7 @@ 2005-09-28 Devang Patel Radar 4263352 - * config/darwin-driver.c (GTY): Define empty macro. + * config/darwin-driver.c (GTY): Define empty macro. 2005-09-29 Ziemowit Laski @@ -4991,7 +7384,7 @@ 2005-09-28 Devang Patel Radar 4263352 - * config/darwin.h (darwin_reverse_bitfields): Add GTY marker. + * config/darwin.h (darwin_reverse_bitfields): Add GTY marker. 2005-09-28 Devang Patel @@ -5019,8 +7412,8 @@ PR target/23847 Radar 4263935 - * config/rs6000/rs6000.c (rs6000_function_value): Parallel pattern - for __complex__ double in -mcpu=G5 mode. + * config/rs6000/rs6000.c (rs6000_function_value): Parallel pattern + for __complex__ double in -mcpu=G5 mode. 2005-09-26 Stuart Hastings @@ -5177,30 +7570,30 @@ 2005-09-21 Fariborz Jahanian - Radar 4043818 (pr19653) - * /config/i386/mmx.md (mov_internal): Make cost of 'y' (mmx_regs) - computable. + Radar 4043818 (pr19653) + * /config/i386/mmx.md (mov_internal): Make cost of 'y' (mmx_regs) + computable. 2005-08-31 Richard Henderson - Radar 4043818 (pr19653) - * expr.c (expand_expr_real_1) : Force subregs - into a pseudo before applying gen_lowpart. + Radar 4043818 (pr19653) + * expr.c (expand_expr_real_1) : Force subregs + into a pseudo before applying gen_lowpart. 2005-08-30 Richard Henderson - Radar 4043818 (pr19653) - PR target/23630 - * expr.c (expand_expr_real_1) : Use gen_lowpart - whenever the mode sizes match. + Radar 4043818 (pr19653) + PR target/23630 + * expr.c (expand_expr_real_1) : Use gen_lowpart + whenever the mode sizes match. 2005-08-23 Paolo Bonzini - Radar 4043818 (pr19653) - PR middle-end/23517 - * fold-const.c (fold_convert): Use VIEW_CONVERT_EXPR to convert - between vectors. - * convert.c (convert_to_integer, convert_to_vector): Likewise. + Radar 4043818 (pr19653) + PR middle-end/23517 + * fold-const.c (fold_convert): Use VIEW_CONVERT_EXPR to convert + between vectors. + * convert.c (convert_to_integer, convert_to_vector): Likewise. 2005-09-19 Devang Patel @@ -5217,25 +7610,25 @@ 2005-09-15 Devang Patel - dbxout_type rewrite. - * dbxout.c (enum typestatus): Add TYPE_QUEUED. - (dbxout_type):Rewrite. Use dbxout_partial_type and dbxout_complete_type - to do actual work. - (dbxout_partial_type, dbxout_complete_type, dbxout_type_xref, - dbxout_pointer_type, dbxout_void_type, dbxout_integer_type, - dbxout_real_type, dbxout_char_type, dbxout_complex_type, - dbxout_file_type, dbxout_function_type, dbxout_reference_type, - dbxout_next_type_number, dbxout_cross_ref_type_p, dbxout_type_with_name, - dbxout_queue_type, dbxout_free_type_queue): New. - (dbxout_function_end): Flush type queue. - (dbxout_end_source_file): Same. - * final.c (debug_flush_symbol_queue): Same. - * debug.h (dbxout_flush_type_queue): New. + dbxout_type rewrite. + * dbxout.c (enum typestatus): Add TYPE_QUEUED. + (dbxout_type):Rewrite. Use dbxout_partial_type and dbxout_complete_type + to do actual work. + (dbxout_partial_type, dbxout_complete_type, dbxout_type_xref, + dbxout_pointer_type, dbxout_void_type, dbxout_integer_type, + dbxout_real_type, dbxout_char_type, dbxout_complex_type, + dbxout_file_type, dbxout_function_type, dbxout_reference_type, + dbxout_next_type_number, dbxout_cross_ref_type_p, dbxout_type_with_name, + dbxout_queue_type, dbxout_free_type_queue): New. + (dbxout_function_end): Flush type queue. + (dbxout_end_source_file): Same. + * final.c (debug_flush_symbol_queue): Same. + * debug.h (dbxout_flush_type_queue): New. 2005-09-15 Devang Patel - Radar 4241538 - * config/rs600.c (altivec_cov_rt_2p): Check NULL_TREE. + Radar 4241538 + * config/rs600.c (altivec_cov_rt_2p): Check NULL_TREE. 2005-09-08 Dale Johannesen @@ -5272,8 +7665,8 @@ 2005-08-31 Mike Stump - Radar 4239455 - * i386/i386.h (TARGET_CW_OP_CONSTRAINT): Sort. + Radar 4239455 + * i386/i386.h (TARGET_CW_OP_CONSTRAINT): Sort. 2005-08-31 Dale Johannesen @@ -5465,9 +7858,9 @@ 2005-08-12 Devang Patel Radar 4209318 - * dbxout.c (dbxout_type): Update this function to force type definition - in new LSYM stab. - (dbxout_symbol): Set TREE_ASM_WRITTEN only if did_output is true. + * dbxout.c (dbxout_type): Update this function to force type definition + in new LSYM stab. + (dbxout_symbol): Set TREE_ASM_WRITTEN only if did_output is true. 2005-08-10 Dale Johannesen @@ -5599,18 +7992,18 @@ 2005-07-30 Fariborz Jahanian Radar 4152603 - * c-common.c (c_common_att): New entry added for "nodebug". - (handle_nodebug_attribute): New function. - * tree-inline.c (call_location_p, call_location): New fields in - struct inline_data. - (copy_body_r): Set new location of copied tree, if available. - (expand_call_inline): If callee's '__nodebug__' attribute is - set, use caller's input_location for copied trees. - * config/i386/emmintrin.h: All intrinsic functions have - "__nodebug__" Added to their declarations. - * config/i386/mmintrin.h: Ditto. - * config/i386/pmmintrin.h: Ditto. - * config/i386/xmmintrin.h: Ditto. + * c-common.c (c_common_att): New entry added for "nodebug". + (handle_nodebug_attribute): New function. + * tree-inline.c (call_location_p, call_location): New fields in + struct inline_data. + (copy_body_r): Set new location of copied tree, if available. + (expand_call_inline): If callee's '__nodebug__' attribute is + set, use caller's input_location for copied trees. + * config/i386/emmintrin.h: All intrinsic functions have + "__nodebug__" Added to their declarations. + * config/i386/mmintrin.h: Ditto. + * config/i386/pmmintrin.h: Ditto. + * config/i386/xmmintrin.h: Ditto. 2005-07-29 Devang Patel @@ -5638,7 +8031,7 @@ 2005-07-21 Fariborz Jahanian - Radar 4187164 + Radar 4187164 * c-common.c (print_cw_asm_operand): Recognize and handle a PIC address expression. * c-typeck.c (parser_build_binary_op): Generate PIC address tree. @@ -5768,18 +8161,18 @@ stabs when symbol separation is ON. 2005-07-06 Dale Johannesen - Andrew Pinski + Andrew Pinski - Radar 4158356 - * tree-sra.c (enum copy_how): New. - (struct sra_elt): Change use_block_copy to how_to_copy. - (instantiate_element_integer): New. - (decide_block_copy): Rewrite logic. - (generate_copy_inout): Use how_to_copy. - (generate_element_zero): Ditto. - (scalarize_copy): Ditto. - (scalarize_init): Ditto. - (scalarize_ldst): Ditto. + Radar 4158356 + * tree-sra.c (enum copy_how): New. + (struct sra_elt): Change use_block_copy to how_to_copy. + (instantiate_element_integer): New. + (decide_block_copy): Rewrite logic. + (generate_copy_inout): Use how_to_copy. + (generate_element_zero): Ditto. + (scalarize_copy): Ditto. + (scalarize_init): Ditto. + (scalarize_ldst): Ditto. 2005-06-30 Devang Patel @@ -5860,8 +8253,8 @@ Undo 2005-06-04 Devang Patel - * dbxout.c (struct dbx_file): Apply GTY markers. - (dbxout_init, dbxout_start_source_file): Use ggc_alloc instead of xmalloc. + * dbxout.c (struct dbx_file): Apply GTY markers. + (dbxout_init, dbxout_start_source_file): Use ggc_alloc instead of xmalloc. 2005-06-15 Geoffrey Keating @@ -6046,14 +8439,14 @@ 2005-05-07 Stuart Hastings - Radar 4099020 - * config/i386/sse.md (sse_loadqv4s, sse_storeqv4si, sse_movqv4si): New. - * config/i386/i386.c (IX86_BUILTIN_MOVQ, - IX86_BUILTIN_LOADQ, IX86_BUILTIN_STOREQ): New. - (__builtin_ia32_movqv4si, __builtin_ia32_loadlv4si, __builtin_ia32_storelv4si): New. - * emmintrin.h (_mm_loadl_epi64, _mm_storel_epi64, _mm_move_epi64): Use them. - * config/i386/mmx.md: Exempt SSE subregs from multiword split. - * simplify-rtx.c(simplify_immed_subreg): Exit cleanly if outermode too wide. + Radar 4099020 + * config/i386/sse.md (sse_loadqv4s, sse_storeqv4si, sse_movqv4si): New. + * config/i386/i386.c (IX86_BUILTIN_MOVQ, + IX86_BUILTIN_LOADQ, IX86_BUILTIN_STOREQ): New. + (__builtin_ia32_movqv4si, __builtin_ia32_loadlv4si, __builtin_ia32_storelv4si): New. + * emmintrin.h (_mm_loadl_epi64, _mm_storel_epi64, _mm_move_epi64): Use them. + * config/i386/mmx.md: Exempt SSE subregs from multiword split. + * simplify-rtx.c(simplify_immed_subreg): Exit cleanly if outermode too wide. 2005-05-06 Dale Johannesen @@ -6098,11 +8491,11 @@ Radar 4102133 (PR 21293, Zdenek's patch) * tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of - integer_zerop. - * tree-gimple.c (is_gimple_min_invariant): Consider overflowed - constants invariant. - * fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert - the argument of the shift to the unsigned type. + integer_zerop. + * tree-gimple.c (is_gimple_min_invariant): Consider overflowed + constants invariant. + * fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert + the argument of the shift to the unsigned type. 2005-04-28 Devang Patel @@ -6349,29 +8742,29 @@ * config/darwin.c (machopic_select_section): Change name for function to switch to cold text section to unlikely_text_section (the correct function name, in varasm.c). - * config/darwin.h (SECTION_FUNCTION): Remove code that created a second - (incorrect) function for switching to cold text section. + * config/darwin.h (SECTION_FUNCTION): Remove code that created a second + (incorrect) function for switching to cold text section. 2005-04-14 Devang Patel Radar 4080840 - * common.opt (falign-jumps-max-skip, falign-jumps-max-skip=, - falign-loops-max-skip, falign-loops-max-skip=): New. - * opts.c (common_handle_option): Handle new falign-loops-max-skip - and falign-jumps-max-skip options. - * doc/invoke.texi: Document -falign-jumps-max-skip and - -falign-loops-max-skip. + * common.opt (falign-jumps-max-skip, falign-jumps-max-skip=, + falign-loops-max-skip, falign-loops-max-skip=): New. + * opts.c (common_handle_option): Handle new falign-loops-max-skip + and falign-jumps-max-skip options. + * doc/invoke.texi: Document -falign-jumps-max-skip and + -falign-loops-max-skip. * toplev.c (align_jumps_max_skip, align_loops_max_skip): Remove. 2005-04-14 Devang Patel Radar 3972515 - * config/rs600/altivec.md (altivec_vsr): Rename to .. - (lhsr3): ... new name. - (altivec_vsra): Rename to .. - (ashr3): ... new name. - * config/rs6000/rs6000.c (builtin_description): Rename shift - operations. + * config/rs600/altivec.md (altivec_vsr): Rename to .. + (lhsr3): ... new name. + (altivec_vsra): Rename to .. + (ashr3): ... new name. + * config/rs6000/rs6000.c (builtin_description): Rename shift + operations. 2005-04-12 Geoffrey Keating @@ -6407,7 +8800,7 @@ 2005-04-07 Devang Patel Radar 4069922 - * tree-sra.c (decide_block_copy): Disable scalarization of sub-elements. + * tree-sra.c (decide_block_copy): Disable scalarization of sub-elements. 2005-04-05 Fariborz Jahanian @@ -6469,9 +8862,9 @@ 2005-03-22 Devang Patel - Radar 4023104 - * config/darwin-driver.c (dash_capital_m_seen): Remove. - (main) : Do not handle -M options. + Radar 4023104 + * config/darwin-driver.c (dash_capital_m_seen): Remove. + (main) : Do not handle -M options. 2005-03-21 Stuart Hastings @@ -6516,7 +8909,7 @@ 2005-03-11 Devang Patel - * target.h: Reinsert one line comment. + * target.h: Reinsert one line comment. 2005-03-11 Ziemowit Laski @@ -6594,10 +8987,10 @@ 2005-03-06 Devang Patel Radar 4025991 - * tree-vectorizer.c (vect_is_simple_cond): Now second parameter is - loop_vec_info instead of loop *. - (vectorizable_select): Supply loop_vec_info to vect_is_simple_use. - (vect_build_dist_vector): Use loop nest's depth. + * tree-vectorizer.c (vect_is_simple_cond): Now second parameter is + loop_vec_info instead of loop *. + (vectorizable_select): Supply loop_vec_info to vect_is_simple_use. + (vect_build_dist_vector): Use loop nest's depth. 2005-03-06 Devang Patel @@ -6679,8 +9072,8 @@ 2005-02-23 Devang Patel - Radar 3841402 3841397 3841275 - * config/darwin-driver.c (add_arch_options): Do not supply + Radar 3841402 3841397 3841275 + * config/darwin-driver.c (add_arch_options): Do not supply -march=i386. Interpret -arch pentIIm3 appropriately. 2005-02-22 Devang Patel @@ -6690,9 +9083,9 @@ 2005-01-18 Andi Kleen - * c-typeck.c (convert_for_assignment): Check warn_pointer_sign. - * c.opt (-Wpointer-sign): Add. - * doc/invoke.texi (-Wpointer-sign): Add. + * c-typeck.c (convert_for_assignment): Check warn_pointer_sign. + * c.opt (-Wpointer-sign): Add. + * doc/invoke.texi (-Wpointer-sign): Add. 2005-02-21 Dale Johannesen @@ -6732,7 +9125,7 @@ 2005-02-17 Devang Patel - Undo Radar 3964387 fix. + Undo Radar 3964387 fix. 2005-02-17 Fariborz Jahanian @@ -6800,18 +9193,18 @@ 2004-02-16 Devang Patel - Radar 3964387 - * build_gcc: Build darwin-driver-rs6000.c and darwin-driver-i386.c - * config/darwin-driver-rs6000.c: New file - * config/darwin-driver-i386.c: New file - * config/darwin-driver.h: New file - * config/darwin-driver.c (darwin-driver.h): Include. - (ppc_specific_args, ppc_specific_args_size, ppc_specific_arg_count, - x86_specific_args, x86_specific_args_size, x86_specific_arg_count, - is_ppc_specific_option, is_x86_specific_option): New. - (remove_arch_options): New parameter. - (add_arch_options): Insert arch specific options. - (main): Interpret arch specific options. + Radar 3964387 + * build_gcc: Build darwin-driver-rs6000.c and darwin-driver-i386.c + * config/darwin-driver-rs6000.c: New file + * config/darwin-driver-i386.c: New file + * config/darwin-driver.h: New file + * config/darwin-driver.c (darwin-driver.h): Include. + (ppc_specific_args, ppc_specific_args_size, ppc_specific_arg_count, + x86_specific_args, x86_specific_args_size, x86_specific_arg_count, + is_ppc_specific_option, is_x86_specific_option): New. + (remove_arch_options): New parameter. + (add_arch_options): Insert arch specific options. + (main): Interpret arch specific options. 2005-02-16 Fariborz Jahanian @@ -6868,8 +9261,8 @@ 2005-02-11 Devang Patel Radar 3996800 - * gcc.c (cpp_uniq_options): Emit '-mconstant-cfstrings' option, - if needed. + * gcc.c (cpp_uniq_options): Emit '-mconstant-cfstrings' option, + if needed. 2005-02-09 Dale Johannesen Modified: llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple?rev=54171&r1=54170&r2=54171&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -1,3 +1,135 @@ +2008-07-28 Fariborz Jahanian + + Radar 6040305 + * typeck.c (comptypes): block-pointer types' + return type get special treatment. + +2008-07-21 Fariborz Jahanian + + Radar 6029624 + * call.c (objcp_reference_related_p): New + * cp-tree.h (objcp_reference_related_p): New decl. + +2008-07-16 Eugene Marinelli + + Radar 5559195 + * decl.c (cxx_maybe_build_cleanup): When considering whether to + build a cleanup for a class type, use + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY and + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE instead of + TYPE_HAS_NONTRIVIAL_DESTRUCTOR to determine whether it must be + output. + +2008-07-15 Eugene Marinelli + + Radar 5559195 + * cp-tree.h (struct lang_type_class): Add destructor_triviality_final + flag to mark when has_nontrivial_destructor_body and + destructor_nontrivial_because_of_base are final. Add accessor for + this flag. + * parser.c (cp_parser_statement_seq_opt): Use + CLASSTYPE_DESTRUCTOR_TRIVIALITY_FINAL to determine if + destructor should be checked for being empty, and set it if + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY is changed. + +2008-07-14 Eugene Marinelli + + * class.c (check_bases): Remove curly braces. + +2008-07-10 Eugene Marinelli + + Radar 5559195 + * init.c (push_base_cleanups): Check flags indicating whether + destructor of base class has a nontrivial body, has a base destructor + that must be called, or is private to determine whether it should be + called by the derived class. Set + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE to 1 if it has + members that must be deleted. + * class.c (check_bases, finish_struct_bits, + add_implicitly_declared_members): Set + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE and + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY based on base classes. + (check_methods): Set CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY to 1 + whenever a user-declared destructor is seen as a conservative + assumption. + * cp-tree.h (struct lang_type_class): Add + has_nontrivial_destructor_body and + destructor_nontrivial_because_of_base flags. Decrement remaining + dummy bits. Add accessors for these flags. + * parser.c (cp_parser_statement_seq_opt): Unmark + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY and then set it again only if + a statement is parsed. + +2008-06-05 Fariborz Jahanian + + Radar 5982990 + * parser.c (cp_parser_compound_statement): Take a new + argument which is used to call objc_mark_locals_volatile. + (cp_parser_primary_expression, cp_parser_statement, + etc.): add extra argument in calling cp_parser_compound_statement. + (cp_parser_objc_synchronized_statement): Passes + flag_objc_sjlj_exceptions as last argument in calling + cp_parser_compound_statement. + +2008-06-02 Fariborz Jahanian + + Radar 5976344 + * Parser.c (cp_parser_objc_interstitial_code): Allow template + declaration inside ObjC @implementation. + +2008-05-30 Josh Conner + + Radar 5933878 + * method.c (implicitly_declare_fn): Set DECL_ALIGN, if needed. + Backport from 4.3: + 2007-07-09 Geoffrey Keating + PR 32617 + * decl.c (cxx_init_decl_processing): Don't set + force_align_functions_log. + (grokfndecl): Honour ptrmemfunc_vbit_in_pfn. + * typeck.c (cxx_alignof_expr): When alignof is used on a plain + FUNCTION_DECL, return its alignment. + +2008-02-20 Fariborz Jahanian + + Radar 5732232 - code gen part 2. + * cp-lang.c (c_finish_return): Defined these + templates to get a clean compile. + +2008-05-01 Josh Conner + + * optimize.c: Rewrite of structor shrinkage. + (enum in_charge_use): New. + (struct thunk_tree_walk_data): New. + (struct clone_info): New. + (maybe_alias_body): Remove. + (examine_tree_for_in_charge_use): New. + (compute_use_thunks): New. + (maybe_thunk_body): Rename to thunk_body. Remove + explicit in-charge parameter. + (find_earlier_clone): New. + (maybe_clone_body): Remove most of old decloner + patch, replace with new algorithm. + +2008-03-20 Fariborz Jahanian + + Radar 5802025 + * typeck.c (finish_class_member_access_expr): Generate getter call + from an OBJC_PROPERTY_REFERENCE_EXPR. + +2008-03-19 Fariborz Jahanian + + Radar 5733674 + * decl.c (expand_static_init): Generate write barrier for + static initialization in objective-c++ mode. + +2007-11-29 Fariborz Jahanian + + Radar 5619052 + * pt.c (value_dependent_expression_p): @encode expression is + value-dependent if the operand is type-dependent. + (type_dependent_expression_p): Treat @encode same as 'sizeof'. + 1007-10-26 Josh Conner Radar 5562046 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=54171&r1=54170&r2=54171&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -1,3 +1,1486 @@ +2008-07-28 Fariborz Jahanian + + Radar 6040305 + * block-block-property-1.C: Add + * g++.apple/block-call.C: Add + +2008-07-25 Fariborz Jahanian + + Radar 6023694 + * objc.dg/super-after-trycatch.m: New + +2008-07-25 Fariborz Jahanian + + Radar 5992047 + * gcc.apple/block-5992047.c: Modified to a small test. + +2008-07-25 Fariborz Jahanian + + Radar 6014138 + * gcc.apple/block-global-byref-2.c: New + * gcc.apple/block-blocks-test-4.c: renamed __byref to __block + * gcc.apple/block-5992047.c: renamed __byref to __block + * gcc.apple/block-noescape-helper-3.c: renamed __byref to __block + * gcc.apple/block-blocks-test-5.c: renamed __byref to __block + * gcc.apple/block-escape-do.c: renamed __byref to __block + * gcc.apple/block-escape-switch.c: renamed __byref to __block + * gcc.apple/block-blocks-test-6.c: renamed __byref to __block + * gcc.apple/block-escape-goto.c: renamed __byref to __block + * gcc.apple/block-escape-return.c: renamed __byref to __block + * gcc.apple/block-byref-attribute.c: renamed __byref to __block + * gcc.apple/block-blocks-test-7.c: renamed __byref to __block + * gcc.apple/block-blocks-test-8.c: renamed __byref to __block + * gcc.apple/block-escape-while.c: renamed __byref to __block + * gcc.apple/block-blocks-test-1.c: renamed __byref to __block + * gcc.apple/block-noescape-helper.c: renamed __byref to __block + * gcc.apple/block-escape-for.c: renamed __byref to __block + * gcc.apple/block-escape-nested-while.c: renamed __byref to __block + * gcc.apple/block-escape-for1.c: renamed __byref to __block + * gcc.apple/block-blocks-test-2.c: renamed __byref to __block + * gcc.apple/block-noescape-helper-1.c: renamed __byref to __block + * gcc.apple/block-blocks-test-3.c: renamed __byref to __block + * gcc.apple/block-escape-return1.c: renamed __byref to __block + * gcc.apple/block-noescape-helper-2.c: renamed __byref to __block + +2008-07-23 Eugene Marinelli + + Radar 5559195 + * g++.apple/omit-destructor-call-scope.C: Add + +2008-07-23 Fariborz Jahanian + + Radar 6096219 + * gcc.apple/block-5992047.c: Modified + * gcc.apple/block-byref-attribute.c: Add + +2008-07-22 Fariborz Jahanian + + Radar 6029577 + * obj-c++.dg/property-reference-3.mm: Add + +2008-07-21 Fariborz Jahanian + + Radar 6029624 + * obj-c++.dg/property-reference-1.mm: Add + * obj-c++.dg/property-reference-2.mm: Add + +2008-07-18 Fariborz Jahanian + + Radar 6068877 + * gcc.apple/const-cfstring-5.c: Add + * g++.apple/const-cfstring-5.C: Add + +2008-07-18 Fariborz Jahanian + + Radar 6084601 + * gcc.apple/block-6084601.c: Add + +2008-07-18 Fariborz Jahanian + + Radar 6083129 - twiked + * gcc.apple/block-noescape-helper-3.c: Add + +2008-07-17 Fariborz Jahanian + + Radar 6083129 + * gcc.apple/block-escape-do.c: Add + * gcc.apple/block-escape-switch.c: Add + * gcc.apple/block-escape-goto.c: Add + * gcc.apple/block-escape-return.c: Add + * gcc.apple/block-escape-while.c: Add + * gcc.apple/block-noescape-helper.c: Add + * gcc.apple/block-escape-for.c: Add + * gcc.apple/block-escape-nested-while.c: Add + * gcc.apple/block-escape-for1.c: Add + * gcc.apple/block-noescape-helper-1.c: Add + * gcc.apple/block-escape-return1.c: Add + * gcc.apple/block-noescape-helper-2.c: Add + * gcc.apple/block-blocks-test-2.c: Modified + * gcc.apple/block-blocks-test-3.c: Modified + +2008-07-16 Eugene Marinelli + + Radar 5559195 + * g++.dg/eh/table.C: Add non-trivial operation so that destructor + is not optimized away. + +2008-07-15 Eugene Marinelli + + Radar 5559195 + * g++.apple/empty-destructor-stmt-seq.C: Add + +2008-07-15 Fariborz Jahanian + + Radar 6035389 + * gcc.apple/block-sync-compare-and-swap.c: Add + +2008-07-15 Fariborz Jahanian + + Radar 5988451 + * gcc.apple/block-nested-copied-var.c: Add + * gcc.apple/block-nested-copied-var-1.c: Add + * gcc.apple/block-nested-copied-var-2.c: Add + * gcc.apple/block-nested-copied-var-3.c: Add + +2008-07-14 Eugene Marinelli + + Radar 5559195 + * g++.apple/omit-destructor-call.C: Add + +2008-07-09 Fariborz Jahanian + + Radar 6034839 + * gcc.apple/block-literal-exp.c: Modified + * gcc.apple/block-literal.c: Modified + +2008-07-08 Fariborz Jahanian + + Radar 6061276 + * objc.dg/objc-6061276.m: Add + +2008-07-08 Fariborz Jahanian + + Radar 6048570 + * gcc.apple/block-complicated-type.c: Modified + * gcc.apple/block-local-stack.c: Modified + * gcc.apple/block-literal.c: Modified + +2008-06-19 Eugene Marinelli + + Radar 5923888 + * g++.apple/asm-block-13.C (bar): Use addpd instruction. + * gcc.apple/asm-block-13.c (bar): Use addpd instruction. + +2008-06-16 Fariborz Jahanian + + Radar 5939894 (twik) + * gcc.apple/closure-dup-invoke_impl.c : Add + +2008-06-16 Fariborz Jahanian + + Radar 6003871 + * objc.dg/objc2-6003871.m : Add + +2008-06-13 Fariborz Jahanian + + Radar 5996271 + * objc.dg/encode-int128_t.m: Add + +2008-06-06 Fariborz Jahanian + + Radar 5988451 + * gcc.apple/closure-5988451.c: Add + +2008-06-06 Fariborz Jahanian + + Radar 5992047 + * gcc.apple/closure-5992047.c: Add + +2008-06-05 Fariborz Jahanian + + Radar 5988995 + * gcc.apple/closure-complicated-type.c: Add + +2008-06-05 Fariborz Jahanian + + Radar 5982990 + * objc.dg/sync-objc-exception.m: Add + * obj-c++.dg/sync-objc-exception.mm: Add + +2008-06-04 Fariborz Jahanian + + Radar 5985368 + * gcc.apple/closure-bad-def.c: Add + +2008-06-03 Fariborz Jahanian + + Radar 5982789 + * objc.dg/cfstring-nsstring-type.m: Add + * obj-c++.dg/cfstring-nsstring-type.mm: Add + +2008-06-03 Fariborz Jahanian + + Radar 5887355 + * obj-c++.dg/utf16string-in-functemplate.mm: Add + +2008-06-02 Fariborz Jahanian + + Radar 5976344 + * obj-c++.dg/template-in-impl.mm: Add + +2008-05-30 Josh Conner + + Radar 5933878 + * gcc.c-torture/execute/align-3.c: New test. + +2008-05-28 Josh Conner + + Radar 5939894 + * gcc.apple/closure-debug-[12].c: New tests. + +2008-05-27 Fariborz Jahanian + + Radar 5962694 + * objc.dg/property-in-category.m: Add + +2008-05-23 Fariborz Jahanian + + Radar 5925639 + * objc.dg/objc-foreach-syntax.m: Add + +2008-05-23 Fariborz Jahanian + + Radar 5957801 + * gcc.apple/closure-question-exp.c: Add + +2008-05-23 Fariborz Jahanian + + Radar 5928316 + * gcc.apple/closure-conditional-test.c: Add + +2008-05-23 Fariborz Jahanian + + Radar 5925781 + * gcc.apple/closure-nonnull-test.c: Add + +2008-05-21 Fariborz Jahanian + + Radar 5932809 + * gcc.apple/closure-blocks-test-8.c: Modified. + +2008-05-20 Fariborz Jahanian + + Radar 5932809 + * gcc.apple/closure-blocks-test-8.c: Add + +2008-05-16 Geoff Keating + + Radar 5095227 + * gcc.apple/stack-protect-1.c: New. + +2008-05-16 Fariborz Jahanian + + Radar 5932809 + * gcc.apple/closure-blocks-test-7.c: Add + * gcc.apple/closure-blocks-test-1.c: Add + * gcc.apple/closure-blocks-test-2.c: Add + * gcc.apple/closure-blocks-test-3.c: Add + * gcc.apple/closure-blocks-test-4.c: Add + * gcc.apple/closure-blocks-test-5.c: Add + * gcc.apple/closure-blocks-test-6.c: Add + +2008-05-15 Stuart Hastings + + Radar 5774356 + * testsuite/gcc.apple/5774356.c: Mark as altivec-specific. + +2008-05-12 Fariborz Jahanian + + Radar 5925784 + * gcc.apple/closure-unused-parameter.c : Add + +2008-04-24 Fariborz Jahanian + + Radar 5803005 + * gcc.apple/closure-error-global-byref.c: Modified + * gcc.apple/closure-readonly-diag.c: Modified + * gcc.apple/closure-global-byref-1.c: Add + * gcc.apple/closure-global-implitic-byref.c: Add + +2008-04-23 Caroline Tice + + Radar 5811943 + * gcc.apple/blockpointer.c: New testcase. + +2008-04-23 Fariborz Jahanian + + Radar 5882266 + * gcc.apple/closure-assignweakgc-1.c: Add + +2008-04-23 Fariborz Jahanian + + Radar 5882266 + * gcc.apple/closure-assignweakgc.c: Add + * gcc.apple/closure-readweakgcivar.c: Add + * gcc.apple/closure-readweakgc.c: Add + * gcc.apple/closure-assignweakgcivar.c: Add + +2008-04-22 Fariborz Jahanian + + Radar 5878380 + * gcc.apple/closure-pointer-assignment.c: Add + +2008-04-16 Fariborz Jahanian + + Radar 5868913 + * g++.apple/closure-block-predef.C: Add + +2008-04-14 Fariborz Jahanian + + Radar 5849129 (tweak). + * gcc.apple/closure-encoding.c: Modified for -m64 + +2008-04-10 Fariborz Jahanian + + Radar 5849129 + * gcc.apple/closure-encoding.c: Add + +2008-04-02 Fariborz Jahanian + + Radar 5811599 (minor test change) + * gcc.apple/closure-assigngcivar.c: Modified for ppc32 + +2008-04-02 Fariborz Jahanian + + Radar 5811599 + * gcc.apple/closure-block-property-2.c: Modified + * gcc.apple/closure-nested.c: Modified + * gcc.apple/closure-id-block.c: Modified + * gcc.apple/closure-assigngcivar.c: Modified + * gcc.apple/closure-assigngcstrongcast.c: Modified + * gcc.apple/closure-pointer-type.c: Modified + * gcc.apple/closure-assigngcglobal.c: Modified + * gcc.apple/closure-implicit-byref.c: Modified + * gcc.apple/closure-codegen-1.c: Modified + * gcc.apple/closure-enum.c: Modified + * gcc.apple/closure-global-byref.c: Modified + * gcc.apple/closure-block-property-1.c: Modified + +2008-04-01 Fariborz Jahanian + + Radar 5834569 + * gcc.apple/closure-nounsed-warn.c: Add + +2008-04-01 Fariborz Jahanian + + Radar 5344182 + * objc.dg/dwarf-prototypes.m: Add + +2008-03-31 Fariborz Jahanian + + Radar 5832193 + * gcc.apple/closure-assigngcivar.c: Add + * gcc.apple/closure-assigngcstrongcast.c: Add + * gcc.apple/closure-assigngcglobal.c: Add + +2008-03-31 Fariborz Jahanian + + Radar 5831920 + * gcc.apple/closure-block-property-1.c: Add + * gcc.apple/closure-block-property-2.c: Add + +008-03-31 Fariborz Jahanian + + Radar 5831855 + * gcc.apple/closure-id-block.c: Add + +008-03-28 Fariborz Jahanian + + Radar 5809099 + * gcc.apple/closure-as-object.c: Add + +2008-03-24 Fariborz Jahanian + + Radar 5824092 + * gcc.apple/closure-global-block.c: Add + +2008-03-24 Fariborz Jahanian + + Radar 5811887 + * gcc.apple/closure-c99-off-default.c: Add + * gcc.apple/closure-implicit-byref.c: Modified. + +2008-03-24 Fariborz Jahanian + + Radar 5814025 + * gcc.apple/closure-const.c: Add + +2008-03-24 Fariborz Jahanian + + Radar 5811191 + * gcc.apple/closure-implicit-byrefc: Add + * gcc.apple/closure-ivar.c: Modified + +2008-03-18 Fariborz Jahanian + + Radar 5803600 + * gcc.apple/closure-error-global-byref.c: Add + +2008-03-18 Fariborz Jahanian + + Radar 5805175 + gcc.apple/closure-readonly-diag.c: Add + +2008-03-17 Fariborz Jahanian + + Radar 5803600 + gcc.apple/closure-global-byref.c: Add + +2008-03-13 Fariborz Jahanian + + Radar 5796058 + * gcc.apple/closure-ivar.c: Modified. + +2008-03-12 Fariborz Jahanian + + Radar 5795493 - type matching of closure types + * gcc.apple/closure-pointer-type-match.c: Add + +2008-03-11 Fariborz Jahanian + + Radar 5791701 + * objc.dg/objc2-ivar-layout-bitfield.m: Add + +2008-03-11 Fariborz Jahanian + + Radar 5781140 + * objc.dg/objc2-ivar-layout-empty-struct.m: Add + +2008-03-11 Fariborz Jahanian + + Radar 5732232 (Related to change of command option/macro) + + * gcc.apple/closure-literal-exp.c: Modified + * gcc.apple/closure-nested.c: Modified + * gcc.apple/closure-return.c: Modified + * gcc.apple/closure-continuation.c: Modified + * gcc.apple/closure-misc.c: Modified + * gcc.apple/closure-copy-destroy.c: Modified + * gcc.apple/closure-pointer-type.c: Modified + * gcc.apple/closure-args.c: Modified + * gcc.apple/closure-byref.c: Modified + * gcc.apple/closure-codegen-1.c: Modified + * gcc.apple/closure-enum.c: Modified + * gcc.apple/closure-literal.c: Modified + * gcc.apple/closure-local-stack.c: Modified + * gcc.apple/closure-ivar.c: Modified + * gcc.apple/closure-call.c: Modified + +2008-03-10 Fariborz Jahanian + + Radar 5782740 (ivar tests) + + * gcc.apple/closure-ivar.c: Add + * gcc.apple/closure-copy-destroy.c: Modified + +2008-03-06 Fariborz Jahanian + + Radar 5782740 + * gcc.apple/closure-copy-destroy.c: Add + +2008-03-04 Fariborz Jahanian + + Radar 5774213 + * objc.dg/objc2-no-category-name.m: Add. + +2008-03-03 Fariborz Jahanian + + Radar 5777307 + * objc.dg/optional-property.m: Add + +2008-03-03 Fariborz Jahanian + + Radar 5698469 + * objc.dg/property-warn-default-assign.m: Add + +2008-03-01 Fariborz Jahanian + + Radar 5732232 - Fix a closure pointer type bug. + + * gcc.apple/closure-pointer-type.c: Add + +2008-02-28 Fariborz Jahanian + + Radar 5732232 - Fix nested closure bugs. + + * gcc.apple/closure-nested.c: Add + * gcc.apple/closure-byref.c: Modified. + * gcc.apple/closure-enum.c: Add + +2008-02-27 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-return.c: Modified + * gcc.apple/closure-continuation.c: Modified + * gcc.apple/closure-byref.c: Modified + * gcc.apple/closure-codegen-1.c: Modified + * gcc.apple/closure-call.c: Modified + +2008-02-27 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-codegen-1.c: New + * gcc.apple/closure-literal.c: Modified. + * gcc.apple/closure-literal-exp.c: New + +2008-02-14 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-byref.c: New + +2008-02-13 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-continuation.c: New + +2008-02-13 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-literal.c: Test upgrade. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-literal.c: New. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-local-stack.c: New. + +2008-02-12 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-args.c: New. + +2008-02-11 Fariborz Jahanian + + Radar 5732232 + * gcc.apple/closure-return.c: New + * gcc.apple/closure-misc.c: New + * gcc.apple/closure-call.c: New + +2008-07-22 Josh Conner + + Radar 6077274 + * gcc.apple/visibility-1.c: New test. + +2008-07-15 Josh Conner + + Radar 6062215 + * g++.apple/visibility-3.C: New test. + +2008-06-06 Josh Conner + + Radar 5920116 + * g++.apple/thunks[1-4].C: New tests. + +2008-05-20 Stuart Hastings + + Radar 5774356 + * testsuite/gcc.apple/5774356.c: Mark as altivec-specific. + +2008-05-16 Josh Conner + + Radar 5938756 + * objc.dg/5938756.m: New test. + +2008-05-09 Caroline Tice + + Radar 5839812 + * objc.dg/newproperty-neg-ivar-check-1.m: Move error message + to '@synthesize' line, as that is where the compiler now reports it. + +2008-04-29 Fariborz Jahanian + + Radar 5893391 + * objc.dg/property-id-proto-getter.m: Add + * obj-c++.dg/property-id-proto-getter.mm: Add + +2008-04-29 Caroline Tice + + Radar 5839812 + * objc.dg/AppDelegate.m: Add -mmacosx-version-min and target flags. + +2008-04-23 Caroline Tice + + Radar 5839812 + * objc.dg/AppDelegate.h: New testcase header. + * objc.dg/AppDelegate.m: New testcase file. + +2008-04-15 Fariborz Jahanian + + Radar 5852190 + * objc.dg/property-setter-bug.m: Add + +2008-04-09 Josh Conner + + Radar 5847848 + * gcc.apple/condexec-1.c: New test. + +2008-04-03 Fariborz Jahanian + + Radar 5724385 + * objc.dg/objc2-ivar-offset-2.m: Add + +2008-04-03 Josh Conner + + Radar 5840278 + * gcc.apple/bswap-[1-5].c: New tests. + * gcc.apple/uxtb16-[1-5].c: New tests. + +2008-04-01 Fariborz Jahanian + + Radar 5835805 + * objc.dg/compatibility-alias.m: Add + +2008-04-01 Fariborz Jahanian + + Radar 5344182 + * objc.dg/dwarf-prototypes.m: Add + +2008-03-28 Jim Grosbach + + Radar 5819088 + * gcc.dg/pch/pch.exp: Remove set/unset of MACOSX_DEPLOYMENT_TARGET + until 5823211 is addressed. + +2008-03-31 Josh Conner + + Radar 5782111 + * gcc.apple/ucn-1.c: New test. + +2008-03-28 Jon Ziegler + + Radar 5817940 + * gcc.dg/attr-weakref-1-darwin.c: Remove + -mmacosx-version-min=10.2 for powerpc + +2008-03-27 Fariborz Jahanian + + Radar 5218071 + * objc.dg/property-specialized-1.m: Modified + * objc.dg/property-specialized-2.m: Modified + +2008-03-27 Fariborz Jahanian + + Radar 5822637 + * objc.dg/objc-getter-bug.m + +2008-03-27 Fariborz Jahanian + + Radar 5706927 + * objc.dg/try-catch-15.m: now 32-bit ppc test only + * obj-c++.dg/template-4.mm: now 32-bit ppc test only + * obj-c++.dg/cxx-ivars-3.mm: 32-bit ppc test only + * obj-c++.dg/objc-gc-4.mm: 32-bit ppc test only + +2008-03-26 Fariborz Jahanian + + Radar 5218071 + * objc.dg/property-specialized-1.m: Add + * objc.dg/property-specialized-2.m: Add + +2008-03-24 Josh Conner + + Radar 4382996 + * gcc.apple/arm-ne-zero.c: New test. + +2008-03-24 Jon Ziegler + + Radar 5712367 + * gcc.dg/pch/pch.exp: eliminate environment pollution + +2008-03-20 Fariborz Jahanian + + Radar 5809596 + * obj-c++.dg/cxx-ivars-3.mm: Removed -fobjc-call-cxx-cdtors + * obj-c++.dg/no-offsetof-warn.mm: Removed -fobjc-call-cxx-cdtors + * obj-c++.dg/property-getter-codegen.mm: Removed -fobjc-call-cxx-cdtors + * obj-c++.dg/cxx-ivars-2.mm: Removed -fobjc-call-cxx-cdtors + +2008-03-20 Fariborz Jahanian + + Radar 5802025 + * obj-c++.dg/property-getter-codegen.mm: Add + +2008-03-19 Josh Conner + + Radar 5237050 + * gcc.apple/pubtypes-[1234].c: Fix assembler syntax for ARM. + * g++.apple/pubtypes.C: Likewise. + +2008-03-19 Fariborz Jahanian + + Radar 5471096 + * obj-c++.dg/inline-func-access-category.mm: Add + +2008-03-19 Fariborz Jahanian + + Radar 5733674 + * obj-c++.dg/objc-gc-static-init.mm: Add + +2008-03-18 Josh Conner + + Radar 5804096 + * obj-c++.dg/5599048.mm: Modify test to work on arm-darwin + targets. + * obj-c++.dg/encode-3.mm: Likewise. + * obj-c++.dg/newproperty-copy-3.mm: Likewise. + * obj-c++.dg/objc-instantiate-1.mm: Likewise. + * obj-c++.dg/objc-passby-ref-1.mm: Likewise. + * obj-c++.dg/bitfield-1.mm: Disable test for arm-darwin targets. + * obj-c++.dg/bitfield-4.mm: Likewise. + * obj-c++.dg/const-cfstring-1.mm: Likewise. + * obj-c++.dg/const-str-10.mm: Likewise. + * obj-c++.dg/const-str-11.mm: Likewise. + * obj-c++.dg/const-str-9.mm: Likewise. + * obj-c++.dg/cxx-ivars-3.mm: Likewise. + * obj-c++.dg/defs-warn-1.mm: Likewise. + * obj-c++.dg/defs.mm: Likewise. + * obj-c++.dg/message-metadata-1.mm: Likewise. + * obj-c++.dg/method-11.mm: Likewise. + * obj-c++.dg/objc-bycopy-return-warn-1.mm: Likewise. + * obj-c++.dg/objc-gc-section-1.mm: Likewise. + * obj-c++.dg/objc-visibility-hidden-1.mm: Likewise. + * obj-c++.dg/property-13.mm: Likewise. + * obj-c++.dg/property-4.mm: Likewise. + +2008-03-17 Josh Conner + + Radar 5802633 + * objc.dg/bitfield-3.m: Disable for ARM. + * objc.dg/bitfield-5.m: Likewise. + * objc.dg/const-str-10-64bit.m: Likewise. + * objc.dg/const-str-10.m: Likewise. + * objc.dg/const-str-11-64bit.m: Likewise. + * objc.dg/const-str-11.m: Likewise. + * objc.dg/const-str-13.m: Likewise. + * objc.dg/const-str-9-64bit.m: Likewise. + * objc.dg/const-str-9.m: Likewise. + * objc.dg/defs-warn-1.m: Likewise. + * objc.dg/defs.m: Likewise. + * objc.dg/encode-7.m: Likewise. + * objc.dg/encode-8.m: Likewise. + * objc.dg/format-arg-attribute-1.m: Likewise. + * objc.dg/image-info.m: Likewise. + * objc.dg/method-4.m: Likewise. + * objc.dg/newproperty-copy-3.m: Likewise. + * objc.dg/next-runtime-1-64bit.m: Likewise. + * objc.dg/next-runtime-1.m: Likewise. + * objc.dg/objc-bycopy-return-warn-1.m: Likewise. + * objc.dg/objc-gc-section-1.m: Likewise. + * objc.dg/objc-visibility-hidden-1.m: Likewise. + * objc.dg/optional-property.m: Likewise. + * objc.dg/property-4.m: Likewise. + * objc.dg/pubtypes-id-test.m: Likewise. + * objc.dg/symtab-1-64bit.m: Likewise. + * objc.dg/symtab-1.m: Likewise. + * objc.dg/type-stream-1.m: Likewise. + * objc.dg/zero-link-2.m: Likewise. + * objc.dg/const-cfstring-1.m: Change command-line options for + ARM. + * objc.dg/message-metadata-1.m: Likewise. + * objc.dg/objc2-ivar-offset.m: Likewise. + * objc.dg/objc2-no-category-name.m: Likewise. + * objc.dg/exceptionCodeGenBug.m: Change included headers. + * objc.dg/stret-2.m: Modify test for ARM hybrid ABI. + +2008-03-15 Josh Conner + + Radar 5777572 - take 2 + * iphone-minversion-[1-4].c: Rename to... + * iphoneos-minversion-[1-4].c: ...this. Also, replace all + instances of 'iphone' with 'iphoneos'. + * iphone-minversion-default-[12].c: Rename to... + * iphoneos-minversion-default-[12].c: ...this. Also, replace all + instances of 'iphone' with 'iphoneos'. + * iphone-minversion-err-[1-8].c: Rename to... + * iphoneos-minversion-err-[1-8].c: ...this. Also, replace all + instances of 'iphone' with 'iphoneos'. + +2008-03-13 Josh Conner + + Undo radar 5730079 + * gcc.apple/iphone-minversion-err-1.c: Remove invalid option + checks. + +2008-03-13 Josh Conner + + Radar 5777572 + * aspen-minversion-[1-4].c: Rename to... + * iphone-minversion-[1-4].c: ...this. Also, replace all + instances of 'aspen' with 'iphone'. + * aspen-minversion-default-[12].c: Rename to... + * iphone-minversion-default-[12].c: ...this. Also, replace all + instances of 'aspen' with 'iphone'. + * aspen-minversion-err-[1-8].c: Rename to... + * iphone-minversion-err-[1-8].c: ...this. Also, replace all + instances of 'aspen' with 'iphone'. + +2008-03-11 Fariborz Jahanian + + Radar 5791701 + * objc.dg/objc2-ivar-layout-bitfield.m: Add + +2008-03-11 Fariborz Jahanian + + Radar 5781140 + * objc.dg/objc2-ivar-layout-empty-struct.m: Add + +2008-03-05 Josh Conner + + Radar 5605886 + * g++.dg/kext4.C: Only run on ppc and x86. + +2008-03-04 Caroline Tice + + Radar 4874405 + * gcc.dg/debug/dwarf2/dwarf-char1.c: Fix to work correctly + on non-darwin architectures as well. + * gcc.dg/debug/dwarf2/dwarf-char2.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-char3.c: Likewise. + +2008-03-04 Caroline Tice + + Radar 4874405 + * gcc.dg/debug/dwarf2/dwarf-char1.c: Fix to work correctly + with __CFConstantStringClassReference. + * gcc.dg/debug/dwarf2/dwarf-char2.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-char3.c: Likewise. + +2008-03-04 Fariborz Jahanian + + Radar 5774213 + * objc.dg/objc2-no-category-name.m: Add. + +2008-03-03 Fariborz Jahanian + + Radar 5777307 + * objc.dg/optional-property.m: Add + +2008-03-03 Fariborz Jahanian + + Radar 5698469 + * objc.dg/property-warn-default-assign.m: Add + +2008-02-29 Josh Conner + + Radar 5730079 + * gcc.apple/aspen-minversion-err-1.c: Add ppc- and ARM-specific + error tests. + * gcc.dg/darwin-minversion-1.c: Only run test on powerpc and + i386. + * gcc.dg/darwin-minversion-2.c: Likewise. + * gcc.dg/darwin-version-1.c: Likewise. + * gcc.dg/pie-link.c: Likewise. + * objc.dg/const-cfstring-4-64bit.m: Likewise. + * objc.dg/encode-7-64bit.m: Likewise. + * objc.dg/format-arg-attribute-2.m: Likewise. + * objc.dg/format-arg-attribute-3.m: Likewise. + * objc.dg/newproperty-forward-class-1.m: Likewise. + * objc.dg/newproperty-protocol-type.m: Likewise. + * objc.dg/newproperty-typedef-mangle-1.m: Likewise. + * objc.dg/newproperty-unimplemented-property-1.m: Likewise. + * objc.dg/newproperty-weak-attribute-2.m: Likewise. + * objc.dg/newproperty-weak-attribute-3.m: Likewise. + * objc.dg/objc-dir-dispatch.m: Likewise. + * objc.dg/objc-dir-dispatch-64.m: Likewise. + * objc.dg/objc2-const-str-64bit-1.m: Likewise. + * objc.dg/objc2-defs-ok.m: Likewise. + * objc.dg/objc2-ivar-layout-2.m: Likewise. + * objc.dg/objc2-ivar-layout-3.m: Likewise. + * objc.dg/objc2-ivar-layout-4.m: Likewise. + * objc.dg/objc2-ivar-layout-array.m: Likewise. + * objc.dg/objc2-ivar-layout-array-1.m: Likewise. + * objc.dg/objc2-ivar-layout-array-2.m: Likewise. + * objc.dg/objc2-ivar-layout-array-3.m: Likewise. + * objc.dg/objc2-ivar-layout-array-4.m: Likewise. + * objc.dg/objc2-ivar-layout-array-5.m: Likewise. + * objc.dg/objc2-ivar-layout-array-6.m: Likewise. + * objc.dg/objc2-ivar-layout-array-7.m: Likewise. + * objc.dg/objc2-ivar-layout-array-8.m: Likewise. + * objc.dg/objc2-protocol-ext-1.m: Likewise. + * objc.dg/objc2-try-catch-neg-1.m: Likewise. + * objc.dg/objc2-warn-prev-osx-1.m: Likewise. + * objc.dg/property-11.m: Likewise. + * objc.dg/property-metadata-1.m: Likewise. + * objc.dg/stubify-2.m: Likewise. + * objc.dg/try-catch-15.m: Likewise. + * obj-c++.dg/const-cfstring-4-64bit.mm: Likewise. + * obj-c++.dg/cxx-ivars-4.mm: Likewise. + * obj-c++.dg/encode-3-64bit.mm: Likewise. + * obj-c++.dg/method-copyctor-1.mm: Likewise. + * obj-c++.dg/newproperty-protocol-type.mm: Likewise. + * obj-c++.dg/newproperty-typedef-mangle-1.mm: Likewise. + * obj-c++.dg/newproperty-unimplemented-property-1.mm: Likewise. + * obj-c++.dg/newproperty-weak-attribute-2.mm: Likewise. + * obj-c++.dg/newproperty-weak-attribute-3.mm: Likewise. + * obj-c++.dg/objc-gc-4.mm: Likewise. + * obj-c++.dg/objc2-defs-ok.mm: Likewise. + * obj-c++.dg/objc2-instanceSizeStart-1.mm: Likewise. + * obj-c++.dg/objc2-ivar-test-2.mm: Likewise. + * obj-c++.dg/objc2-protocol-ext-1.mm: Likewise. + * obj-c++.dg/objc2-try-catch-neg-1.mm: Likewise. + * obj-c++.dg/objc2-warn-prev-osx-1.mm: Likewise. + * obj-c++.dg/property-11.mm: Likewise. + * gcc.apple/aspen-minversion-1.c: Only run test on i386 and ARM. + * gcc.apple/aspen-minversion-2.c: Likewise. + * gcc.apple/aspen-minversion-3.c: Likewise. + * gcc.apple/aspen-minversion-4.c: Likewise. + * gcc.apple/aspen-minversion-err-2.c: Likewise. + * gcc.apple/aspen-minversion-err-3.c: Likewise. + * gcc.apple/aspen-minversion-err-4.c: Likewise. + * gcc.apple/aspen-minversion-err-5.c: Likewise. + * gcc.apple/aspen-minversion-err-6.c: Likewise. + * gcc.apple/aspen-minversion-err-7.c: Likewise. + * gcc.apple/aspen-minversion-err-8.c: Likewise. + * gcc.apple/uninit-test-1.c: Don't pass -mmacosx-version-min on ARM. + * obj-c++.dg/class-attribute-1.mm: Likewise. + * obj-c++.dg/const-str-13.mm: Likewise. + * obj-c++.dg/cxx-ivars-3.mm: Likewise. + * obj-c++.dg/cxx-typeconv-func-1.mm: Likewise. + * obj-c++.dg/enhanced-proto-4.mm: Likewise. + * obj-c++.dg/message-metadata-1.mm: Likewise. + * obj-c++.dg/newproperty-1.mm: Likewise. + * obj-c++.dg/newproperty-2.mm: Likewise. + * obj-c++.dg/newproperty-3.mm: Likewise. + * obj-c++.dg/newproperty-4.mm: Likewise. + * obj-c++.dg/newproperty-5.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-1.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-2.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-3.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-4.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-5.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-6.mm: Likewise. + * obj-c++.dg/newproperty-anon-category-7.mm: Likewise. + * obj-c++.dg/newproperty-atomic-neg-1.mm: Likewise. + * obj-c++.dg/newproperty-bitfield-1.mm: Likewise. + * obj-c++.dg/newproperty-category-impl-1.mm: Likewise. + * obj-c++.dg/newproperty-class-method-1.mm: Likewise. + * obj-c++.dg/newproperty-class-method-2.mm: Likewise. + * obj-c++.dg/newproperty-compound-setter-1.mm: Likewise. + * obj-c++.dg/newproperty-copy-2.mm: Likewise. + * obj-c++.dg/newproperty-copy-3.mm: Likewise. + * obj-c++.dg/newproperty-deprecated-attr-1.mm: Likewise. + * obj-c++.dg/newproperty-dot-syntax-1.mm: Likewise. + * obj-c++.dg/newproperty-dotsyntax-setter-getter-1.mm: Likewise. + * obj-c++.dg/newproperty-dotsyntax-setter-getter-2.mm: Likewise. + * obj-c++.dg/newproperty-impl-nowarn-1.mm: Likewise. + * obj-c++.dg/newproperty-lookup-1.mm: Likewise. + * obj-c++.dg/newproperty-lookup-2.mm: Likewise. + * obj-c++.dg/newproperty-lookup-3.mm: Likewise. + * obj-c++.dg/newproperty-lookup-4.mm: Likewise. + * obj-c++.dg/newproperty-lookup-5.mm: Likewise. + * obj-c++.dg/newproperty-lookup-6.mm: Likewise. + * obj-c++.dg/newproperty-neg-ivar-check-1.mm: Likewise. + * obj-c++.dg/newproperty-neg-warn-ro-1.mm: Likewise. + * obj-c++.dg/newproperty-neg-warn-unimp-1.mm: Likewise. + * obj-c++.dg/newproperty-nested-synthesis-1.mm: Likewise. + * obj-c++.dg/newproperty-no-category-synthesis.mm: Likewise. + * obj-c++.dg/newproperty-nowarn-compound-exp.mm: Likewise. + * obj-c++.dg/newproperty-nowarn-default-assign-1.mm: Likewise. + * obj-c++.dg/newproperty-nowarn-unused-param.mm: Likewise. + * obj-c++.dg/newproperty-protocol-lookup-1.mm: Likewise. + * obj-c++.dg/newproperty-redundant-decl-accessor.mm: Likewise. + * obj-c++.dg/newproperty-retain-1.mm: Likewise. + * obj-c++.dg/newproperty-retain-2.mm: Likewise. + * obj-c++.dg/newproperty-setter-decl-1.mm: Likewise. + * obj-c++.dg/newproperty-setter-getter-1.mm: Likewise. + * obj-c++.dg/newproperty-setter-getter-attr-1.mm: Likewise. + * obj-c++.dg/newproperty-struct-val-1.mm: Likewise. + * obj-c++.dg/newproperty-syntax-1.mm: Likewise. + * obj-c++.dg/newproperty-type-conv-1.mm: Likewise. + * obj-c++.dg/newproperty-warn-cont-class-1.mm: Likewise. + * obj-c++.dg/newproperty-warn-direct-ivar-access.mm: Likewise. + * obj-c++.dg/newproperty-weak-attribute-1.mm: Likewise. + * obj-c++.dg/objc-foreach-1.mm: Likewise. + * obj-c++.dg/objc-foreach-10.mm: Likewise. + * obj-c++.dg/objc-foreach-11.mm: Likewise. + * obj-c++.dg/objc-foreach-2.mm: Likewise. + * obj-c++.dg/objc-foreach-3.mm: Likewise. + * obj-c++.dg/objc-foreach-4.mm: Likewise. + * obj-c++.dg/objc-foreach-5.mm: Likewise. + * obj-c++.dg/objc-foreach-6.mm: Likewise. + * obj-c++.dg/objc-foreach-7.mm: Likewise. + * obj-c++.dg/objc-foreach-8.mm: Likewise. + * obj-c++.dg/objc-foreach-9.mm: Likewise. + * obj-c++.dg/objc-foreach-elem-collection-elem.mm: Likewise. + * obj-c++.dg/objc-foreach-lvalue-1.mm: Likewise. + * obj-c++.dg/objc-visibility-hidden-1.mm: Likewise. + * obj-c++.dg/objc2-4698856.mm: Likewise. + * obj-c++.dg/objc2-bitfield-abi-1.mm: Likewise. + * obj-c++.dg/objc2-cplus-try-catch-1.mm: Likewise. + * obj-c++.dg/objc2-ivar-test-1.mm: Likewise. + * obj-c++.dg/objc2-none-fragile-ivar-use.mm: Likewise. + * obj-c++.dg/objc2-package-ivar-1.mm: Likewise. + * obj-c++.dg/objc2-protocol-1.mm: Likewise. + * obj-c++.dg/objc2-protocol-2.mm: Likewise. + * obj-c++.dg/objc2-protocol-4.mm: Likewise. + * obj-c++.dg/objc2-protocol-5.mm: Likewise. + * obj-c++.dg/objc2-protocol-7.mm: Likewise. + * obj-c++.dg/objc2-protocol-9.mm: Likewise. + * obj-c++.dg/objc2-super-class-1.mm: Likewise. + * obj-c++.dg/objc2-visibility-hidden-1.mm: Likewise. + * obj-c++.dg/objc2-visibility-hidden-2.mm: Likewise. + * obj-c++.dg/property-1.mm: Likewise. + * obj-c++.dg/property-10.mm: Likewise. + * obj-c++.dg/property-12.mm: Likewise. + * obj-c++.dg/property-13.mm: Likewise. + * obj-c++.dg/property-14.mm: Likewise. + * obj-c++.dg/property-15.mm: Likewise. + * obj-c++.dg/property-2.mm: Likewise. + * obj-c++.dg/property-3.mm: Likewise. + * obj-c++.dg/property-4.mm: Likewise. + * obj-c++.dg/property-5.mm: Likewise. + * obj-c++.dg/property-6.mm: Likewise. + * obj-c++.dg/property-7.mm: Likewise. + * obj-c++.dg/property-8.mm: Likewise. + * obj-c++.dg/property-9.mm: Likewise. + * obj-c++.dg/property-dwarf-1.mm: Likewise. + * obj-c++.dg/property-incr-decr-1.mm: Likewise. + * obj-c++.dg/property-metadata-1.mm: Likewise. + * obj-c++.dg/property-neg-1.mm: Likewise. + * obj-c++.dg/property-neg-2.mm: Likewise. + * obj-c++.dg/property-neg-3.mm: Likewise. + * obj-c++.dg/property-neg-4.mm: Likewise. + * obj-c++.dg/protocol-atttribute-1.mm: Likewise. + * obj-c++.dg/stubify-2.mm: Likewise. + * obj-c++.dg/template-4.mm: Likewise. + * objc.dg/class-attribute-1.m: Likewise. + * objc.dg/const-str-13.m: Likewise. + * objc.dg/enhanced-proto-4.m: Likewise. + * objc.dg/format-arg-attribute-1.m: Likewise. + * objc.dg/message-metadata-1.m: Likewise. + * objc.dg/newproperty-1.m: Likewise. + * objc.dg/newproperty-2.m: Likewise. + * objc.dg/newproperty-3.m: Likewise. + * objc.dg/newproperty-4.m: Likewise. + * objc.dg/newproperty-5.m: Likewise. + * objc.dg/newproperty-anon-category-1.m: Likewise. + * objc.dg/newproperty-anon-category-2.m: Likewise. + * objc.dg/newproperty-anon-category-3.m: Likewise. + * objc.dg/newproperty-anon-category-4.m: Likewise. + * objc.dg/newproperty-anon-category-5.m: Likewise. + * objc.dg/newproperty-anon-category-6.m: Likewise. + * objc.dg/newproperty-anon-category-7.m: Likewise. + * objc.dg/newproperty-atomic-neg-1.m: Likewise. + * objc.dg/newproperty-attr-encode-1.m: Likewise. + * objc.dg/newproperty-bitfield-1.m: Likewise. + * objc.dg/newproperty-category-impl-1.m: Likewise. + * objc.dg/newproperty-class-method-1.m: Likewise. + * objc.dg/newproperty-class-method-2.m: Likewise. + * objc.dg/newproperty-compound-setter-1.m: Likewise. + * objc.dg/newproperty-copy-2.m: Likewise. + * objc.dg/newproperty-copy-3.m: Likewise. + * objc.dg/newproperty-deprecated-attr-1.m: Likewise. + * objc.dg/newproperty-dot-syntax-1.m: Likewise. + * objc.dg/newproperty-dotsyntax-setter-getter-1.m: Likewise. + * objc.dg/newproperty-dotsyntax-setter-getter-2.m: Likewise. + * objc.dg/newproperty-dotsyntax-warn-setter-1.m: Likewise. + * objc.dg/newproperty-impl-nowarn-1.m: Likewise. + * objc.dg/newproperty-lookup-1.m: Likewise. + * objc.dg/newproperty-lookup-2.m: Likewise. + * objc.dg/newproperty-lookup-3.m: Likewise. + * objc.dg/newproperty-lookup-4.m: Likewise. + * objc.dg/newproperty-lookup-5.m: Likewise. + * objc.dg/newproperty-lookup-6.m: Likewise. + * objc.dg/newproperty-neg-1.m: Likewise. + * objc.dg/newproperty-neg-error-bad-impl-1.m: Likewise. + * objc.dg/newproperty-neg-ivar-check-1.m: Likewise. + * objc.dg/newproperty-neg-warn-ro-1.m: Likewise. + * objc.dg/newproperty-neg-warn-unimp-1.m: Likewise. + * objc.dg/newproperty-nested-synthesis-1.m: Likewise. + * objc.dg/newproperty-no-category-synthesis.m: Likewise. + * objc.dg/newproperty-nowarn-compound-exp.m: Likewise. + * objc.dg/newproperty-nowarn-default-assign-1.m: Likewise. + * objc.dg/newproperty-nowarn-readonly-1.m: Likewise. + * objc.dg/newproperty-protocol-lookup-1.m: Likewise. + * objc.dg/newproperty-redundant-decl-accessor.m: Likewise. + * objc.dg/newproperty-retain-1.m: Likewise. + * objc.dg/newproperty-retain-2.m: Likewise. + * objc.dg/newproperty-setter-decl-1.m: Likewise. + * objc.dg/newproperty-setter-getter-1.m: Likewise. + * objc.dg/newproperty-setter-getter-attr-1.m: Likewise. + * objc.dg/newproperty-setter-name.m: Likewise. + * objc.dg/newproperty-syntax-1.m: Likewise. + * objc.dg/newproperty-type-conv-1.m: Likewise. + * objc.dg/newproperty-warn-cont-class-1.m: Likewise. + * objc.dg/newproperty-warn-direct-ivar-access.m: Likewise. + * objc.dg/newproperty-weak-attribute-1.m: Likewise. + * objc.dg/objc-foreach-1.m: Likewise. + * objc.dg/objc-foreach-10.m: Likewise. + * objc.dg/objc-foreach-11.m: Likewise. + * objc.dg/objc-foreach-2.m: Likewise. + * objc.dg/objc-foreach-3.m: Likewise. + * objc.dg/objc-foreach-4.m: Likewise. + * objc.dg/objc-foreach-5.m: Likewise. + * objc.dg/objc-foreach-6.m: Likewise. + * objc.dg/objc-foreach-7.m: Likewise. + * objc.dg/objc-foreach-8.m: Likewise. + * objc.dg/objc-foreach-9.m: Likewise. + * objc.dg/objc-foreach-elem-collection-elem.m: Likewise. + * objc.dg/objc-foreach-lvalue-1.m: Likewise. + * objc.dg/objc-gc-assign-ivar-2.m: Likewise. + * objc.dg/objc-visibility-hidden-1.m: Likewise. + * objc.dg/objc2-4698856.m: Likewise. + * objc.dg/objc2-bitfield-abi-1.m: Likewise. + * objc.dg/objc2-ivar-test-1.m: Likewise. + * objc.dg/objc2-ivar-test-2.m: Likewise. + * objc.dg/objc2-none-fragile-ivar-use.m: Likewise. + * objc.dg/objc2-package-ivar-1.m: Likewise. + * objc.dg/objc2-protocol-1.m: Likewise. + * objc.dg/objc2-protocol-2.m: Likewise. + * objc.dg/objc2-protocol-4.m: Likewise. + * objc.dg/objc2-protocol-5.m: Likewise. + * objc.dg/objc2-protocol-7.m: Likewise. + * objc.dg/objc2-protocol-9.m: Likewise. + * objc.dg/objc2-protocol-enc-1.m: Likewise. + * objc.dg/objc2-super-class-1.m: Likewise. + * objc.dg/objc2-try-catch-1.m: Likewise. + * objc.dg/objc2-visibility-hidden-1.m: Likewise. + * objc.dg/objc2-visibility-hidden-2.m: Likewise. + * objc.dg/objc2.m: Likewise. + * objc.dg/property-1.m: Likewise. + * objc.dg/property-10.m: Likewise. + * objc.dg/property-12.m: Likewise. + * objc.dg/property-13.m: Likewise. + * objc.dg/property-14.m: Likewise. + * objc.dg/property-15.m: Likewise. + * objc.dg/property-2.m: Likewise. + * objc.dg/property-3.m: Likewise. + * objc.dg/property-4.m: Likewise. + * objc.dg/property-5.m: Likewise. + * objc.dg/property-6.m: Likewise. + * objc.dg/property-7.m: Likewise. + * objc.dg/property-8.m: Likewise. + * objc.dg/property-9.m: Likewise. + * objc.dg/property-dwarf-1.m: Likewise. + * objc.dg/property-incr-decr-1.m: Likewise. + * objc.dg/property-neg-1.m: Likewise. + * objc.dg/property-neg-2.m: Likewise. + * objc.dg/property-neg-3.m: Likewise. + * objc.dg/property-neg-4.m: Likewise. + * objc.dg/property-neg-5.m: Likewise. + * objc.dg/protocol-atttribute-1.m: Likewise. + * objc.dg/stubify-1.m: Likewise. + +2008-02-25 Caroline Tice + + Radar 5741070 + * gcc.objc/dwarf-method-dispatch.m: New testcase. + * gcc.obj-c++/dwarf-method-dispatch.mm: New testcase. + +2008-02-19 Caroline Tice + + Radar 2338865 + * gcc.apple/dwarf-optimized-1.c: New testcase for DW_AT_APPLE_optimized + * gcc.apple/dwarf-optimized-2.c: Likewise. + * gcc.apple/dwarf-optimzied-3.c: Likewise. + +2008-02-14 Josh Conner + + Radar 5660282 + * lib/target-supports.exp (check_effective_target_objc_gc): New + function. + * objc.dg/objc-gc-weak-3.m: Require objc_gc target support. + * objc.dg/objc2-ivar-layout-array-8.m: Likewise. + * objc.dg/objc-gc-3.m: Likewise. + * objc.dg/objc-gc-10.m: Likewise. + * objc.dg/newproperty-weak-attribute-2.m: Likewise. + * objc.dg/objc2-ivar-layout-array-1.m: Likewise. + * objc.dg/objc-gc-weak-4.m: Likewise. + * objc.dg/newproperty-nowarn-default-assign.m: Likewise. + * objc.dg/objc-gc-4.m: Likewise. + * objc.dg/objc2-ivar-layout-1.m: Likewise. + * objc.dg/newproperty-weak-attribute-3.m: Likewise. + * objc.dg/objc2-ivar-layout-array-2.m: Likewise. + * objc.dg/objc-gc-5.m: Likewise. + * objc.dg/newproperty-atomicretained.m: Likewise. + * objc.dg/newproperty-warn-weak-1.m: Likewise. + * objc.dg/objc2-ivar-layout-2.m: Likewise. + * objc.dg/objc2-ivar-layout-array-3.m: Likewise. + * objc.dg/objc-gc-section-2.m: Likewise. + * objc.dg/objc-gc-6.m: Likewise. + * objc.dg/const-cfstring-8.m: Likewise. + * objc.dg/objc-weak-pointer.m: Likewise. + * objc.dg/objc2-ivar-layout-3.m: Likewise. + * objc.dg/objc-gc-assign-ivar-1.m: Likewise. + * objc.dg/objc2-ivar-layout-array-4.m: Likewise. + * objc.dg/objc-gc-7.m: Likewise. + * objc.dg/newproperty-atomiccopy.m: Likewise. + * objc.dg/objc-fast-1.m: Likewise. + * objc.dg/objc2-ivar-layout-4.m: Likewise. + * objc.dg/objc2-ivar-layout-array.m: Likewise. + * objc.dg/objc2-ivar-layout-array-5.m: Likewise. + * objc.dg/objc-gc-8.m: Likewise. + * objc.dg/newproperty-atomicretained-1.m: Likewise. + * objc.dg/objc-gc-aggr-assign-1.m: Likewise. + * objc.dg/objc-fast-2.m: Likewise. + * objc.dg/objc-gc-weak-1.m: Likewise. + * objc.dg/objc2-ivar-layout-array-6.m: Likewise. + * objc.dg/objc-gc-1.m: Likewise. + * objc.dg/objc-gc-9.m: Likewise. + * objc.dg/newproperty-forward-class-1.m: Likewise. + * objc.dg/newproperty-atomiccopy-1.m: Likewise. + * objc.dg/objc-fast-3.m: Likewise. + * objc.dg/newproperty-protocol-type.m: Likewise. + * objc.dg/objc-gc-weak-2.m: Likewise. + * objc.dg/objc2-ivar-layout-array-7.m: Likewise. + * objc.dg/objc-gc-2.m: Likewise. + * obj-c++.dg/objc-gc-7.mm: Likewise. + * obj-c++.dg/objc-gc-2.mm: Likewise. + * obj-c++.dg/objc-fast-2.mm: Likewise. + * obj-c++.dg/objc-gc-10.mm: Likewise. + * obj-c++.dg/objc-gc-weak-1.mm: Likewise. + * obj-c++.dg/objc-gc-8.mm: Likewise. + * obj-c++.dg/objc-gc-3.mm: Likewise. + * obj-c++.dg/newproperty-weak-attribute-2.mm: Likewise. + * obj-c++.dg/objc-fast-3.mm: Likewise. + * obj-c++.dg/objc-gc-11.mm: Likewise. + * obj-c++.dg/objc-gc-weak-2.mm: Likewise. + * obj-c++.dg/newproperty-nowarn-default-assign.mm: Likewise. + * obj-c++.dg/objc-gc-9.mm: Likewise. + * obj-c++.dg/objc-weak-pointer.mm: Likewise. + * obj-c++.dg/no-offsetof-warn.mm: Likewise. + * obj-c++.dg/objc-gc-4.mm: Likewise. + * obj-c++.dg/newproperty-weak-attribute-3.mm: Likewise. + * obj-c++.dg/newproperty-atomicretained.mm: Likewise. + * obj-c++.dg/objc-gc-weak-3.mm: Likewise. + * obj-c++.dg/newproperty-protocol-type.mm: Likewise. + * obj-c++.dg/objc-gc-5.mm: Likewise. + * obj-c++.dg/objc-gc-assign-ivar-1.mm: Likewise. + * obj-c++.dg/objc-gc-section-2.mm: Likewise. + * obj-c++.dg/syntax-error-8.mm: Likewise. + * obj-c++.dg/objc-gc-weak-4.mm: Likewise. + * obj-c++.dg/newproperty-atomiccopy.mm: Likewise. + * obj-c++.dg/newproperty-atomicretained-1.mm: Likewise. + * obj-c++.dg/objc-gc-aggr-assign-1.mm: Likewise. + * obj-c++.dg/objc-gc-6.mm: Likewise. + * obj-c++.dg/newproperty-atomiccopy-1.mm: Likewise. + * obj-c++.dg/objc-gc-1.mm: Likewise. + * obj-c++.dg/objc-gc-weak-5.mm: Likewise. + * obj-c++.dg/objc-fast-1.mm: Likewise. + +2008-02-14 Fariborz Jahanian + + Radar 5724385 + * obj-c++.dg/objc2-ivar-offset.mm: New + * objc.dg/objc2-ivar-offset.m: New + +2008-02-06 Josh Conner + + Radar 5726269 + * objc.dg/objc2.c: New test. + +2008-01-30 Josh Conner + + Radar 5683689 + * gcc.apple/iphone-minversion-[1-4].c: Rename to... + * gcc.apple/aspen-minversion-[1-4].c: ...this. Also, + change all iphone references to aspen. + * gcc.apple/iphone-minversion-err-[1-8].c: Rename to... + * gcc.apple/aspen-minversion-err-[1-8].c: ...this. + Also, change all iphone references to aspen. + * gcc.apple/iphone-minversion-default-[12].c: Rename to... + * gcc.apple/aspen-minversion-default-[12].c: ... this. + Also, change all iphone references to aspen. + +2008-01-25 Josh Conner + + Radar 5660282 + * obj-c++.dg/no-offsetof-warn.mm: Only enable for ppc and x86 + targets. + * obj-c++.dg/objc-gc-1.mm: Likewise. + * obj-c++.dg/objc-gc-10.mm: Likewise. + * obj-c++.dg/objc-gc-11.mm: Likewise. + * obj-c++.dg/objc-gc-2.mm: Likewise. + * obj-c++.dg/objc-gc-3.mm: Likewise. + * obj-c++.dg/objc-gc-5.mm: Likewise. + * obj-c++.dg/objc-gc-6.mm: Likewise. + * obj-c++.dg/objc-gc-7.mm: Likewise. + * obj-c++.dg/objc-gc-8.mm: Likewise. + * obj-c++.dg/objc-gc-9.mm: Likewise. + * obj-c++.dg/objc-gc-assign-ivar-1.mm: Likewise. + * obj-c++.dg/objc-gc-section-2.mm: Likewise. + * obj-c++.dg/objc-gc-weak-1.mm: Likewise. + * obj-c++.dg/objc-gc-weak-2.mm: Likewise. + * obj-c++.dg/objc-gc-weak-3.mm: Likewise. + * obj-c++.dg/objc-gc-weak-4.mm: Likewise. + * obj-c++.dg/objc-gc-weak-5.mm: Likewise. + * obj-c++.dg/objc-weak-pointer.mm: Likewise. + * obj-c++.dg/syntax-error-8.mm: Likewise. + * objc.dg/objc-gc-1.m: Likewise. + * objc.dg/objc-gc-10.m: Likewise. + * objc.dg/objc-gc-2.m: Likewise. + * objc.dg/objc-gc-3.m: Likewise. + * objc.dg/objc-gc-4.m: Likewise. + * objc.dg/objc-gc-5.m: Likewise. + * objc.dg/objc-gc-6.m: Likewise. + * objc.dg/objc-gc-7.m: Likewise. + * objc.dg/objc-gc-8.m: Likewise. + * objc.dg/objc-gc-9.m: Likewise. + * objc.dg/objc-gc-assign-ivar-1.m: Likewise. + * objc.dg/objc-gc-section-2.m: Likewise. + * objc.dg/objc-gc-weak-1.m: Likewise. + * objc.dg/objc-gc-weak-2.m: Likewise. + * objc.dg/objc-gc-weak-3.m: Likewise. + * objc.dg/objc-gc-weak-4.m: Likewise. + * objc.dg/objc-weak-pointer.m: Likewise. + +2008-01-23 Hui-May Chang + + Radar 5618945 + * gcc.apple/5618945-1.c : New. + * gcc.apple/5618945-2.c : New. + * gcc.apple/5618945-3.c : New. + +2008-01-22 Josh Conner + + Radar 5683689 + * gcc.apple/iphone-minversion-1.c: New test. + * gcc.apple/iphone-minversion-2.c: New test. + * gcc.apple/iphone-minversion-3.c: New test. + * gcc.apple/iphone-minversion-4.c: New test. + * gcc.apple/iphone-minversion-err-1.c: New test. + * gcc.apple/iphone-minversion-err-2.c: New test. + * gcc.apple/iphone-minversion-err-3.c: New test. + * gcc.apple/iphone-minversion-err-4.c: New test. + * gcc.apple/iphone-minversion-err-5.c: New test. + * gcc.apple/iphone-minversion-err-6.c: New test. + * gcc.apple/iphone-minversion-err-7.c: New test. + * gcc.apple/iphone-minversion-err-8.c: New test. + * gcc.apple/iphone-minversion-default-1.c: New test. + * gcc.apple/iphone-minversion-default-2.c: New test. + +2008-01-21 Caroline Tice + + Radar 5636185 + * g++.apple/local.C: New testcase. + * g++.apple/namespace.C: New testcase. + +2008-01-16 Fariborz Jahanian + + Radar 5370783 + * objc.dg/method-21.m: Add + +2008-01-14 Fariborz Jahanian + + Radar 5676962 + * objc.dg/proto-bad-propagate-2.m: Add + * obj-c++.dg/proto-bad-propagate-2.mm : Add + +2008-01-10 Josh Conner + + Radar 5675908 + * objc.dg/objc-gc-assign-ivar-2.m: New file. + +2007-12-19 Caroline Tice + + Radar 5569774 + + Backport from FSF 4.2: + 2007-07-25 Dorit Nuzman + Devang Patel + Uros Bizjak + PR tree-optimization/25413 + * lib/target-supports.exp + (check_effective_target_vect_aligned_arrays): + New procedure to check if arrays are naturally aligned to the + vector alignment boundary. + * gcc.dg/vect/vect-align-1.c: New. + * gcc.dg/vect/vect-align-2.c: New. + * gcc.dg/vect/pr25413.c: New. + * gcc.dg/vect/pr25413a.c: New. + +2007-12-10 Hui-May Chang + + Radar 4891561 + * gcc.target/i386/4891561.c: Fixed APPLE LOCAL marker. + +2007-12-06 Hui-May Chang + + Radar 4891561 + * gcc.target/i386/4891561.c: New. + +2007-12-06 Hui-May Chang + + Radar 5599048 + * obj-c++.dg/5599048.mm: Added target darwin. + +2007-12-05 Hui-May Chang + + Radar 5599048 + * obj-c++.dg/5599048.mm: New. + +2007-11-30 Hui-May Chang + + Radar 5596043 + * g++.apple/5596043.C: New. + +2007-11-29 Hui-May Chang + + Radar 5612779 + * gcc.apple/5612779.c: New. + +2007-11-29 Fariborz Jahanian + + Radar 5619052 + * obj-c++.dg/encode-template.mm: Add + +2007-11-29 Fariborz Jahanian + + Radar 5607453 + * objc.dg/newproperty-protocol-type.m: Add + * obj-c++.dg/newproperty-protocol-type.mm: Add + +2007-11-28 Fariborz Jahanian + + Radar 5610134 + * objc.dg/newproperty-retain-3.m: Add + * objc.dg/newproperty-retain-4.m: Add + * obj-c++.dg/newproperty-retain-3.mm: Add + * obj-c++.dg/newproperty-retain-4.mm: Add + +2007-11-28 Hui-May Chang + + Radar 5591491 + * g++.apple/5591491.C: New. + +2007-11-27 Josh Conner + + * g++.old-deja/g++.abi/align2.C: Add ARM support. + * g++.dg/align-test-1.C: Likewise. + * g++.dg/pch/debug-1.Hs: Change Carbon.h include to + CoreFoundation.h. + * g++.apple/pubtypes.C: Accept '@' as a comment delimiter. + +2007-11-16 Josh Conner + + * gcc.c-torture/execute/builtins/builtins.exp: On arm-*-darwin*, + enable builtin_strcat and builtin_strcpy. + * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: On + arm-*-darwin*, compile with -msoft-float. + * gcc.c-torture/execute/ieee/20000320-1.x: New file. + * gcc.dg/arm-mmx-1.c: Skip on arm*-apple-darwin*. + * gcc.dg/trampoline-1.c: Likewise. + * gcc.dg/framework-1.c: Only compile for powerpc and i?86 darwin + targets. + * gcc.apple/pubtypes-[1234].c: Allow '@' as comment delimiter. + * lib/target-supports.exp (check_profiling_available): Disable + profiling support on arm*-*-darwin*. + +2007-11-14 Josh Conner + + Radar 5597292 + * gcc.apple/5597292.c: New file. + +2007-11-13 Hui-May Chang + + Radar 4877693 + * gcc.apple/4877693.c: New. + +2007-11-09 Eric Christopher + + Radar 5582941 + * gcc.apple/sync-1.c: New. + 2007-10-30 Hui-May Chang Radar 5543378 @@ -9,12 +1492,12 @@ * gcc.dg/flt-rounds.c: New. 2007-10-19 Hui-May Chang - + Radar 5450903 * gcc.apple/ppc-5450903.c: New. 2007-10-15 Hui-May Chang - + Radar 5494442 * g++.apple/altivec-5494442.C: Renamed from apple-altivec-5494442.C. @@ -27,17 +1510,17 @@ time the pubtypes section changes. 2007-10-12 Hui-May Chang - + Radar 5494442 * g++.apple/apple-altivec-5494442.C: Replaced -O3 by -O2. 2007-10-12 Hui-May Chang - + Radar 5494442 * g++.apple/apple-altivec-5494442.C: New. 2007-10-12 Hui-May Chang - + Radar 5533365 * g++.apple/5533365.C: New. @@ -52,7 +1535,7 @@ * gcc.apple/5490617.c: New. 2007-09-26 Hui-May Chang - + Radar 5280301 * gcc.apple/altivec-5280301.c: New. @@ -75,7 +1558,7 @@ 2007-08-22 Fariborz Jahanian - Radar 4947311 + Radar 4947311 * objc.dg/protocol-atttribute-1.m: Add * obj-c++.dg/protocol-atttribute-1.mm: Add @@ -102,12 +1585,12 @@ 2007-08-14 Hui-May Chang - Radar 4870336, 4874471, 4874208 - * gcc.apple/4874471.c: New. + Radar 4870336, 4874471, 4874208 + * gcc.apple/4874471.c: New. 2007-08-14 Fariborz Jahanian - Radar 5409313 + Radar 5409313 * obj-c++.dg/objc-neg-selector.mm: New 2007-08-14 Fariborz Jahanian @@ -117,9 +1600,9 @@ 2007-08-10 Fariborz Jahanian - Radar 5376125 - * objc.dg/newproperty-warn-direct-ivar-access.m: New - * obj-c++.dg/newproperty-warn-direct-ivar-access.mm: New + Radar 5376125 + * objc.dg/newproperty-warn-direct-ivar-access.m: New + * obj-c++.dg/newproperty-warn-direct-ivar-access.mm: New 2007-08-10 Stuart Hastings @@ -128,17 +1611,17 @@ 2007-08-10 Fariborz Jahanian - Radar 5398274 - * obj-c++.dg/newproperty-nowarn-unused-param.mm: Expanded + Radar 5398274 + * obj-c++.dg/newproperty-nowarn-unused-param.mm: Expanded 2007-08-09 Hui-May Chang Radar 4875125 - * gcc.target/i386/sse-99.c. Added -mtune=generic option. + * gcc.target/i386/sse-99.c. Added -mtune=generic option. 2007-08-09 Fariborz Jahanian - Radar 3742561 (test change) + Radar 3742561 (test change) * obj-c++/objc-gc-aggr-assign-1.mm: Test changed for ppc32. 2007-08-08 Fariborz Jahanian @@ -173,8 +1656,8 @@ Radar 4874513 * gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c: Moved to - gcc/testsuite/gcc.apple; revised testcase to work around - improved jump-threader. + gcc/testsuite/gcc.apple; revised testcase to work around + improved jump-threader. 2007-07-31 Fariborz Jahanian @@ -210,13 +1693,13 @@ 2007-07-27 Fariborz Jahanian - Radar 3742561 + Radar 3742561 * objc.dg/objc-gc-aggr-assign-1.m: Add * obj-c++.dg/objc-gc-aggr-assign-1.mm: Add 2007-07-24 Fariborz Jahanian - Radar 5355344 + Radar 5355344 * obj-c++.dg/disambiguate-1.mm: Add 2007-07-24 Hui-May Chang @@ -265,7 +1748,7 @@ 2007-07-10 Fariborz Jahanian - Radar 5285911 + Radar 5285911 * objc.dg/newproperty-deprecated-attr-1.m: Modified * objc.dg/newproperty-5.m: Add * obj-c++.dg/newproperty-deprecated-attr-1.mm: Modified @@ -292,38 +1775,38 @@ compilation model neutral. 2007-07-5 Fariborz Jahanian - + Radar 5297325 * objc.dg/stubify-1.m: Modified to make it a 32bit abi test. 2007-06-29 Fariborz Jahanian - Radar 5082000 - * objc.dg/objc2-ivar-layout-array.m: Add - * objc.dg/objc2-ivar-layout-array-1.m: Add - * objc.dg/objc2-ivar-layout-array-2.m: Add - * objc.dg/objc2-ivar-layout-array-3.m: Add - * objc.dg/objc2-ivar-layout-array-4.m: Add - * objc.dg/objc2-ivar-layout-array-5.m: Add - * objc.dg/objc2-ivar-layout-array-6.m: Add - * objc.dg/objc2-ivar-layout-array-7.m: Add - * objc.dg/objc2-ivar-layout-array-8.m: Add - * objc.dg/objc2-ivar-layout-array-9.m: Add - * objc.dg/objc2-ivar-layout-1.m: Modified + Radar 5082000 + * objc.dg/objc2-ivar-layout-array.m: Add + * objc.dg/objc2-ivar-layout-array-1.m: Add + * objc.dg/objc2-ivar-layout-array-2.m: Add + * objc.dg/objc2-ivar-layout-array-3.m: Add + * objc.dg/objc2-ivar-layout-array-4.m: Add + * objc.dg/objc2-ivar-layout-array-5.m: Add + * objc.dg/objc2-ivar-layout-array-6.m: Add + * objc.dg/objc2-ivar-layout-array-7.m: Add + * objc.dg/objc2-ivar-layout-array-8.m: Add + * objc.dg/objc2-ivar-layout-array-9.m: Add + * objc.dg/objc2-ivar-layout-1.m: Modified 2007-06-29 Fariborz Jahanian - Radar 5251019 - * objc.dg/objc2-ivar-layout-2.m: Modified - * objc.dg/objc2-ivar-layout-3.m: Add - * objc.dg/objc2-ivar-layout-4.m: Add + Radar 5251019 + * objc.dg/objc2-ivar-layout-2.m: Modified + * objc.dg/objc2-ivar-layout-3.m: Add + * objc.dg/objc2-ivar-layout-4.m: Add 2007-06-29 Fariborz Jahanian - Radar 5276085 + Radar 5276085 * objc.dg/objc-gc-weak-3.m: Enhanced to test weak array of ivars. - * obj-c++.dg/objc-gc-weak-4.mm: Ditto. + * obj-c++.dg/objc-gc-weak-4.mm: Ditto. * objc.dg/objc-gc-weak-2.m: Modified * obj-c++.dg/objc-gc-weak-2.mm : Modifed @@ -350,8 +1833,8 @@ 2007-06-18 Fariborz Jahanian - Radar 5265737 - * obj-c++.dg/newproperty-struct-val-1.mm: Add + Radar 5265737 + * obj-c++.dg/newproperty-struct-val-1.mm: Add 2007-06-18 Eric Christopher @@ -361,14 +1844,14 @@ 2007-06-18 Fariborz Jahanian - Radar 5272224 - * objc.dg/const-str-3.m: Modified - * obj-c++.dg/const-str-3.mm: Modified + Radar 5272224 + * objc.dg/const-str-3.m: Modified + * obj-c++.dg/const-str-3.mm: Modified 2007-06-18 Fariborz Jahanian - Radar 5265608 - * objc.dg/newproperty-neg-error-bad-impl-1.m: Add + Radar 5265608 + * objc.dg/newproperty-neg-error-bad-impl-1.m: Add 2007-06-16 Hui-May Chang @@ -382,7 +1865,7 @@ 2007-06-06 Fariborz Jahanian - Radar 5250860 (Remove old property) + Radar 5250860 (Remove old property) * objc.dg/property-neg-1.m: Modified to use new property syntax * objc.dg/property-neg-9.m: Removed @@ -471,27 +1954,27 @@ 2007-06-06 Fariborz Jahanian - Radar 5251502 - * obj-c++.dg/function-cast-1.mm: 28 line test case - replaces the 100000+ lines test case. + Radar 5251502 + * obj-c++.dg/function-cast-1.mm: 28 line test case + replaces the 100000+ lines test case. 2007-06-04 Fariborz Jahanian - Radar 5245946 - * objc.dg/threedotthree-abi-1.m: Modified - * objc.dg/encode-3.m: Modified - * objc.dg/proto-lossage-3.m: Modified - * objc.dg/proto-qual-1.m: Modified - * obj-c++.dg/threedotthree-abi-1.mm: Modified - * obj-c++.dg/proto-lossage-3.mm: Modified - * obj-c++.dg/encode-5.mm: Modified - * obj-c++.dg/proto-qual-1.mm: Modified + Radar 5245946 + * objc.dg/threedotthree-abi-1.m: Modified + * objc.dg/encode-3.m: Modified + * objc.dg/proto-lossage-3.m: Modified + * objc.dg/proto-qual-1.m: Modified + * obj-c++.dg/threedotthree-abi-1.mm: Modified + * obj-c++.dg/proto-lossage-3.mm: Modified + * obj-c++.dg/encode-5.mm: Modified + * obj-c++.dg/proto-qual-1.mm: Modified 2007-06-1 Fariborz Jahanian - Radar 5243681 - * objc.dg/objc2-defs-ok.m: Modified - * obj-c++.dg/objc2-defs-ok.mm: Modified + Radar 5243681 + * objc.dg/objc2-defs-ok.m: Modified + * obj-c++.dg/objc2-defs-ok.mm: Modified 2007-05-31 Fariborz Jahanian @@ -501,13 +1984,13 @@ 2007-05-31 Fariborz Jahanian - Radar 4529766 - * objc.dg/method-attribute-format-2.m: Add - * obj-c++.dg/method-attribute-format-2.mm: Add + Radar 4529766 + * objc.dg/method-attribute-format-2.m: Add + * obj-c++.dg/method-attribute-format-2.mm: Add 2007-05-30 Fariborz Jahanian - Radar 5232840 + Radar 5232840 * obj-c++.dg/newproperty-nowarn-unused-param.mm: Add 2007-05-30 Hui-May Chang @@ -524,14 +2007,14 @@ 2007-05-29 Fariborz Jahanian - Radar 5217964 - * objc.dg/objc2-ivar-layout-2.m: Modified + Radar 5217964 + * objc.dg/objc2-ivar-layout-2.m: Modified 2007-05-29 Fariborz Jahanian - Radar 5217964 - * objc.dg/objc2-ivar-layout-1.m: Modified - * objc.dg/objc2-ivar-layout-2.m: New. + Radar 5217964 + * objc.dg/objc2-ivar-layout-1.m: Modified + * objc.dg/objc2-ivar-layout-2.m: New. 2007-05-23 Fariborz Jahanian @@ -552,21 +2035,21 @@ 2007-05-16 Fariborz Jahanian - Radar 5207415 - * objc.dg/newproperty-setter-getter-attr-1.m: Add - * obj-c++.dg/newproperty-setter-getter-attr-1.mm: Add + Radar 5207415 + * objc.dg/newproperty-setter-getter-attr-1.m: Add + * obj-c++.dg/newproperty-setter-getter-attr-1.mm: Add 2007-05-14 Caroline Tice - Radar 4964532 + Radar 4964532 * testsuite/gcc.apple/uninit-test-1.c: Add missing compilation flag to make it work correctly on ppc. 2007-05-12 Fariborz Jahanian - Radar 5192466 - * objc.dg/objc2-protocol-ext-1.m: Add - * obj-c++.dg/objc2-protocol-ext-1.mm: Add + Radar 5192466 + * objc.dg/objc2-protocol-ext-1.m: Add + * obj-c++.dg/objc2-protocol-ext-1.mm: Add 2007-05-10 Geoffrey Keating @@ -574,29 +2057,29 @@ 2007-05-07 Caroline Tice - Radar 4964532 + Radar 4964532 * testsuite/gcc.apple/uninit-test-1.c: New testcase. * testsuite/gcc.apple/uninit-test-2.c: New testcase. 2007-05-07 Fariborz Jahanian - Radar 4157812 + Radar 4157812 * objc.dg/method-arg-attribute-1.m: Add * obj-c++.dg/method-arg-attribute-1.mm: Add 2007-05-03 Fariborz Jahanian - Radar 5180172 - * objc.dg/newproperty-no-category-synthesis.m: Add - * obj-c++.dg/newproperty-no-category-synthesis.mm: Add - * objc.dg/newproperty-copy-2.m: Now a negative test - * obj-c++.dg/newproperty-copy-2.mm: Now a negative test + Radar 5180172 + * objc.dg/newproperty-no-category-synthesis.m: Add + * obj-c++.dg/newproperty-no-category-synthesis.mm: Add + * objc.dg/newproperty-copy-2.m: Now a negative test + * obj-c++.dg/newproperty-copy-2.mm: Now a negative test 2007-05-02 Fariborz Jahanian - Radar 4502186 - * objc.dg/try-catch-18.m: Add - * obj-c++.dg/try-catch-21.mm: Add + Radar 4502186 + * objc.dg/try-catch-18.m: Add + * obj-c++.dg/try-catch-21.mm: Add 2007-05-02 Eric Christopher @@ -646,20 +2129,20 @@ 2007-04-23 Fariborz Jahanian - Radar 5153561 - * obj-c++.dg/objc2-cplus-try-catch-1.mm: Add + Radar 5153561 + * obj-c++.dg/objc2-cplus-try-catch-1.mm: Add 2007-04-23 Fariborz Jahanian - Radar 5142207 - * objc.dg/objc-visibility-hidden-1.m: Add - * obj-c++.dg/objc-visibility-hidden-1.mm: Add + Radar 5142207 + * objc.dg/objc-visibility-hidden-1.m: Add + * obj-c++.dg/objc-visibility-hidden-1.mm: Add 2007-04-20 Fariborz Jahanian - Radar 5130983 - * objc.dg/objc-foreach-lvalue-1.m: Add - * obj-c++.dg/objc-foreach-lvalue-1.mm: Add + Radar 5130983 + * objc.dg/objc-foreach-lvalue-1.m: Add + * obj-c++.dg/objc-foreach-lvalue-1.mm: Add 2007-04-20 Stuart Hastings Hui-May Chang @@ -759,15 +2242,15 @@ 2007-04-19 Fariborz Jahanian - Radar 5140757 - * newproperty-compound-setter-1.m: Add - * obj-c++.dg/newproperty-compound-setter-1.mm: Add + Radar 5140757 + * newproperty-compound-setter-1.m: Add + * obj-c++.dg/newproperty-compound-setter-1.mm: Add 2007-04-18 Fariborz Jahanian - Radar 5128402 - * objc.dg/objc-foreach-elem-collection-elem.m: Add - * obj-c++.dg/objc-foreach-elem-collection-elem.mm: Add + Radar 5128402 + * objc.dg/objc-foreach-elem-collection-elem.m: Add + * obj-c++.dg/objc-foreach-elem-collection-elem.mm: Add 2007-04-17 Mike Stump @@ -797,32 +2280,32 @@ 2007-04-09 Fariborz Jahanian - Radar 5096648 - * gcc.apple/format-security-attribute-1.c: Add - * gcc.apple/format-security-attribute-2.c: Add - * objc.dg/format-security-attribute-3.m: Add - * objc.dg/format-security-attribute-4.m: Add - * obj-c++.dg/format-security-attribute-3.mm: Add - * obj-c++.dg/format-security-attribute-2.mm: Add - * g++.apple/format-security-attribute-2.C: Add - * g++.apple/format-security-attribute-1.C: Add + Radar 5096648 + * gcc.apple/format-security-attribute-1.c: Add + * gcc.apple/format-security-attribute-2.c: Add + * objc.dg/format-security-attribute-3.m: Add + * objc.dg/format-security-attribute-4.m: Add + * obj-c++.dg/format-security-attribute-3.mm: Add + * obj-c++.dg/format-security-attribute-2.mm: Add + * g++.apple/format-security-attribute-2.C: Add + * g++.apple/format-security-attribute-1.C: Add 2007-04-06 Fariborz Jahanian - Radar 4792158 - * objc.dg/objc-gc-section-1.m: Modified - * objc.dg/objc2-super-class-1.m: Modified - * objc.dg/objc-gc-section-2.m: Modified - * objc.dg/objc-gc-section-3.m: Modified - * obj-c++.dg/objc2-super-class-1.mm: Modified - * obj-c++.dg/objc-gc-section-1.mm: Modified - * obj-c++.dg/objc-gc-section-2.mm: Modified - * obj-c++.dg/objc-gc-section-3.mm: Modified + Radar 4792158 + * objc.dg/objc-gc-section-1.m: Modified + * objc.dg/objc2-super-class-1.m: Modified + * objc.dg/objc-gc-section-2.m: Modified + * objc.dg/objc-gc-section-3.m: Modified + * obj-c++.dg/objc2-super-class-1.mm: Modified + * obj-c++.dg/objc-gc-section-1.mm: Modified + * obj-c++.dg/objc-gc-section-2.mm: Modified + * obj-c++.dg/objc-gc-section-3.mm: Modified 2007-04-05 Fariborz Jahanian - Radar 5109807 - objc.dg/objc2-ivar-layout-1.m: Add + Radar 5109807 + objc.dg/objc2-ivar-layout-1.m: Add 2007-04-03 Fariborz Jahanian @@ -847,7 +2330,7 @@ 2007-04-02 Fariborz Jahanian - Radar 4929049 + Radar 4929049 * objc.dg/objc-gc-1.m: Modified * obj-c++.dg/objc-gc-1.mm: Modified @@ -1081,143 +2564,143 @@ 2007-03-29 Fariborz Jahanian - Radar 5083523 - * objc.dg/property-neg-10.m: Modified. + Radar 5083523 + * objc.dg/property-neg-10.m: Modified. 2007-03-29 Fariborz Jahanian - Radar 5096644 - * objc.dg/newproperty-forward-class-1.m: Add + Radar 5096644 + * objc.dg/newproperty-forward-class-1.m: Add 2007-03-29 Fariborz Jahanian - Radar 5080710 - * obj-c++.dg/method-copyctor-1.mm: Add + Radar 5080710 + * obj-c++.dg/method-copyctor-1.mm: Add 2007-03-29 Fariborz Jahanian - Radar 4947014 - objc atomic property + Radar 4947014 - objc atomic property - * objc.dg/newproperty-atomicretained.m: add - * objc.dg/newproperty-atomiccopy.m: add - * objc.dg/newproperty-atomicretained-1.m: add - * objc.dg/newproperty-atomic-neg-1.m: add - * objc.dg/newproperty-atomiccopy-1.m: add - * obj-c++.dg/newproperty-atomic-neg-1.mm: add - * obj-c++.dg/newproperty-atomicretained.mm: add - * obj-c++.dg/newproperty-atomiccopy.mm: add - * obj-c++.dg/newproperty-atomicretained-1.mm: add - * obj-c++.dg/newproperty-atomiccopy-1.mm: add - * objc.dg/newproperty-retain-2.m: modified - * objc.dg/newproperty-copy-1.m: removed - * objc.dg/newproperty-copy-2.m: modified - * objc.dg/newproperty-copy-4.m: removed - * obj-c++.dg/newproperty-retain-2.mm: modified - * obj-c++.dg/newproperty-copy-4.mm: removed - * obj-c++.dg/newproperty-copy-1.mm: removed - * obj-c++.dg/newproperty-copy-2.mm: modified + * objc.dg/newproperty-atomicretained.m: add + * objc.dg/newproperty-atomiccopy.m: add + * objc.dg/newproperty-atomicretained-1.m: add + * objc.dg/newproperty-atomic-neg-1.m: add + * objc.dg/newproperty-atomiccopy-1.m: add + * obj-c++.dg/newproperty-atomic-neg-1.mm: add + * obj-c++.dg/newproperty-atomicretained.mm: add + * obj-c++.dg/newproperty-atomiccopy.mm: add + * obj-c++.dg/newproperty-atomicretained-1.mm: add + * obj-c++.dg/newproperty-atomiccopy-1.mm: add + * objc.dg/newproperty-retain-2.m: modified + * objc.dg/newproperty-copy-1.m: removed + * objc.dg/newproperty-copy-2.m: modified + * objc.dg/newproperty-copy-4.m: removed + * obj-c++.dg/newproperty-retain-2.mm: modified + * obj-c++.dg/newproperty-copy-4.mm: removed + * obj-c++.dg/newproperty-copy-1.mm: removed + * obj-c++.dg/newproperty-copy-2.mm: modified 2007-03-29 Fariborz Jahanian - Radar 4564694 - * objc.dg/objc2-package-ivar-1.m: Add - * obj-c++.dg/objc2-package-ivar-1.mm: Add + Radar 4564694 + * objc.dg/objc2-package-ivar-1.m: Add + * obj-c++.dg/objc2-package-ivar-1.mm: Add 2007-03-27 Fariborz Jahanian - Radar 5040740 - * objc.dg/newproperty-nested-synthesis-1.m: Add - * obj-c++.dg/newproperty-nested-synthesis-1.mm: Add + Radar 5040740 + * objc.dg/newproperty-nested-synthesis-1.m: Add + * obj-c++.dg/newproperty-nested-synthesis-1.mm: Add 2007-03-27 Fariborz Jahanian - Radar 5025001 - * objc.dg/objc2-bitfield-abi-1.m: New - * obj-c++.dg/objc2-bitfield-abi-1.mm: New - * obj-c++.dg/bitfield-3.mm: Modified + Radar 5025001 + * objc.dg/objc2-bitfield-abi-1.m: New + * obj-c++.dg/objc2-bitfield-abi-1.mm: New + * obj-c++.dg/bitfield-3.mm: Modified 2007-03-27 Fariborz Jahanian - Radar 5005756 - * objc.dg/method-attribute-1.m: Modified. - * obj-c++.dg/method-attribute-1.mm: Modified. + Radar 5005756 + * objc.dg/method-attribute-1.m: Modified. + * obj-c++.dg/method-attribute-1.mm: Modified. 2007-03-23 Fariborz Jahanian - Radar 5002848 - * objc.dg/newproperty-typedef-mangle-1.m: New - * obj-c++.dg/newproperty-typedef-mangle-1.mm: New + Radar 5002848 + * objc.dg/newproperty-typedef-mangle-1.m: New + * obj-c++.dg/newproperty-typedef-mangle-1.mm: New 2007-03-23 Fariborz Jahanian - Radar 4985544 - * objc.dg/format-security-attribute-1.m: Add - * objc.dg/format-security-attribute-2.m: Add - * obj-c++.dg/format-security-attribute-1.mm: Add + Radar 4985544 + * objc.dg/format-security-attribute-1.m: Add + * objc.dg/format-security-attribute-2.m: Add + * obj-c++.dg/format-security-attribute-1.mm: Add 2007-03-22 Fariborz Jahanian - Radar 4994854 - * objc.dg/newproperty-anon-category-5.m - * objc.dg/newproperty-anon-category-6.m - * obj-c++.dg/newproperty-anon-category-5.mm - * obj-c++.dg/newproperty-anon-category-6.mm + Radar 4994854 + * objc.dg/newproperty-anon-category-5.m + * objc.dg/newproperty-anon-category-6.m + * obj-c++.dg/newproperty-anon-category-5.mm + * obj-c++.dg/newproperty-anon-category-6.mm 2007-03-22 Fariborz Jahanian - Radar 4965989 - * objc.dg/newproperty-anon-category-1.m: Add - * objc.dg/newproperty-anon-category-2.m: Add - * objc.dg/newproperty-anon-category-3.m: Add - * objc.dg/newproperty-anon-category-4.m: Add - * obj-c++.dg/newproperty-anon-category-2.mm: Add - * obj-c++.dg/newproperty-anon-category-3.mm: Add - * obj-c++.dg/newproperty-anon-category-4.mm: Add - * obj-c++.dg/newproperty-anon-category-1.mm: Add + Radar 4965989 + * objc.dg/newproperty-anon-category-1.m: Add + * objc.dg/newproperty-anon-category-2.m: Add + * objc.dg/newproperty-anon-category-3.m: Add + * objc.dg/newproperty-anon-category-4.m: Add + * obj-c++.dg/newproperty-anon-category-2.mm: Add + * obj-c++.dg/newproperty-anon-category-3.mm: Add + * obj-c++.dg/newproperty-anon-category-4.mm: Add + * obj-c++.dg/newproperty-anon-category-1.mm: Add 2007-03-22 Fariborz Jahanian - Removed objc2 hybrid abi - * objc.dg/property-metadata-6.m: Removed - * objc.dg/hybrid-abi-1.m: Removed - * objc.dg/hybrid-abi-2.m: Removed - * obj-c++.dg/hybrid-abi-1.mm: Removed - * obj-c++.dg/hybrid-abi-2.mm: Removed - * obj-c++.dg/property-metadata-6.mm: Removed + Removed objc2 hybrid abi + * objc.dg/property-metadata-6.m: Removed + * objc.dg/hybrid-abi-1.m: Removed + * objc.dg/hybrid-abi-2.m: Removed + * obj-c++.dg/hybrid-abi-1.mm: Removed + * obj-c++.dg/hybrid-abi-2.mm: Removed + * obj-c++.dg/property-metadata-6.mm: Removed 2007-03-22 Fariborz Jahanian - Radar 4995066 - * objc.dg/objc-gc-9.m: Add - * obj-c++.dg/objc-gc-11.mm: Add + Radar 4995066 + * objc.dg/objc-gc-9.m: Add + * obj-c++.dg/objc-gc-11.mm: Add 2007-03-22 Fariborz Jahanian - Radar 4982951 - * objc.dg/objc-gc-assign-ivar-1.m: New - * obj-c++.dg/objc-gc-assign-ivar-1.mm: New. + Radar 4982951 + * objc.dg/objc-gc-assign-ivar-1.m: New + * obj-c++.dg/objc-gc-assign-ivar-1.mm: New. 2007-03-21 Fariborz Jahanian - Radar 4951324 - * objc.dg/objc2-try-catch-1.m" Add + Radar 4951324 + * objc.dg/objc2-try-catch-1.m" Add 2007-03-21 Fariborz Jahanian - Radar 4995967 - * objc.dg/try-catch-17.m: Add - * obj-c++.dg/try-catch-20.mm: Add + Radar 4995967 + * objc.dg/try-catch-17.m: Add + * obj-c++.dg/try-catch-20.mm: Add 2007-03-21 Fariborz Jahanian - Radar 5004537 - * const-str-7.m: Modified - * const-str-8.m: Modified - * const-str-3.m: Modified - * dg/const-str-7.mm: Modified - * dg/const-str-8.mm: Modified - * dg/const-str-3.mm: Modified - * dg/const-str-9.mm: Modified + Radar 5004537 + * const-str-7.m: Modified + * const-str-8.m: Modified + * const-str-3.m: Modified + * dg/const-str-7.mm: Modified + * dg/const-str-8.mm: Modified + * dg/const-str-3.mm: Modified + * dg/const-str-9.mm: Modified 2007-03-14 Hui-May Chang @@ -1236,36 +2719,36 @@ 2007-02-07 Fariborz Jahanian - Radar 4923914 + Radar 4923914 - * objc.dg/type-size-2.m: Modified - * objc.dg/encode-2.m: Modified - * objc.dg/encode-7a.m: Modified - * objc.dg/objc-gc-7.m: Modified - * objc.dg/category-1.m: Modified - * objc.dg/encode-4.m: Modified - * objc.dg/encode-5.m: Modified - * obj-c++.dg/encode-7.mm: Modified - * obj-c++.dg/objc-gc-8.mm: Modified - * obj-c++.dg/encode-4.mm: Modified - * obj-c++.dg/encode-6.mm: Modified + * objc.dg/type-size-2.m: Modified + * objc.dg/encode-2.m: Modified + * objc.dg/encode-7a.m: Modified + * objc.dg/objc-gc-7.m: Modified + * objc.dg/category-1.m: Modified + * objc.dg/encode-4.m: Modified + * objc.dg/encode-5.m: Modified + * obj-c++.dg/encode-7.mm: Modified + * obj-c++.dg/objc-gc-8.mm: Modified + * obj-c++.dg/encode-4.mm: Modified + * obj-c++.dg/encode-6.mm: Modified 2007-02-07 Fariborz Jahanian - Radar 4261575 + Radar 4261575 - * objc.dg/const-str-7.m: Modified - * objc.dg/const-str-8.m: Modified - * objc.dg/const-str-3.m: Modified - * objc.dg/const-str-4.m: Modified - * obj-c++.dg/const-str-7.mm: Modified - * obj-c++.dg/const-str-8.mm: Modified - * obj-c++.dg/const-str-3.mm: Modified - * obj-c++.dg/const-str-4.mm: Modified + * objc.dg/const-str-7.m: Modified + * objc.dg/const-str-8.m: Modified + * objc.dg/const-str-3.m: Modified + * objc.dg/const-str-4.m: Modified + * obj-c++.dg/const-str-7.mm: Modified + * obj-c++.dg/const-str-8.mm: Modified + * obj-c++.dg/const-str-3.mm: Modified + * obj-c++.dg/const-str-4.mm: Modified 2007-02-06 Fariborz Jahanian - Radar 4894756 + Radar 4894756 * objc.dg/desig-init-1.m: Modified * objc.dg/newproperty-1.m: Modified * objc.dg/try-catch-6.m: Modified @@ -1498,87 +2981,87 @@ 2007-02-06 Fariborz Jahanian - Radar 4966565 - * objc.dg/newproperty-category-impl-1.m: New. - * obj-c++.dg/newproperty-category-impl-1.mm: New. + Radar 4966565 + * objc.dg/newproperty-category-impl-1.m: New. + * obj-c++.dg/newproperty-category-impl-1.mm: New. 2007-02-06 Fariborz Jahanian - Radar 4963113 - * objc.dg/newproperty-no-protocol-warn-1.m: New. - * obj-c++.dg/newproperty-no-protocol-warn-1.mm: New. + Radar 4963113 + * objc.dg/newproperty-no-protocol-warn-1.m: New. + * obj-c++.dg/newproperty-no-protocol-warn-1.mm: New. 2007-02-06 Fariborz Jahanian - Radar 4968128 - * objc.dg/newproperty-setter-decl-1.m: New. - * obj-c++.dg/newproperty-setter-decl-1.mm: New. + Radar 4968128 + * objc.dg/newproperty-setter-decl-1.m: New. + * obj-c++.dg/newproperty-setter-decl-1.mm: New. 2007-02-06 Fariborz Jahanian - Radar 4959107 - * objc.dg/newproperty-protocol-lookup-1.m: New. - * obj-c++.dg/newproperty-protocol-lookup-1.mm: New. + Radar 4959107 + * objc.dg/newproperty-protocol-lookup-1.m: New. + * obj-c++.dg/newproperty-protocol-lookup-1.mm: New. 2007-02-06 Fariborz Jahanian - Radar 4951615 - * objc.dg/objc2-ivar-test-2.m: New - * obj-c++.dg/objc2-ivar-test-2.mm: New + Radar 4951615 + * objc.dg/objc2-ivar-test-2.m: New + * obj-c++.dg/objc2-ivar-test-2.mm: New 2007-02-06 Fariborz Jahanian - Radar 4954480 - * objc.dg/objc2-none-fragile-ivar-use.m: New - * obj-c++.dg/objc2-none-fragile-ivar-use.mm: New + Radar 4954480 + * objc.dg/objc2-none-fragile-ivar-use.m: New + * obj-c++.dg/objc2-none-fragile-ivar-use.mm: New 2007-02-06 Fariborz Jahanian - Radar 4949034 - * obj-c++.dg/cxx-ivars-4.mm: Add + Radar 4949034 + * obj-c++.dg/cxx-ivars-4.mm: Add 2007-02-06 Fariborz Jahanian - Radar 4945770 - * objc.dg/objc-weak-pointer.m: Add - * obj-c++.dg/objc-weak-pointer.mm: Add + Radar 4945770 + * objc.dg/objc-weak-pointer.m: Add + * obj-c++.dg/objc-weak-pointer.mm: Add 2007-02-06 Fariborz Jahanian - Radar 4897159 - * objc.dg/newproperty-redundant-decl-accessor.m: Add - * obj-c++.dg/newproperty-redundant-decl-accessor.mm: Add + Radar 4897159 + * objc.dg/newproperty-redundant-decl-accessor.m: Add + * obj-c++.dg/newproperty-redundant-decl-accessor.mm: Add 2007-02-06 Fariborz Jahanian - Radar 4899564 - * objc.dg/newproperty-weak-attribute-2.m: Modified - * objc.dg/newproperty-warn-weak-1.m: Add - * obj-c++.dg/newproperty-weak-attribute-2.mm: Modified + Radar 4899564 + * objc.dg/newproperty-weak-attribute-2.m: Modified + * objc.dg/newproperty-warn-weak-1.m: Add + * obj-c++.dg/newproperty-weak-attribute-2.mm: Modified 2007-02-06 Fariborz Jahanian - Radar 4903391 - * objc.dg/newproperty-type-conv-1.m: Add - * obj-c++.dg/newproperty-type-conv-1.mm: Add + Radar 4903391 + * objc.dg/newproperty-type-conv-1.m: Add + * obj-c++.dg/newproperty-type-conv-1.mm: Add 2007-02-06 Fariborz Jahanian - Radar 4781080 - * objc.dg/objc-fpret-64bit-1.m: Modified. + Radar 4781080 + * objc.dg/objc-fpret-64bit-1.m: Modified. 2007-02-06 Fariborz Jahanian - Radar 4832902 - * objc.dg/objc-fpret-64bit-1.m: Add - * objc.dg/objc-fpret-2.m: Modified - * objc.dg/objc-fpret-1.m: Modified - * obj-c++.dg/objc-fpret-1.mm: Modified + Radar 4832902 + * objc.dg/objc-fpret-64bit-1.m: Add + * objc.dg/objc-fpret-2.m: Modified + * objc.dg/objc-fpret-1.m: Modified + * obj-c++.dg/objc-fpret-1.mm: Modified 2007-02-05 Hui-May Chang - Radar 4961827 - * gcc.target/i386/large-size-array-3.c: New. + Radar 4961827 + * gcc.target/i386/large-size-array-3.c: New. 2007-01-31 Dale Johannesen @@ -1643,8 +3126,8 @@ 2006-12-20 Fariborz Jahanian - Radar 4881080 - * objc.dg/encode-7-64bit.m: Modified. + Radar 4881080 + * objc.dg/encode-7-64bit.m: Modified. 2006-12-19 Dale Johannesen @@ -1664,46 +3147,46 @@ 2006-12-15 Fariborz Jahanian - Radar 4449535 - * objc.dg/no-warn-unimpl-method-1.m: Add - * obj-c++.dg/no-warn-unimpl-method-1.mm: Add + Radar 4449535 + * objc.dg/no-warn-unimpl-method-1.m: Add + * obj-c++.dg/no-warn-unimpl-method-1.mm: Add 2006-11-15 Fariborz Jahanian - Radar 4838528 - * objc.dg/newproperty-dotsyntax-warn-setter-1.m: Add + Radar 4838528 + * objc.dg/newproperty-dotsyntax-warn-setter-1.m: Add 2006-12-14 Caroline Tice - Radar 4869909 - * g++.apple/pubtypes.C: Change size of pubtypes section in test - to match what 4.2 compiler outputs (it doesn't emit a duplicate that - previous compiler did). + Radar 4869909 + * g++.apple/pubtypes.C: Change size of pubtypes section in test + to match what 4.2 compiler outputs (it doesn't emit a duplicate that + previous compiler did). 2006-12-14 Fariborz Jahanian - Radar 4841013 - * objc.dg/newproperty-nowarn-readonly-1.m: Add + Radar 4841013 + * objc.dg/newproperty-nowarn-readonly-1.m: Add 2006-12-14 Fariborz Jahanian - Radar 4712415 - * objc.dg/newproperty-deprecated-attr-1.m: Add - * obj-c++.dg/newproperty-deprecated-attr-1.mm: Add + Radar 4712415 + * objc.dg/newproperty-deprecated-attr-1.m: Add + * obj-c++.dg/newproperty-deprecated-attr-1.mm: Add 2006-12-14 Fariborz Jahanian - Radar 4854605 - * objc.dg/objc-foreach-nil-collection-1.m: Add - * obj-c++.dg/objc-foreach-nil-collection-1.mm: Add + Radar 4854605 + * objc.dg/objc-foreach-nil-collection-1.m: Add + * obj-c++.dg/objc-foreach-nil-collection-1.mm: Add 2006-12-14 Fariborz Jahanian - Radar 4855821 - * objc.dg/newproperty-weak-attribute-1.m: Modified. - * objc.dg/newproperty-lookup-1.m: Modified. - * obj-c++.dg/newproperty-weak-attribute-1.mm: Modified. - * obj-c++.dg/newproperty-lookup-1.mm: Modified. + Radar 4855821 + * objc.dg/newproperty-weak-attribute-1.m: Modified. + * objc.dg/newproperty-lookup-1.m: Modified. + * obj-c++.dg/newproperty-weak-attribute-1.mm: Modified. + * obj-c++.dg/newproperty-lookup-1.mm: Modified. 2006-12-14 Hui-May Chang @@ -1718,21 +3201,21 @@ 2006-12-13 Fariborz Jahanian - Radar 4531086 - * objc.dg/objc2-warn-prev-osx-1.m: Add - * obj-c++.dg/objc2-warn-prev-osx-1.mm: Add + Radar 4531086 + * objc.dg/objc2-warn-prev-osx-1.m: Add + * obj-c++.dg/objc2-warn-prev-osx-1.mm: Add 2006-12-13 Fariborz Jahanian - Radar 4862848 - * objc.dg/const-str-10-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/const-str-9-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/next-runtime-2-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/symtab-1-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/const-str-11-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/objc-dir-dispatch-64.m: Add -fobjc-abi-version=1 - * objc.dg/encode-7-64bit.m: Add -fobjc-abi-version=1 - * objc.dg/next-runtime-1-64bit.m: Add -fobjc-abi-version=1 + Radar 4862848 + * objc.dg/const-str-10-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/const-str-9-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/next-runtime-2-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/symtab-1-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/const-str-11-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/objc-dir-dispatch-64.m: Add -fobjc-abi-version=1 + * objc.dg/encode-7-64bit.m: Add -fobjc-abi-version=1 + * objc.dg/next-runtime-1-64bit.m: Add -fobjc-abi-version=1 2006-12-13 Fariborz Jahanian @@ -1768,9 +3251,9 @@ 2006-12-11 Fariborz Jahanian - Radar 4869979 - * objc.dg/objc-bycopy-return-warn-1.m: Add - * obj-c++.dg/objc-bycopy-return-warn-1.mm: Add + Radar 4869979 + * objc.dg/objc-bycopy-return-warn-1.m: Add + * obj-c++.dg/objc-bycopy-return-warn-1.mm: Add 2006-12-11 Bill Wendling @@ -1867,19 +3350,19 @@ 2006-11-17 Fariborz Jahanian - Radar 4843145 - * objc.dg/objc2-visibility-hidden-2.m: Add - * obj-c++.dg/objc2-visibility-hidden-2.mm: Add + Radar 4843145 + * objc.dg/objc2-visibility-hidden-2.m: Add + * obj-c++.dg/objc2-visibility-hidden-2.mm: Add 2006-11-15 Eric Christopher - Radar 4839411 - * gcc.apple/4839411.c: New. + Radar 4839411 + * gcc.apple/4839411.c: New. 2006-11-14 Fariborz Jahanian - Radar 4829851 - * obj-c++.dg/lookup-neg-1.mm: Add + Radar 4829851 + * obj-c++.dg/lookup-neg-1.mm: Add 2006-11-13 Josh Conner @@ -1909,8 +3392,8 @@ 2006-09-19 Hui-May Chang - Radar 4268581 - gcc.apple/4268581.c: New. + Radar 4268581 + gcc.apple/4268581.c: New. 2006-09-18 Hui-May Chang @@ -1944,7 +3427,7 @@ 2006-11-10 Fariborz Jahanian - Radar 4829803 + Radar 4829803 * obj-c++.dg/syntax-error-8.mm: Add 2006-11-09 Fariborz Jahanian @@ -1966,7 +3449,7 @@ 1006-11-06 Fariborz Jahanian - Radar 4781080 + Radar 4781080 *objc.dg/next-runtime-2-64bit.m: Add 2006-11-06 Hui-May Chang @@ -2098,7 +3581,7 @@ 2006-10-23 Fariborz Jahanian - Radar 4783068 + Radar 4783068 * obj-c++.dg/no-offsetof-warn.mm: New. 2006-10-17 Geoffrey Keating @@ -2112,18 +3595,18 @@ 2006-10-13 Bill Wendling - Radar 3904173 - * g++.old-deja/g++.brendan/scope5.C, - g++.old-deja/g++.jason/hmc1.C, - g++.old-deja/g++.jason/cleanup2.C, - g++.old-deja/g++.law/shadow1.C, - g++.old-deja/g++.law/ctors10.C, - g++.dg/debug/namespace1.C, - g++.dg/inherit/namespace-as-base.C, - g++.dg/template/mem_func_ptr.C, - g++.dg/template/spec19.C, - g++.dg/template/ptrmem11.C: - Changed "Class" identifier to "Klasse". + Radar 3904173 + * g++.old-deja/g++.brendan/scope5.C, + g++.old-deja/g++.jason/hmc1.C, + g++.old-deja/g++.jason/cleanup2.C, + g++.old-deja/g++.law/shadow1.C, + g++.old-deja/g++.law/ctors10.C, + g++.dg/debug/namespace1.C, + g++.dg/inherit/namespace-as-base.C, + g++.dg/template/mem_func_ptr.C, + g++.dg/template/spec19.C, + g++.dg/template/ptrmem11.C: + Changed "Class" identifier to "Klasse". 2006-10-11 Mike Stump @@ -2240,8 +3723,8 @@ 2006-09-18 Bill Wendling - Radar 3222135 - * g++.old-deja/g++.bugs/900404_02.C: Added expected warning message. + Radar 3222135 + * g++.old-deja/g++.bugs/900404_02.C: Added expected warning message. 2006-09-18 Fariborz Jahanian @@ -2273,14 +3756,14 @@ 2006-09-13 Bill Wendling - Radar 4660731 - * gcc.apple/falign-loops-max-skip-4.c: New test. + Radar 4660731 + * gcc.apple/falign-loops-max-skip-4.c: New test. 2006-09-12 Bill Wendling - Radar 4385013 - * g++.dg/apple-longcall-2.C: Skip if -m64. - * g++.dg/apple-longcall-3.C: Skip if -m64. + Radar 4385013 + * g++.dg/apple-longcall-2.C: Skip if -m64. + * g++.dg/apple-longcall-3.C: Skip if -m64. 2006-09-11 Josh Conner @@ -2297,8 +3780,8 @@ Radar 4658012 Backport from mainline: 2006-09-06 Jason Merrill - PR c++/27371 - * g++.dg/warn/unused-result1.C: New test. + PR c++/27371 + * g++.dg/warn/unused-result1.C: New test. 2006-09-11 Fariborz Jahanian @@ -2352,9 +3835,9 @@ 2006-09-01 Fariborz Jahanian - Radar 4712269 - * objc.dg/property-incr-decr-1.m: New. - * obj-c++.dg/property-incr-decr-1.mm: New. + Radar 4712269 + * objc.dg/property-incr-decr-1.m: New. + * obj-c++.dg/property-incr-decr-1.mm: New. 2006-08-31 Fariborz Jahanian @@ -2387,9 +3870,9 @@ 2006-08-29 Bill Wendling - Radar 4679943 - * gcc.dg/pragma-align-3.c: Moved to gcc.apple. - * gcc.apple/pragma-align-3.c: New. + Radar 4679943 + * gcc.dg/pragma-align-3.c: Moved to gcc.apple. + * gcc.apple/pragma-align-3.c: New. 2006-08-29 Fariborz Jahanian @@ -2399,14 +3882,14 @@ 2006-08-29 Fariborz Jahanian - Radar 4705250 + Radar 4705250 * objc.dg/objc2-defs-ok.m: New. * obj-c++.dg/objc2-defs-ok.mm: New. 2006-08-28 Bill Wendling - Radar 4679943 - * gcc.dg/pragma-align-3.c: New. + Radar 4679943 + * gcc.dg/pragma-align-3.c: New. 2006-08-25 Fariborz Jahanian @@ -2416,7 +3899,7 @@ 2006-08-25 Joseph S. Myers Radar 4647057 (pr27418) - * gcc.c-torture/compile/compound-literal-1.c: New test. + * gcc.c-torture/compile/compound-literal-1.c: New test. 2006-08-25 Fariborz Jahanian @@ -2460,20 +3943,20 @@ 2008-08-24 Bill Wendling - Radar 4699019 - * gcc.c-torture/execute/4233898.c: Removed ".c" from radar number. - * gcc.dg/4220129.c, gcc.dg/4220129a.c, gcc.dg/4176531.c: - Added radar number to APPLE LOCAL. - * gcc.dg/attr-ms_struct-1.c, objc.dg/super-class-4.m: - Corrected misspelling. - * gcc.apple/falign-loops-max-skip-1.c, - gcc.apple/falign-loops-max-skip-2.c, - gcc.apple/falign-loops-max-skip-3.c, - gcc.apple/falign-jumps-max-skip-1.c, - gcc.apple/falign-jumps-max-skip-2.c: - Added APPLE LOCAL line. - * gcc.apple/altivec-types-1.c, - g++.apple/altivec-types-1.C: Added + Radar 4699019 + * gcc.c-torture/execute/4233898.c: Removed ".c" from radar number. + * gcc.dg/4220129.c, gcc.dg/4220129a.c, gcc.dg/4176531.c: + Added radar number to APPLE LOCAL. + * gcc.dg/attr-ms_struct-1.c, objc.dg/super-class-4.m: + Corrected misspelling. + * gcc.apple/falign-loops-max-skip-1.c, + gcc.apple/falign-loops-max-skip-2.c, + gcc.apple/falign-loops-max-skip-3.c, + gcc.apple/falign-jumps-max-skip-1.c, + gcc.apple/falign-jumps-max-skip-2.c: + Added APPLE LOCAL line. + * gcc.apple/altivec-types-1.c, + g++.apple/altivec-types-1.C: Added 2008-08-22 Fariborz Jahanian @@ -2510,7 +3993,7 @@ 2006-08-17 Fariborz Jahanian - Radar 4590221 + Radar 4590221 * objc.dg/objc-dir-dispatch.m: New. 2006-08-16 Fariborz Jahanian @@ -2540,9 +4023,9 @@ 2006-08-15 Fariborz Jahanian - Radar 4666559 - * objc.dg/property-dwarf-1.m: New - * obj-c++.dg/property-dwarf-1.mm: New + Radar 4666559 + * objc.dg/property-dwarf-1.m: New + * obj-c++.dg/property-dwarf-1.mm: New 2006-08-15 Fariborz Jahanian @@ -2703,7 +4186,7 @@ 2006-07-25 Fariborz Jahanian - Radar 4590191 + Radar 4590191 * objc.dg/try-catch-15.m: New. 2006-07-24 Hui-May Chang @@ -2721,7 +4204,7 @@ 006-07-19 Fariborz Jahanian - Radar 4638467 + Radar 4638467 * obj-c++.dg/demangle-cxx-name.mm: New. 006-07-18 Fariborz Jahanian @@ -2736,16 +4219,16 @@ 2006-07-18 Hui-May Chang - Radar 4430340 - Backport from mainline: - 2006-06-09 Mike Stump - * gcc.dg/vla-7.c: Add. + Radar 4430340 + Backport from mainline: + 2006-06-09 Mike Stump + * gcc.dg/vla-7.c: Add. * gcc.dg/array-size-divbyzero.c: New. 2006-07-17 Fariborz Jahanian - Radar 4631814 + Radar 4631814 * objc.dg/property-bycopy-3.m: New. 2006-07-17 Fariborz Jahanian @@ -2756,7 +4239,7 @@ 2006-07-14 Fariborz Jahanian - Radar 4621020 + Radar 4621020 * objc.dg/property-weak-attribute-1.m: New. * objc.dg/property-weak-attribute-2.m: New. * objc.dg/property-weak-attribute-3.m: New. @@ -2786,7 +4269,7 @@ 2006-07-12 Fariborz Jahanian - Radar 4625635 + Radar 4625635 * objc.dg/property-byref-default-1.m: New. * obj-c++.dg/property-byref-default-1.mm: New. * objc.dg/property-2.m: Modified. @@ -2810,7 +4293,7 @@ 2006-07-10 Fariborz Jahanian - Radar 3904247 + Radar 3904247 * obj-c++.dg/objc-objcplus-for-c-1.c: New. * obj-c++.dg/objc-objcplus-for-c-2.c: New. @@ -2824,39 +4307,39 @@ 2006-06-29 Fariborz Jahanian - Radar 4606233 + Radar 4606233 * objc.dg/method-attribute-2.m: Modified. * obj-c++.dg/method-attribute-2.mm: Modified. 2006-07-05 Eric Christopher - Radar 4597270 - * g++.apple/4474655.C: Look for x86_64 vector convert - as well. + Radar 4597270 + * g++.apple/4474655.C: Look for x86_64 vector convert + as well. 2006-07-05 Eric Christopher - Radar 4597288 - Radar 4597308 - * g++.old-deja/g++.abi/align.C: Merge from mainline. - * g++.dg/other/i386-1.C: Ditto. + Radar 4597288 + Radar 4597308 + * g++.old-deja/g++.abi/align.C: Merge from mainline. + * g++.dg/other/i386-1.C: Ditto. 2006-07-05 Eric Christopher - Radar 4614695 - * gcc.apple/i386-regparmandstackparm-1.c: Skip for x86_64. - * gcc.apple/4525731-2.c: Ditto. - * gcc.apple/i386-ssetype-6.c: Ditto. - * gcc.apple/4182984.c: Ditto. - * gcc.apple/i386-deep-branch-predict-1.c: Ditto. - * gcc.apple/opt-size-2.c: Ditto. - * gcc.apple/4104248.c: Ditto. - * gcc.apple/4104248.c: Ditto. - * gcc.apple/4167459.c: Ditto. - * gcc.apple/i386-att-stub-1.c: Ditto. - * gcc.apple/4113078.c: Ditto. - * gcc.apple/4525731-1.c: Ditto. - * gcc.apple/dynamic-no-pic-1.c: Ditto. + Radar 4614695 + * gcc.apple/i386-regparmandstackparm-1.c: Skip for x86_64. + * gcc.apple/4525731-2.c: Ditto. + * gcc.apple/i386-ssetype-6.c: Ditto. + * gcc.apple/4182984.c: Ditto. + * gcc.apple/i386-deep-branch-predict-1.c: Ditto. + * gcc.apple/opt-size-2.c: Ditto. + * gcc.apple/4104248.c: Ditto. + * gcc.apple/4104248.c: Ditto. + * gcc.apple/4167459.c: Ditto. + * gcc.apple/i386-att-stub-1.c: Ditto. + * gcc.apple/4113078.c: Ditto. + * gcc.apple/4525731-1.c: Ditto. + * gcc.apple/dynamic-no-pic-1.c: Ditto. 2006-07-05 Eric Christopher @@ -2907,15 +4390,15 @@ 2006-06-27 Fariborz Jahanian - Radar 4600999 - * objc.dg/objc-gc-8.m: New. - * obj-c++.dg/objc-gc-10.mm: New. + Radar 4600999 + * objc.dg/objc-gc-8.m: New. + * obj-c++.dg/objc-gc-10.mm: New. 2006-06-24 Fariborz Jahanian - Radar 4591756 - * objc.dg/objc-gc-weak-2.m: Fixed. - * objc.dg/objc-gc-weak-3.m: New. + Radar 4591756 + * objc.dg/objc-gc-weak-2.m: Fixed. + * objc.dg/objc-gc-weak-3.m: New. * obj-c++/objc-gc-weak-1.mm: Fixed. * obj-c++/objc-gc-weak-2.mm: Fixed. @@ -2972,7 +4455,7 @@ 2006-06-07 Fariborz Jahanian - Radar 4576123 + Radar 4576123 * objc.dg/property-metadata-6.m: New. * objc.dg/property-metadata-4.m: Changed. * obj-c++.dg/property-metadata-4.mm: Changed. @@ -2996,12 +4479,12 @@ 2006-06-01 Fariborz Jahanian - Radar 4570979 - * objc.dg/objc2-section-type-1.m: Removed. + Radar 4570979 + * objc.dg/objc2-section-type-1.m: Removed. 2006-06-01 Fariborz Jahanian - Radar 4557092 + Radar 4557092 * obj-c++.dg/cfstring-in-functemplate.mm: New. 2006-05-31 Fariborz Jahanian @@ -3019,23 +4502,23 @@ 2006-05-30 Fariborz Jahanian - Radar 4476365 + Radar 4476365 * obj-c++.dg/objc-passby-ref-1.mm: New. 2006-05-30 Fariborz Jahanian - Radar 4547918 + Radar 4547918 * objc.dg/method-19.m: Test modified. * obj-c++.dg/method-6.mm: Test modified. 2006-05-25 Fariborz Jahanian - Radar 4561192 + Radar 4561192 * objc.dg/objc2-alignment-test-1.m: New. 2006-05-25 Fariborz Jahanian - Radar 4561264 + Radar 4561264 * objc.dg/objc2-section-type-1.m: New. 2006-05-23 Fariborz Jahanian @@ -3063,7 +4546,7 @@ 2006-05-18 Fariborz Jahanian - Radar 4548636 (objc attributes on class) + Radar 4548636 (objc attributes on class) * objc.dg/class-attribute-1.m: New * obj-c++.dg/class-attribute-1.mm: New. @@ -3074,7 +4557,7 @@ 2006-05-16 Fariborz Jahanian - Radar 4547045 + Radar 4547045 * objc.dg/objc-foreach-8.m: New. * obj-c++.dg/objc-foreach-4.mm: New. @@ -3085,7 +4568,7 @@ 2006-05-15 Fariborz Jahanian - radar 4529765 + radar 4529765 * objc.dg/method-attribute-2.m: Test modified. * objc.dg/method-attribute-format-1.m: New. * obj-c++.dg/method-attribute-format-1.mm: New. @@ -3105,15 +4588,15 @@ Backport from mainline: 2006-06-11 Eric Christopher - PR middle-end/27948 - * gcc.dg/bf-ms-layout.c: Run on darwin. - * gcc.dg/bf-no-ms-layout: Ditto. - * gcc.dg/attr-ms_struct-2.c: New. - * gcc.dg/bf-ms-layout-2.c: Ditto. + PR middle-end/27948 + * gcc.dg/bf-ms-layout.c: Run on darwin. + * gcc.dg/bf-no-ms-layout: Ditto. + * gcc.dg/attr-ms_struct-2.c: New. + * gcc.dg/bf-ms-layout-2.c: Ditto. 2006-06-04 Eric Christopher - * gcc.dg/attr-ms_struct-1.c: New. + * gcc.dg/attr-ms_struct-1.c: New. 2006-06-06 Eric Christopher @@ -3135,18 +4618,18 @@ Backport from mainline: 2006-06-02 Eric Christopher - * gcc.c-torture/compile/20000804-1.c: Skip if i?86-darwin. - * gcc.target/i386/20020523-1.c: Skip if darwin. - * gcc.target/i386/asm-3.c: Ditto. - * gcc.target/i386/20011119-1.c: Ditto. - * gcc.target/i386/clobbers.c: Remove pic part of test. + * gcc.c-torture/compile/20000804-1.c: Skip if i?86-darwin. + * gcc.target/i386/20020523-1.c: Skip if darwin. + * gcc.target/i386/asm-3.c: Ditto. + * gcc.target/i386/20011119-1.c: Ditto. + * gcc.target/i386/clobbers.c: Remove pic part of test. Backport from mainline: 2006-04-04 Eric Christopher - * gcc.target/i386/387-1.c: Allow regexp to match darwin - stubs. - * gcc.target/i386/387-5.c: Ditto. + * gcc.target/i386/387-1.c: Allow regexp to match darwin + stubs. + * gcc.target/i386/387-5.c: Ditto. * gcc.dg/i386-cmov1.c: Bring in from mainline. * gcc.dg/i386-mul.c: Ditto. @@ -3171,7 +4654,7 @@ 2006-05-10 Fariborz Jahanian - radar 4180592 + radar 4180592 * obj-c++.dg/unknown-receiver.mm: New. 2006-04-09 Devang Patel @@ -3181,19 +4664,19 @@ 2006-05-09 Fariborz Jahanian - radar 4538105 + radar 4538105 * objc.dg/objc-foreach-7.m: New. * obj-c++.dg/objc-foreach-3.mm: New. 2006-05-09 Fariborz Jahanian - radar 4529200 + radar 4529200 * objc.dg/objc-foreach-6.m: New. * obj-c++.dg/objc-foreach-6.mm: New. 2006-05-08 Fariborz Jahanian - radar 4533107 + radar 4533107 * objc.dg/property-9.m: New. * obj-c++.dg/property-9.mm: New. @@ -3205,13 +4688,13 @@ 2006-05-08 Fariborz Jahanian - radar 4535676 + radar 4535676 * objc.dg/objc2-super-class-1.m: New. * obj-c++.dg/objc2-super-class-1.mm: New. 2006-05-05 Fariborz Jahanian - radar 4533974 - ObjC new protocol + radar 4533974 - ObjC new protocol * objc.dg/objc2-protocol-1.m: New * objc.dg/objc2-protocol-5.m: New * objc.dg/objc2-protocol-9.m: New @@ -3233,13 +4716,13 @@ 2006-05-01 Fariborz Jahanian - Radar 4531482 + Radar 4531482 * objc.dg/hybrid-abi-1.m: New. * obj-c++.dg/hybrid-abi-1.mm: New. 2006-04-28 Fariborz Jahanian - Radar 4512786 + Radar 4512786 * objc.dg/no-fobjc-exception.m: New. 2006-04-26 Fariborz Jahanian @@ -3250,7 +4733,7 @@ 2006-04-26 Fariborz Jahanian - Radar 3803157 (method attributes) + Radar 3803157 (method attributes) * objc.dg/method-attribute-1.m: New. * objc.dg/method-attribute-2.m: New. * objc.dg/method-attribute-3.m: New. @@ -3280,9 +4763,9 @@ 2006-04-13 Devang Patel Radar 4503683 - * g++.dg/pch/R4503682.C: New. - * g++.dg/pch/R4503682.Hs: New. - * g++.dg/pch/R4503682-1.h: New. + * g++.dg/pch/R4503682.C: New. + * g++.dg/pch/R4503682.Hs: New. + * g++.dg/pch/R4503682-1.h: New. 2006-04-13 Fariborz Jahanian @@ -3316,7 +4799,7 @@ Radar 4436866 (Missing copies attribute part). * objc.dg/property-metadata-4.m: New. - * objc.dg/property-neg-6.m: New. + * objc.dg/property-neg-6.m: New. * obj-c++.dg/property-metadata-4.mm: New. 2006-04-04 Fariborz Jahanian @@ -3398,17 +4881,17 @@ 2006-03-24 Devang Patel - Radar 4484026 - * g++.apple/R4484026.C: New. + Radar 4484026 + * g++.apple/R4484026.C: New. 2006-03-24 Devang Patel Radar 4485223 - * gcc.apple/R4485223-1.c: New. - * gcc.apple/R4485223-2.c: New. - * gcc.apple/R4485223-3.c: New. - * gcc.apple/R4485223-4.c: New. - * gcc.apple/R4485223-5.c: New. + * gcc.apple/R4485223-1.c: New. + * gcc.apple/R4485223-2.c: New. + * gcc.apple/R4485223-3.c: New. + * gcc.apple/R4485223-4.c: New. + * gcc.apple/R4485223-5.c: New. 2006-03-23 Devang Patel @@ -3465,12 +4948,12 @@ 2006-03-22 Fariborz Jahanian - Radar 4486614 + Radar 4486614 * obj-c++.dg/objc-gc-weak-3.mm: New. 2006-03-16 Fariborz Jahanian - Radar 4293709 + Radar 4293709 * objc.dg/proto-init-mimatch-1.m: New. * obj-c++.dg/proto-init-mimatch-1.mm: New. @@ -3486,8 +4969,8 @@ 2006-03-13 Fariborz Jahanian - Radar 4439126 - * obj-c++.dg/template-8.mm: New. + Radar 4439126 + * obj-c++.dg/template-8.mm: New. 2005-03-09 Fariborz Jahanian @@ -3497,7 +4980,7 @@ 2005-03-07 Fariborz Jahanian - Radar 4468498 + Radar 4468498 * objc.dg/objc-foreach-2.m: New. 2005-03-01 Fariborz Jahanian @@ -3508,7 +4991,7 @@ 2005-02-28 Fariborz Jahanian - Radar 4156731 + Radar 4156731 * objc.dg/bad-receiver-type.m: New. * obj-c++.dg/bad-receiver-type.mm: New. @@ -3520,7 +5003,7 @@ 2006-02-15 Fariborz Jahanian - Radar 4441551 + Radar 4441551 * objc.dg/defs-warn-1.m: New. * objc.dg/objc2.m: New. * objc.dg/selector-warn-1.m: New. Added: llvm-gcc-4.2/trunk/libgomp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libgomp/ChangeLog.apple?rev=54171&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/libgomp/ChangeLog.apple (added) +++ llvm-gcc-4.2/trunk/libgomp/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -0,0 +1,25 @@ +2007-01-14 Eric Christopher + + Radar 5674196 + * libgomp/configure.tgt: Build ppc64 for 10.4.0. + +2007-01-08 Eric Christopher + + Radar 5674196 + * libgomp/configure.tgt: Build for 10.3.9 for ppc/ppc64. + 10.4.0 for x86 processors. + +2007-12-03 Eric Christopher + + Radar 5602977 + * libgomp/configure.tgt: Build for 10.3.9. + +2007-08-20 Eric Christopher + + Radar 5423997 + Radar 5424010 + Merge .exp files from 4.3. + * testsuite/lib/libgomp.exp (libgomp_init): If blddir is "" then don't + add blddir specific flags. + * testsuite/libgomp.c++/c++.exp: If blddir is null assume we're + testing an installed compiler. Added: llvm-gcc-4.2/trunk/libiberty/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libiberty/ChangeLog.apple?rev=54171&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/libiberty/ChangeLog.apple (added) +++ llvm-gcc-4.2/trunk/libiberty/ChangeLog.apple Tue Jul 29 15:14:52 2008 @@ -0,0 +1,5 @@ +2007-10-05 Eric Christopher + + Radar 5516305 + * make-temp-file.c (make_temp_file): If mkstemps failed produce an + error message and exit. From kremenek at apple.com Wed Jul 30 12:38:03 2008 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 30 Jul 2008 17:38:03 -0000 Subject: [llvm-commits] [llvm] r54216 - /llvm/tags/checker/checker-71/ Message-ID: <200807301738.m6UHc3EF031927@zion.cs.uiuc.edu> Author: kremenek Date: Wed Jul 30 12:38:02 2008 New Revision: 54216 URL: http://llvm.org/viewvc/llvm-project?rev=54216&view=rev Log: Removing checker-71. Removed: llvm/tags/checker/checker-71/ From resistor at mac.com Wed Jul 30 12:42:48 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jul 2008 17:42:48 -0000 Subject: [llvm-commits] [llvm] r54218 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200807301742.m6UHgmlK032109@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 30 12:42:47 2008 New Revision: 54218 URL: http://llvm.org/viewvc/llvm-project?rev=54218&view=rev Log: Value numbers whose def index is a special sentinel value should not be remapped. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54218&r1=54217&r2=54218&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jul 30 12:42:47 2008 @@ -176,19 +176,22 @@ // Remap the VNInfo def index, which works the same as the // start indices above. VNInfo* vni = LI->valno; - index = vni->def / InstrSlots::NUM; - offset = vni->def % InstrSlots::NUM; - if (offset == InstrSlots::LOAD) { - std::vector::const_iterator I = + + // VN's with special sentinel defs don't need to be remapped. + if (vni->def != ~0U && vni->def != ~1U) { + index = vni->def / InstrSlots::NUM; + offset = vni->def % InstrSlots::NUM; + if (offset == InstrSlots::LOAD) { + std::vector::const_iterator I = std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), vni->def); - // Take the pair containing the index - std::vector::const_iterator J = + // Take the pair containing the index + std::vector::const_iterator J = (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; - vni->def = getMBBStartIdx(J->second); - - } else { - vni->def = mi2iMap_[OldI2MI[index]] + offset; + vni->def = getMBBStartIdx(J->second); + } else { + vni->def = mi2iMap_[OldI2MI[index]] + offset; + } } // Remap the VNInfo kill indices, which works the same as @@ -207,7 +210,6 @@ vni->kills[i] = getMBBEndIdx(I->second) + 1; } else { unsigned idx = index; - while (!OldI2MI[index]) ++index; while (index < OldI2MI.size() && !OldI2MI[index]) ++index; if (index != OldI2MI.size()) From isanbard at gmail.com Wed Jul 30 13:00:52 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 18:00:52 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54221 - /llvm-gcc-4.2/trunk/gcc/cp/decl.h Message-ID: <200807301800.m6UI0qKK000409@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 13:00:52 2008 New Revision: 54221 URL: http://llvm.org/viewvc/llvm-project?rev=54221&view=rev Log: Uncomment decl of grokparam. Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.h Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.h?rev=54221&r1=54220&r2=54221&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.h Wed Jul 30 13:00:52 2008 @@ -37,5 +37,4 @@ /* APPLE LOCAL radar 4721858 */ extern void emit_instantiate_pending_templates (location_t *); /* APPLE LOCAL blocks 6040305 (ce) */ -/* LLVM FIXME: Uncomment!!! */ -/*extern tree grokparms (cp_parameter_declarator *first_parm, tree *parms); */ +extern tree grokparms (cp_parameter_declarator *first_parm, tree *parms); From evan.cheng at apple.com Wed Jul 30 13:05:21 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jul 2008 11:05:21 -0700 Subject: [llvm-commits] [llvm] r54174 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp In-Reply-To: <200807292117.m6TLH9SC008656@zion.cs.uiuc.edu> References: <200807292117.m6TLH9SC008656@zion.cs.uiuc.edu> Message-ID: <7F7A0B30-28DC-4BCD-A1D2-1D1A1B20B7A0@apple.com> There are several LiveInterval methods that merge all the liveranges of a particular val#. See MergeValueNumberInto and MergeRangesInAsValue. Can you use those? Evan On Jul 29, 2008, at 2:17 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Jul 29 16:17:08 2008 > New Revision: 54174 > > URL: http://llvm.org/viewvc/llvm-project?rev=54174&view=rev > Log: > When merging a PHI operand's live interval into the PHI's live > interval, we need to merge over all liveranges in > the operand's interval that share the relevant value number, not > just the range that immediately precedes the PHI. > > Modified: > llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp > > Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54174&r1=54173&r2=54174&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) > +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Jul 29 > 16:17:08 2008 > @@ -786,21 +786,29 @@ > LiveInterval& RHS = LI.getOrCreateInterval(secondary); > > LI.computeNumbering(); > - > const LiveRange* RangeMergingIn = > RHS.getLiveRangeContaining(LI.getMBBEndIdx(pred)); > + VNInfo* RHSVN = RangeMergingIn->valno; > VNInfo* NewVN = LHS.getNextValue(RangeMergingIn->valno->def, > RangeMergingIn->valno->copy, > LI.getVNInfoAllocator()); > - NewVN->hasPHIKill = true; > - LiveRange NewRange(RangeMergingIn->start, RangeMergingIn->end, > NewVN); > + > + for (LiveInterval::iterator RI = RHS.begin(), RE = RHS.end(); > + RI != RE; ) > + if (RI->valno == RHSVN) { > + NewVN->hasPHIKill = true; > + LiveRange NewRange(RI->start, RI->end, NewVN); > + LHS.addRange(NewRange); > + > + unsigned start = RI->start; > + unsigned end = RI->end; > + ++RI; > + RHS.removeRange(start, end, true); > + } else > + ++RI; > > - if (RHS.containsOneValue()) > + if (RHS.begin() == RHS.end()) > LI.removeInterval(RHS.reg); > - else > - RHS.removeRange(RangeMergingIn->start, RangeMergingIn->end, > true); > - > - LHS.addRange(NewRange); > } > > bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Wed Jul 30 13:09:17 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 30 Jul 2008 18:09:17 -0000 Subject: [llvm-commits] [llvm] r54223 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll test/CodeGen/X86/zext-inreg-2.ll Message-ID: <200807301809.m6UI9HB4000677@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 30 13:09:17 2008 New Revision: 54223 URL: http://llvm.org/viewvc/llvm-project?rev=54223&view=rev Log: Reapply r54147 with a constraint to only use the 8-bit subreg form on x86-64, to avoid the problem with x86-32 having GPRs that don't have 8-bit subregs. Also, change several 16-bit instructions to use equivalent 32-bit instructions. These have a smaller encoding and avoid partial-register updates. Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54223&r1=54222&r2=54223&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jul 30 13:09:17 2008 @@ -241,18 +241,22 @@ "movs{lq|xd}\t{$src, $dst|$dst, $src}", [(set GR64:$dst, (sextloadi64i32 addr:$src))]>; -def MOVZX64rr8 : RI<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src), - "movz{bq|x}\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (zext GR8:$src))]>, TB; -def MOVZX64rm8 : RI<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src), - "movz{bq|x}\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (zextloadi64i8 addr:$src))]>, TB; -def MOVZX64rr16: RI<0xB7, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src), - "movz{wq|x}\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (zext GR16:$src))]>, TB; -def MOVZX64rm16: RI<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src), - "movz{wq|x}\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (zextloadi64i16 addr:$src))]>, TB; +// Use movzbl instead of movzbq when the destination is a register; it's +// equivalent due to implicit zero-extending, and it has a smaller encoding. +def MOVZX64rr8 : I<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src), + "movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR64:$dst, (zext GR8:$src))]>, TB; +def MOVZX64rm8 : I<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src), + "movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR64:$dst, (zextloadi64i8 addr:$src))]>, TB; +// Use movzwl instead of movzwq when the destination is a register; it's +// equivalent due to implicit zero-extending, and it has a smaller encoding. +def MOVZX64rr16: I<0xB7, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src), + "movz{wl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR64:$dst, (zext GR16:$src))]>, TB; +def MOVZX64rm16: I<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src), + "movz{wl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR64:$dst, (zextloadi64i16 addr:$src))]>, TB; let neverHasSideEffects = 1 in { let Defs = [RAX], Uses = [EAX] in @@ -1093,9 +1097,9 @@ // when we have a better way to specify isel priority. let Defs = [EFLAGS], AddedComplexity = 1, isReMaterializable = 1, isAsCheapAsAMove = 1 in -def MOV64r0 : RI<0x31, MRMInitReg, (outs GR64:$dst), (ins), - "xor{l}\t${dst:subreg32}, ${dst:subreg32}", - [(set GR64:$dst, 0)]>; +def MOV64r0 : I<0x31, MRMInitReg, (outs GR64:$dst), (ins), + "xor{l}\t${dst:subreg32}, ${dst:subreg32}", + [(set GR64:$dst, 0)]>; // Materialize i64 constant where top 32-bits are zero. let AddedComplexity = 1, isReMaterializable = 1 in @@ -1240,6 +1244,26 @@ (SUBREG_TO_REG (i64 0), (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), x86_subreg_32bit)>; +// r & (2^16-1) ==> movz +def : Pat<(and GR64:$src, 0xffff), + (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, x86_subreg_16bit)))>; +// r & (2^8-1) ==> movz +def : Pat<(and GR64:$src, 0xff), + (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, x86_subreg_8bit)))>; + +// TODO: The following two patterns could be adapted to apply to x86-32, except +// that they'll need some way to deal with the fact that in x86-32 not all GPRs +// have 8-bit subregs. The GR32_ and GR16_ classes are a step in this direction, +// but they aren't ready for this purpose yet. + +// r & (2^8-1) ==> movz +def : Pat<(and GR32:$src1, 0xff), + (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, x86_subreg_8bit)))>, + Requires<[In64BitMode]>; +// r & (2^8-1) ==> movz +def : Pat<(and GR16:$src1, 0xff), + (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, x86_subreg_8bit)))>, + Requires<[In64BitMode]>; // (shl x, 1) ==> (add x, x) def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54223&r1=54222&r2=54223&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jul 30 13:09:17 2008 @@ -2424,12 +2424,15 @@ } // Defs = [EFLAGS] // Sign/Zero extenders +// Use movsbl intead of movsbw; we don't care about the high 16 bits +// of the register here. This has a smaller encoding and avoids a +// partial-register update. def MOVSX16rr8 : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src), - "movs{bw|x}\t{$src, $dst|$dst, $src}", - [(set GR16:$dst, (sext GR8:$src))]>, TB, OpSize; + "movs{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR16:$dst, (sext GR8:$src))]>, TB; def MOVSX16rm8 : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src), - "movs{bw|x}\t{$src, $dst|$dst, $src}", - [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, TB, OpSize; + "movs{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, TB; def MOVSX32rr8 : I<0xBE, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src), "movs{bl|x}\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (sext GR8:$src))]>, TB; @@ -2443,12 +2446,15 @@ "movs{wl|x}\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (sextloadi32i16 addr:$src))]>, TB; +// Use movzbl intead of movzbw; we don't care about the high 16 bits +// of the register here. This has a smaller encoding and avoids a +// partial-register update. def MOVZX16rr8 : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src), - "movz{bw|x}\t{$src, $dst|$dst, $src}", - [(set GR16:$dst, (zext GR8:$src))]>, TB, OpSize; + "movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR16:$dst, (zext GR8:$src))]>, TB; def MOVZX16rm8 : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src), - "movz{bw|x}\t{$src, $dst|$dst, $src}", - [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, TB, OpSize; + "movz{bl|x}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}", + [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, TB; def MOVZX32rr8 : I<0xB6, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src), "movz{bl|x}\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (zext GR8:$src))]>, TB; @@ -2488,9 +2494,11 @@ def MOV8r0 : I<0x30, MRMInitReg, (outs GR8 :$dst), (ins), "xor{b}\t$dst, $dst", [(set GR8:$dst, 0)]>; +// Use xorl instead of xorw since we don't care about the high 16 bits, +// it's smaller, and it avoids a partial-register update. def MOV16r0 : I<0x31, MRMInitReg, (outs GR16:$dst), (ins), - "xor{w}\t$dst, $dst", - [(set GR16:$dst, 0)]>, OpSize; + "xor{l}\t${dst:subreg32}, ${dst:subreg32}", + [(set GR16:$dst, 0)]>; def MOV32r0 : I<0x31, MRMInitReg, (outs GR32:$dst), (ins), "xor{l}\t$dst, $dst", [(set GR32:$dst, 0)]>; @@ -2763,6 +2771,10 @@ // Some peepholes //===----------------------------------------------------------------------===// +// r & (2^16-1) ==> movz +def : Pat<(and GR32:$src1, 0xffff), + (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, x86_subreg_16bit)))>; + // (shl x, 1) ==> (add x, x) def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54223&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (added) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Wed Jul 30 13:09:17 2008 @@ -0,0 +1,51 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep and +; RUN: llvm-as < %s | llc -march=x86-64 > %t +; RUN: not grep and %t +; RUN: not grep movzbq %t +; RUN: not grep movzwq %t +; RUN: not grep movzlq %t + +; These should use movzbl instead of 'and 255'. +; This related to not having a ZERO_EXTEND_REG opcode. + +define i32 @c(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = and i32 %e, 65535 + ret i32 %retval +} +define i64 @e(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 65535 + ret i64 %retval +} +define i64 @f(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 4294967295 + ret i64 %retval +} + +define i32 @g(i8 %d) nounwind { + %e = add i8 %d, 1 + %retval = zext i8 %e to i32 + ret i32 %retval +} +define i32 @h(i16 %d) nounwind { + %e = add i16 %d, 1 + %retval = zext i16 %e to i32 + ret i32 %retval +} +define i64 @i(i8 %d) nounwind { + %e = add i8 %d, 1 + %retval = zext i8 %e to i64 + ret i64 %retval +} +define i64 @j(i16 %d) nounwind { + %e = add i16 %d, 1 + %retval = zext i16 %e to i64 + ret i64 %retval +} +define i64 @k(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = zext i32 %e to i64 + ret i64 %retval +} Added: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54223&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Wed Jul 30 13:09:17 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep and + +; These tests differ from the ones in zext-inreg-0.ll in that +; on x86-64 they do require and instructions. + +; These should use movzbl instead of 'and 255'. +; This related to not having ZERO_EXTEND_REG node. + +define i64 @h(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 281474976710655 + ret i64 %retval +} Added: llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll?rev=54223&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll (added) +++ llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll Wed Jul 30 13:09:17 2008 @@ -0,0 +1,28 @@ +; RUN: llvm-as < %s | llc -march=x86-64 > %t +; RUN: not grep and %t +; RUN: not grep movzbq %t +; RUN: not grep movzwq %t +; RUN: not grep movzlq %t + +; These should use movzbl instead of 'and 255'. +; This related to not having a ZERO_EXTEND_REG opcode. + +; This test was split out of zext-inreg-0.ll because these +; cases don't yet work on x86-32 due to the 8-bit subreg +; issue. + +define i32 @a(i32 %d) nounwind { + %e = add i32 %d, 1 + %retval = and i32 %e, 255 + ret i32 %retval +} +define i32 @b(float %d) nounwind { + %tmp12 = fptoui float %d to i8 + %retval = zext i8 %tmp12 to i32 + ret i32 %retval +} +define i64 @d(i64 %d) nounwind { + %e = add i64 %d, 1 + %retval = and i64 %e, 255 + ret i64 %retval +} From gohman at apple.com Wed Jul 30 13:23:36 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 30 Jul 2008 18:23:36 -0000 Subject: [llvm-commits] [llvm] r54224 - /llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll Message-ID: <200807301823.m6UINbb7001281@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 30 13:23:34 2008 New Revision: 54224 URL: http://llvm.org/viewvc/llvm-project?rev=54224&view=rev Log: I missed this file in r54223. movzbl is now used instead of movzbw here. Modified: llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll Modified: llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll?rev=54224&r1=54223&r2=54224&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll Wed Jul 30 13:23:34 2008 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s | llc -march=x86-64 > %t ; RUN: grep movb %t | count 2 -; RUN: grep movzbw %t +; RUN: grep {movzb\[wl\]} %t define void @handle_vector_size_attribute() { From resistor at mac.com Wed Jul 30 13:27:37 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jul 2008 18:27:37 -0000 Subject: [llvm-commits] [llvm] r54225 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200807301827.m6UIRbPe001403@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 30 13:27:35 2008 New Revision: 54225 URL: http://llvm.org/viewvc/llvm-project?rev=54225&view=rev Log: Use existing LiveInterval methods to simplify live interval merging. Thanks to Evan for pointing these out. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54225&r1=54224&r2=54225&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Wed Jul 30 13:27:35 2008 @@ -802,38 +802,39 @@ DenseMap VNMap; VNMap.insert(std::make_pair(RangeMergingIn->valno, NewVN)); - bool changed = true; - while (changed) { - changed = false; - for (LiveInterval::iterator RI = RHS.begin(), RE = RHS.end(); - RI != RE; ) - if (MergedVNs.count(RI->valno)) { - NewVN->hasPHIKill = true; - LiveRange NewRange(RI->start, RI->end, VNMap[RI->valno]); - LHS.addRange(NewRange); - - MachineInstr* instr = LI.getInstructionFromIndex(RI->start); - for (unsigned i = 0; i < instr->getNumOperands(); ++i) { - if (instr->getOperand(i).isReg() && - instr->getOperand(i).getReg() == secondary) - if (instr->isRegReDefinedByTwoAddr(secondary, i)) { - VNInfo* twoaddr = RHS.getLiveRangeContaining(RI->start-1)->valno; - MergedVNs.insert(twoaddr); - - VNInfo* NextVN = LHS.getNextValue(twoaddr->def, - twoaddr->copy, - LI.getVNInfoAllocator()); - VNMap.insert(std::make_pair(twoaddr, NextVN)); - } - } + // Find all VNs that are the inputs to two-address instructiosn + // chaining upwards from the VN we're trying to merge. + bool addedVN = true; + while (addedVN) { + addedVN = false; + unsigned defIndex = RHSVN->def; + + if (defIndex != ~0U) { + MachineInstr* instr = LI.getInstructionFromIndex(defIndex); - unsigned start = RI->start; - unsigned end = RI->end; - ++RI; - RHS.removeRange(start, end, true); - changed = true; - } else - ++RI; + for (unsigned i = 0; i < instr->getNumOperands(); ++i) { + if (instr->getOperand(i).isReg() && + instr->getOperand(i).getReg() == secondary) + if (instr->isRegReDefinedByTwoAddr(secondary, i)) { + RHSVN = RHS.getLiveRangeContaining(defIndex-1)->valno; + addedVN = true; + + VNInfo* NextVN = LHS.getNextValue(RHSVN->def, + RHSVN->copy, + LI.getVNInfoAllocator()); + VNMap.insert(std::make_pair(RHSVN, NextVN)); + + break; + } + } + } + } + + // Merge VNs from RHS into LHS using the mapping we computed above. + for (DenseMap::iterator VI = VNMap.begin(), + VE = VNMap.end(); VI != VE; ++VI) { + LHS.MergeValueInAsValue(RHS, VI->first, VI->second); + RHS.removeValNo(VI->first); } if (RHS.begin() == RHS.end()) From gohman at apple.com Wed Jul 30 13:37:03 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 30 Jul 2008 18:37:03 -0000 Subject: [llvm-commits] [llvm] r54226 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Generic/empty-load-store.ll Message-ID: <200807301837.m6UIb5cf001699@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 30 13:36:51 2008 New Revision: 54226 URL: http://llvm.org/viewvc/llvm-project?rev=54226&view=rev Log: Don't look for leaf values to store when lowering stores of empty structs. This fixes PR2612. Added: llvm/trunk/test/CodeGen/Generic/empty-load-store.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54226&r1=54225&r2=54226&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 30 13:36:51 2008 @@ -2928,9 +2928,7 @@ void SelectionDAGLowering::visitStore(StoreInst &I) { Value *SrcV = I.getOperand(0); - SDValue Src = getValue(SrcV); Value *PtrV = I.getOperand(1); - SDValue Ptr = getValue(PtrV); SmallVector ValueVTs; SmallVector Offsets; @@ -2939,6 +2937,12 @@ if (NumValues == 0) return; + // Get the lowered operands. Note that we do this after + // checking if NumResults is zero, because with zero results + // the operands won't have values in the map. + SDValue Src = getValue(SrcV); + SDValue Ptr = getValue(PtrV); + SDValue Root = getRoot(); SmallVector Chains(NumValues); MVT PtrVT = Ptr.getValueType(); Added: llvm/trunk/test/CodeGen/Generic/empty-load-store.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/empty-load-store.ll?rev=54226&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/empty-load-store.ll (added) +++ llvm/trunk/test/CodeGen/Generic/empty-load-store.ll Wed Jul 30 13:36:51 2008 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc +; PR2612 + + at current_foo = internal global { } zeroinitializer + +define i32 @foo() { +entry: + %retval = alloca i32 + store i32 0, i32* %retval + %local_foo = alloca { } + load { }* @current_foo + store { } %0, { }* %local_foo + br label %return + +return: + load i32* %retval + ret i32 %1 +} From isanbard at gmail.com Wed Jul 30 13:45:09 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 18:45:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54227 - /llvm-gcc-4.2/trunk/gcc/dwarf2out.c Message-ID: <200807301845.m6UIj9xr001987@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 13:45:09 2008 New Revision: 54227 URL: http://llvm.org/viewvc/llvm-project?rev=54227&view=rev Log: Don't use C language-specific stuff in here. Check for ObjC the correct way. Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=54227&r1=54226&r2=54227&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Wed Jul 30 13:45:09 2008 @@ -69,9 +69,6 @@ #include "hashtab.h" #include "cgraph.h" #include "input.h" -/* APPLE LOCAL radar 5811943 - Fix type of pointers to Blocks */ -/* APPLE LOCAL Radar 5741731, typedefs used in '@try' blocks */ -#include "c-common.h" #ifdef DWARF2_DEBUGGING_INFO static void dwarf2out_source_line (unsigned int, const char *); @@ -4099,6 +4096,7 @@ static inline dw_die_ref get_AT_ref (dw_die_ref, enum dwarf_attribute); static bool is_c_family (void); static bool is_cxx (void); +static bool is_objc(void); static bool is_java (void); static bool is_fortran (void); static bool is_ada (void); @@ -5493,6 +5491,16 @@ return lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus; } +/* Return TRUE if the language is objc. */ + +static inline bool +is_objc (void) +{ + unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language); + + return lang == DW_LANG_ObjC; +} + /* Return TRUE if the language is Fortran. */ static inline bool @@ -8615,7 +8623,7 @@ /* APPLE LOCAL begin Radar 5741731, typedefs used in '@try' blocks */ if (is_volatile_type - && c_dialect_objc () + && is_objc () && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type))) { is_volatile_type = 0; From gohman at apple.com Wed Jul 30 13:48:54 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 30 Jul 2008 18:48:54 -0000 Subject: [llvm-commits] [llvm] r54228 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200807301848.m6UImshq002103@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 30 13:48:53 2008 New Revision: 54228 URL: http://llvm.org/viewvc/llvm-project?rev=54228&view=rev Log: Move SelectionDAG::viewGraph() out of line; as an inline function it isn't always visible to gdb. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=54228&r1=54227&r2=54228&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Jul 30 13:48:53 2008 @@ -117,7 +117,7 @@ /// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'. /// void viewGraph(const std::string &Title); - void viewGraph() { return viewGraph(""); } + void viewGraph(); #ifndef NDEBUG std::map NodeGraphAttrs; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=54228&r1=54227&r2=54228&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Wed Jul 30 13:48:53 2008 @@ -252,6 +252,11 @@ #endif // NDEBUG } +// This overload is defined out-of-line here instead of just using a +// default parameter because this is easiest for gdb to call. +void SelectionDAG::viewGraph() { + viewGraph(""); +} /// clearGraphAttrs - Clear all previously defined node graph attributes. /// Intended to be used from a debugging tool (eg. gdb). From bruno.cardoso at gmail.com Wed Jul 30 14:00:31 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 30 Jul 2008 19:00:31 -0000 Subject: [llvm-commits] [llvm] r54229 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsInstrFPU.td Message-ID: <200807301900.m6UJ0VK8002553@zion.cs.uiuc.edu> Author: bruno Date: Wed Jul 30 14:00:31 2008 New Revision: 54229 URL: http://llvm.org/viewvc/llvm-project?rev=54229&view=rev Log: Added pattern for floating point zero immediate (avoiding a constant pool access). Added pattern to match bitconvert node. Fixed MTC1 asm string bug. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54229&r1=54228&r2=54229&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jul 30 14:00:31 2008 @@ -77,6 +77,9 @@ } else addRegisterClass(MVT::f32, Mips::FGR32RegisterClass); + // Legal fp constants + addLegalFPImmediate(APFloat(+0.0f)); + // Load extented operations for i1 types must be promoted setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote); Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=54229&r1=54228&r2=54229&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Wed Jul 30 14:00:31 2008 @@ -194,13 +194,13 @@ "mfc1 $rt, $fs", []>; def MTC1 : FFR<0x11, 0x00, 0x04, (outs FGR32:$fs), (ins CPURegs:$rt), - "mtc1 $fs, $rt", []>; + "mtc1 $rt, $fs", []>; def MFC1A : FFR<0x11, 0x00, 0x00, (outs CPURegs:$rt), (ins AFGR32:$fs), "mfc1 $rt, $fs", []>; def MTC1A : FFR<0x11, 0x00, 0x04, (outs AFGR32:$fs), (ins CPURegs:$rt), - "mtc1 $fs, $rt", []>; + "mtc1 $rt, $fs", []>; } /// Floating Point Memory Instructions @@ -324,8 +324,18 @@ //===----------------------------------------------------------------------===// // Floating Point Patterns //===----------------------------------------------------------------------===// +def fpimm0 : PatLeaf<(fpimm), [{ + return N->isExactlyValue(+0.0); +}]>; + +def : Pat<(f32 fpimm0), (MTC1 ZERO)>, Requires<[IsSingleFloat]>; +def : Pat<(f32 fpimm0), (MTC1A ZERO)>, Requires<[In32BitMode]>; + def : Pat<(f32 (sint_to_fp CPURegs:$src)), (CVTS_W32 (MTC1 CPURegs:$src))>; def : Pat<(f64 (sint_to_fp CPURegs:$src)), (CVTD_W32 (MTC1 CPURegs:$src))>; + def : Pat<(i32 (fp_to_sint FGR32:$src)), (MFC1 (TRUNC_W_SO32 FGR32:$src))>; -def : Pat<(i32 (fp_to_sint AFGR32:$src)), (MFC1 (TRUNC_W_AS32 AFGR32:$src))>; +def : Pat<(i32 (fp_to_sint AFGR32:$src)), (MFC1A (TRUNC_W_AS32 AFGR32:$src))>; +def : Pat<(i32 (bitconvert FGR32:$src)), (MFC1 FGR32:$src)>; +def : Pat<(i32 (bitconvert AFGR32:$src)), (MFC1A AFGR32:$src)>; From isanbard at gmail.com Wed Jul 30 14:41:32 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 19:41:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54230 - in /llvm-gcc-4.2/trunk/gcc: c-common.h dwarf2out.c stub-c.c tree.h Message-ID: <200807301941.m6UJfXBx004198@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 14:41:32 2008 New Revision: 54230 URL: http://llvm.org/viewvc/llvm-project?rev=54230&view=rev Log: Fix for using invoke_impl_ptr in dwarf2out.c. Modified: llvm-gcc-4.2/trunk/gcc/c-common.h llvm-gcc-4.2/trunk/gcc/dwarf2out.c llvm-gcc-4.2/trunk/gcc/stub-c.c llvm-gcc-4.2/trunk/gcc/tree.h Modified: llvm-gcc-4.2/trunk/gcc/c-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=54230&r1=54229&r2=54230&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.h Wed Jul 30 14:41:32 2008 @@ -1164,7 +1164,6 @@ extern struct block_sema_info *cur_block; extern tree build_helper_func_decl (tree, tree); extern bool building_block_byref_decl; -extern tree invoke_impl_ptr_type; extern tree build_block_byref_decl (tree, tree, tree); extern tree build_block_ref_decl (tree, tree); extern tree begin_block (void); Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=54230&r1=54229&r2=54230&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Wed Jul 30 14:41:32 2008 @@ -11480,9 +11480,8 @@ dw_die_ref type_die = NULL; /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks */ - if (code == BLOCK_POINTER_TYPE) + if (code == BLOCK_POINTER_TYPE && invoke_impl_ptr_type) { - gcc_assert (invoke_impl_ptr_type); type = invoke_impl_ptr_type; code = TREE_CODE (type); } Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=54230&r1=54229&r2=54230&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Wed Jul 30 14:41:32 2008 @@ -32,6 +32,7 @@ bool iasm_in_operands ATTRIBUTE_WEAK; int flag_iasm_blocks ATTRIBUTE_WEAK; int parse_in ATTRIBUTE_WEAK; +tree invoke_impl_ptr_type; tree iasm_addr (tree) ATTRIBUTE_WEAK; Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=54230&r1=54229&r2=54230&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Wed Jul 30 14:41:32 2008 @@ -4845,4 +4845,8 @@ extern void note_alternative_entry_points (void); /* APPLE LOCAL end CW asm blocks */ +/* LLVM LOCAL pointers to blocks */ +extern tree invoke_impl_ptr_type; +/* LLVM LOCAL pointers to blocks */ + #endif /* GCC_TREE_H */ From isanbard at gmail.com Wed Jul 30 14:43:25 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 19:43:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54231 - in /llvm-gcc-4.2/trunk/gcc: c-opts.c flags.h llvm-backend.cpp Message-ID: <200807301943.m6UJhQlO004263@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 14:43:25 2008 New Revision: 54231 URL: http://llvm.org/viewvc/llvm-project?rev=54231&view=rev Log: Don't use C-specific headers in llvm files Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c llvm-gcc-4.2/trunk/gcc/flags.h llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54231&r1=54230&r2=54231&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 14:43:25 2008 @@ -660,6 +660,9 @@ case OPT_fbuiltin: flag_no_builtin = !value; +#ifdef LLVM + flag_no_simplify_libcalls = !value; +#endif break; case OPT_fbuiltin_: @@ -685,6 +688,9 @@ case OPT_fhosted: flag_hosted = value; flag_no_builtin = !value; +#ifdef LLVM + flag_no_simplify_libcalls = !value; +#endif /* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */ if (!value && warn_main == 2) warn_main = 0; Modified: llvm-gcc-4.2/trunk/gcc/flags.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flags.h?rev=54231&r1=54230&r2=54231&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/flags.h (original) +++ llvm-gcc-4.2/trunk/gcc/flags.h Wed Jul 30 14:43:25 2008 @@ -391,6 +391,7 @@ /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM extern int flag_llvm_pch_read; +extern int flag_no_simplify_libcalls; #endif /* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=54231&r1=54230&r2=54231&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Jul 30 14:43:25 2008 @@ -70,12 +70,14 @@ #include "tree-inline.h" #include "langhooks.h" #include "cgraph.h" -#include "c-common.h" } // Non-zero if bytecode from PCH is successfully read. int flag_llvm_pch_read; +// Non-zero if libcalls should not be simplified. +int flag_no_simplify_libcalls; + // Global state for the LLVM backend. Module *TheModule = 0; DebugInfo *TheDebugInfo = 0; @@ -381,7 +383,7 @@ PM->add(createFunctionInliningPass()); // Inline small functions if (optimize > 2) PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args - if (!flag_no_builtin) + if (!flag_no_simplify_libcalls) PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. PM->add(createJumpThreadingPass()); // Thread jumps. From baldrick at free.fr Wed Jul 30 14:50:35 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 30 Jul 2008 19:50:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54232 - /llvm-gcc-4.2/trunk/gcc/c-opts.c Message-ID: <200807301950.m6UJoaW1004565@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 30 14:50:35 2008 New Revision: 54232 URL: http://llvm.org/viewvc/llvm-project?rev=54232&view=rev Log: Add forgotten LLVM local markers. Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54232&r1=54231&r2=54232&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 14:50:35 2008 @@ -660,9 +660,11 @@ case OPT_fbuiltin: flag_no_builtin = !value; + /* LLVM LOCAL begin */ #ifdef LLVM flag_no_simplify_libcalls = !value; #endif + /* LLVM LOCAL end */ break; case OPT_fbuiltin_: @@ -688,9 +690,11 @@ case OPT_fhosted: flag_hosted = value; flag_no_builtin = !value; + /* LLVM LOCAL begin */ #ifdef LLVM flag_no_simplify_libcalls = !value; #endif + /* LLVM LOCAL end */ /* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */ if (!value && warn_main == 2) warn_main = 0; From baldrick at free.fr Wed Jul 30 14:51:18 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 30 Jul 2008 19:51:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54233 - /llvm-gcc-4.2/trunk/gcc/stub-c.c Message-ID: <200807301951.m6UJpIsX004606@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 30 14:51:18 2008 New Revision: 54233 URL: http://llvm.org/viewvc/llvm-project?rev=54233&view=rev Log: Make this a weak symbol, just in case. Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=54233&r1=54232&r2=54233&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Wed Jul 30 14:51:18 2008 @@ -32,7 +32,7 @@ bool iasm_in_operands ATTRIBUTE_WEAK; int flag_iasm_blocks ATTRIBUTE_WEAK; int parse_in ATTRIBUTE_WEAK; -tree invoke_impl_ptr_type; +tree invoke_impl_ptr_type ATTRIBUTE_WEAK; tree iasm_addr (tree) ATTRIBUTE_WEAK; From isanbard at gmail.com Wed Jul 30 14:51:53 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 19:51:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54234 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <200807301951.m6UJprbA004648@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 14:51:52 2008 New Revision: 54234 URL: http://llvm.org/viewvc/llvm-project?rev=54234&view=rev Log: rename objc_create_init_utf16_var to create_init_utf16_var. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54234&r1=54233&r2=54234&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 14:51:52 2008 @@ -19872,7 +19872,6 @@ /* APPLE LOCAL end radar 4985544 - 5195402 */ /* LLVM LOCAL begin */ -#ifdef ENABLE_LLVM /* APPLE LOCAL begin radar 2996215 */ /* Objc wrapper to call libcpp's conversion routine. */ static bool @@ -19887,7 +19886,7 @@ section and initializes it with uniCharBuf[numUniChars] characters. */ tree -objc_create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUniChars) +create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUniChars) { size_t l; tree decl, type, init; @@ -19918,7 +19917,6 @@ finish_var_decl (decl, init); return decl; } -#endif /* APPLE LOCAL end radar 2996215 */ /* APPLE LOCAL begin radar 5202926 */ From isanbard at gmail.com Wed Jul 30 14:58:36 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 19:58:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54235 - /llvm-gcc-4.2/trunk/gcc/final.c Message-ID: <200807301958.m6UJwa69004957@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 14:58:36 2008 New Revision: 54235 URL: http://llvm.org/viewvc/llvm-project?rev=54235&view=rev Log: Conditionalize this function on whether ENABLE_LLVM is defined. Modified: llvm-gcc-4.2/trunk/gcc/final.c Modified: llvm-gcc-4.2/trunk/gcc/final.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/final.c?rev=54235&r1=54234&r2=54235&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/final.c (original) +++ llvm-gcc-4.2/trunk/gcc/final.c Wed Jul 30 14:58:36 2008 @@ -255,8 +255,11 @@ static tree get_mem_expr_from_op (rtx, int *); static void output_asm_operand_names (rtx *, int *, int); static void output_operand (rtx, int); -/* APPLE LOCAL ARM compact switch tables */ +/* APPLE LOCAL - begin ARM compact switch tables */ +#ifndef ENABLE_LLVM static void calculate_alignments (void); +#endif +/* APPLE LOCAL - end ARM compact switch tables */ #ifdef LEAF_REGISTERS static void leaf_renumber_regs (rtx); #endif From isanbard at gmail.com Wed Jul 30 15:13:06 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 20:13:06 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54236 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <200807302013.m6UKD68W005398@zion.cs.uiuc.edu> Author: void Date: Wed Jul 30 15:13:05 2008 New Revision: 54236 URL: http://llvm.org/viewvc/llvm-project?rev=54236&view=rev Log: This is now defined and used in config/darwin* code. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54236&r1=54235&r2=54236&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 15:13:05 2008 @@ -19871,54 +19871,6 @@ } /* APPLE LOCAL end radar 4985544 - 5195402 */ -/* LLVM LOCAL begin */ -/* APPLE LOCAL begin radar 2996215 */ -/* Objc wrapper to call libcpp's conversion routine. */ -static bool -objc_cvt_utf8_utf16 (const unsigned char *inbuf, size_t length, - unsigned char **uniCharBuf, size_t *numUniChars) -{ - return cpp_utf8_utf16 (parse_in, inbuf, length, uniCharBuf, numUniChars); -} -/* LLVM LOCAL end */ - -/* This routine declares static char __utf16_string [numUniChars] in __TEXT,__ustring - section and initializes it with uniCharBuf[numUniChars] characters. -*/ -tree -create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUniChars) -{ - size_t l; - tree decl, type, init; - tree initlist = NULL_TREE; - tree attribute; - const char *section_name = "__TEXT,__ustring"; - int len = strlen (section_name); - unsigned char *uniCharBuf; - static int num; - static char name[BUFSIZE]; - - if (!objc_cvt_utf8_utf16 (inbuf, length, &uniCharBuf, numUniChars)) - return NULL_TREE; - - for (l = 0; l < *numUniChars; l++) - initlist = tree_cons (NULL_TREE, build_int_cst (char_type_node, uniCharBuf[l]), initlist); - type = build_array_type (char_type_node, - build_index_type (build_int_cst (NULL_TREE, *numUniChars))); - sprintf (name, "__utf16_string_%d", ++num); - decl = start_var_decl (type, name); - attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE); - attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE); - decl_attributes (&decl, attribute, 0); - attribute = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 2), NULL_TREE); - attribute = tree_cons (get_identifier ("aligned"), attribute, NULL_TREE); - decl_attributes (&decl, attribute, 0); - init = objc_build_constructor (type, nreverse (initlist)); - finish_var_decl (decl, init); - return decl; -} -/* APPLE LOCAL end radar 2996215 */ - /* APPLE LOCAL begin radar 5202926 */ /* This routine returns 'true' if given NAME is the special objective-c anonymous file-scope static name. It accomodates c++'s mangling of such From tonic at nondot.org Wed Jul 30 16:02:58 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 30 Jul 2008 16:02:58 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807302102.m6UL2wri007051@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.20 -> 1.21 --- Log message: Update schedule. --- Diffs of the changes: (+5 -5) index.php | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.20 llvm-www/devmtg/index.php:1.21 --- llvm-www/devmtg/index.php:1.20 Sat Jul 26 18:21:03 2008 +++ llvm-www/devmtg/index.php Wed Jul 30 16:01:57 2008 @@ -122,12 +122,12 @@
- - - - + + + + @@ -138,7 +138,7 @@ Nicolas Geoffray, Universite Pierre et Marie Curie - +
11:40-12:10LLVM Panel DiscussionLLVM Code Owners
12:10-1:30LUNCH
1:30-2:05
Garage1:Finding Bugs with Source Code AnalysisTed Kremenek
Garage2:Building a JIT compiler for PHP in 2 daysNuno Lopes, Instituto Superior Tecnico
2:10-2:45
Garage1:Adobe Image Foundation and Adobe PixelBender Chuck Rose III, Adobe
Garage2:Cell BackendScott Michel, Aerospace
Garage2:
2:10-2:45
Garage1:Finding Bugs with Source Code AnalysisTed Kremenek
Garage2:Building a JIT compiler for PHP in 2 daysNuno Lopes, Instituto Superior Tecnico
2:50-3:25
Garage1:llvmc2 Anton Korobeynikov, Saint Petersburg State University
Garage2:The LLVM Hardware BackendTim Sander, Technischen Universitat Darmstadt
4:25-5:00
Garage1:Targeting the Adobe Flash Virtual MachineScott Peterson, Adobe
Garage1:Targeting the Adobe Flash Virtual MachineScott Petersen, Adobe
5:30-7:30DINNER (Must have registered w/ dinner option)
From tonic at nondot.org Wed Jul 30 16:03:46 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 30 Jul 2008 16:03:46 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807302103.m6UL3k7E007100@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.21 -> 1.22 --- Log message: Make a note that registration was required. --- Diffs of the changes: (+2 -0) index.php | 2 ++ 1 files changed, 2 insertions(+) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.21 llvm-www/devmtg/index.php:1.22 --- llvm-www/devmtg/index.php:1.21 Wed Jul 30 16:01:57 2008 +++ llvm-www/devmtg/index.php Wed Jul 30 16:03:27 2008 @@ -49,6 +49,8 @@ C-based languages (see information on the meeting's agenda for more information).

+

Please note that registration was required for this event.

+
Mailing List

Please sign up for the LLVM Developers' Meeting mailing list From tonic at nondot.org Wed Jul 30 16:04:43 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 30 Jul 2008 16:04:43 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807302104.m6UL4hlV007149@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.22 -> 1.23 --- Log message: Make bigger. --- Diffs of the changes: (+1 -1) index.php | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.22 llvm-www/devmtg/index.php:1.23 --- llvm-www/devmtg/index.php:1.22 Wed Jul 30 16:03:27 2008 +++ llvm-www/devmtg/index.php Wed Jul 30 16:04:25 2008 @@ -49,7 +49,7 @@ C-based languages (see information on the meeting's agenda for more information).

-

Please note that registration was required for this event.

+

Please note that registration is required for this event.

Mailing List
From dalej at apple.com Wed Jul 30 18:51:53 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 30 Jul 2008 23:51:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54238 - /llvm-gcc-4.2/trunk/gcc/c-opts.c Message-ID: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> Author: johannes Date: Wed Jul 30 18:51:52 2008 New Revision: 54238 URL: http://llvm.org/viewvc/llvm-project?rev=54238&view=rev Log: Fix -fno-builtin, broken by 54231. Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54238&r1=54237&r2=54238&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 18:51:52 2008 @@ -661,7 +661,7 @@ case OPT_fbuiltin: flag_no_builtin = !value; /* LLVM LOCAL begin */ -#ifdef LLVM +#ifdef ENABLE_LLVM flag_no_simplify_libcalls = !value; #endif /* LLVM LOCAL end */ @@ -691,7 +691,7 @@ flag_hosted = value; flag_no_builtin = !value; /* LLVM LOCAL begin */ -#ifdef LLVM +#ifdef ENABLE_LLVM flag_no_simplify_libcalls = !value; #endif /* LLVM LOCAL end */ From monping at apple.com Wed Jul 30 18:54:02 2008 From: monping at apple.com (Mon P Wang) Date: Wed, 30 Jul 2008 16:54:02 -0700 Subject: [llvm-commits] [LLVMdev] address space overloading patch broke the llvm-gcc build In-Reply-To: <7B1B212C-1953-4784-99FD-AC99C45696B5@apple.com> References: <200807302251.12397.baldrick@free.fr> <0447FBEA-7221-482F-86A6-8F18438C994F@apple.com> <3D31CAA7-849C-444E-87FB-4FA355652AC5@apple.com> <7B1B212C-1953-4784-99FD-AC99C45696B5@apple.com> Message-ID: <9D0032A6-5287-4B64-A5BE-3E2A0C117145@apple.com> Hi, Here is the patch to fix the llvm-gcc to create the new intrinsic names for the atomics. -- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: addr_patch Type: application/octet-stream Size: 13910 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080730/30bb5bf9/attachment.obj -------------- next part -------------- On Jul 30, 2008, at 3:13 PM, Mon P Wang wrote: >> >>> Hi, >>> >>> Sorry for breakage, I'll look into this right now. I guess llvm-gcc >>> doesn't use llvm tablegen results to help create intrinsic names. >>> >>> -- Mon Ping >> >> It calls Intrinsic::getDeclaration. >> >>> On Jul 30, 2008, at 1:51 PM, Duncan Sands wrote: >>> >>>> Hi, I see this when building llvm-gcc on x86-32 linux: >>>> >>>> xgcc -Bgcc/ -B/usr/local/gnat-llvm/i686-pc-linux-gnu/bin/ -B/usr/ >>>> local/gnat-llvm/i686-pc-linux-gnu/lib/ -isystem /usr/local/gnat- >>>> llvm/ >>>> i686-pc-linux-gnu/include -isystem /usr/local/gnat-llvm/i686-pc- >>>> linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.2.llvm/ >>>> libgomp -I. -I../../../gcc-4.2.llvm/libgomp/config/linux/x86 - >>>> I../../../gcc-4.2.llvm/libgomp/config/linux -I../../../ >>>> gcc-4.2.llvm/ >>>> libgomp/config/posix -I../../../gcc-4.2.llvm/libgomp -Wall - >>>> Werror - >>>> ftls-model=initial-exec -march=i486 -pthread -mtune=i686 -O2 -g - >>>> O2 - >>>> MT critical.lo -MD -MP -MF .deps/critical.Tpo -c ../../../ >>>> gcc-4.2.llvm/libgomp/critical.c -fPIC -DPIC -o .libs/critical.o >>>> Overloaded intrinsic has incorrect suffix: '.i8'. It should be >>>> '.i8.p0i8' >>>> i8 (i8*, i8)* @llvm.atomic.swap.i8 >>>> Broken module found, compilation aborted! >>>> ../../../gcc-4.2.llvm/libgomp/critical.c: In function >>>> 'GOMP_critical_end': >>>> ../../../gcc-4.2.llvm/libgomp/critical.c:44: internal compiler >>>> error: Aborted >>>> >>>> So I guess your address space overloading patch broke llvm-gcc. >>>> >>>> Ciao, >>>> >>>> Duncan. >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From gohman at apple.com Wed Jul 30 19:50:32 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 31 Jul 2008 00:50:32 -0000 Subject: [llvm-commits] [llvm] r54239 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/sext-trunc.ll Message-ID: <200807310050.m6V0oWAh015041@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 30 19:50:31 2008 New Revision: 54239 URL: http://llvm.org/viewvc/llvm-project?rev=54239&view=rev Log: Improve dagcombining for sext-loads and sext-in-reg nodes. Added: llvm/trunk/test/CodeGen/X86/sext-trunc.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=54239&r1=54238&r2=54239&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jul 30 19:50:31 2008 @@ -3060,8 +3060,12 @@ LN0->isVolatile(), LN0->getAlignment()); CombineTo(N, ExtLoad); - CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), - ExtLoad.getValue(1)); + // Redirect any chain users to the new load. + DAG.ReplaceAllUsesOfValueWith(SDValue(LN0, 1), SDValue(ExtLoad.Val, 1)); + // If any node needs the original loaded value, recompute it. + if (!LN0->use_empty()) + CombineTo(LN0, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), + ExtLoad.getValue(1)); return SDValue(N, 0); // Return N so it doesn't get rechecked! } @@ -3169,17 +3173,16 @@ // Do not generate loads of non-round integer types since these can // be expensive (and would be wrong if the type is not byte sized). - if (ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse() && VT.isRound() && + if (isa(N0) && N0.hasOneUse() && VT.isRound() && + cast(N0)->getMemoryVT().getSizeInBits() > EVTBits && // Do not change the width of a volatile load. !cast(N0)->isVolatile()) { - assert(N0.getValueType().getSizeInBits() > EVTBits && - "Cannot truncate to larger type!"); LoadSDNode *LN0 = cast(N0); MVT PtrType = N0.getOperand(1).getValueType(); // For big endian targets, we need to adjust the offset to the pointer to // load the correct bytes. if (TLI.isBigEndian()) { - unsigned LVTStoreBits = N0.getValueType().getStoreSizeInBits(); + unsigned LVTStoreBits = LN0->getMemoryVT().getStoreSizeInBits(); unsigned EVTStoreBits = EVT.getStoreSizeInBits(); ShAmt = LVTStoreBits - EVTStoreBits - ShAmt; } @@ -3190,11 +3193,11 @@ AddToWorkList(NewPtr.Val); SDValue Load = (ExtType == ISD::NON_EXTLOAD) ? DAG.getLoad(VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), + LN0->getSrcValue(), LN0->getSrcValueOffset() + PtrOff, LN0->isVolatile(), NewAlign) : DAG.getExtLoad(ExtType, VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), NewAlign); + LN0->getSrcValue(), LN0->getSrcValueOffset() + PtrOff, + EVT, LN0->isVolatile(), NewAlign); AddToWorkList(N); if (CombineSRL) { WorkListRemover DeadNodes(*this); @@ -3238,6 +3241,15 @@ return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0), N1); } + // fold (sext_in_reg (sext x)) -> (sext x) + // fold (sext_in_reg (aext x)) -> (sext x) + // if x is small enough. + if (N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND) { + SDValue N00 = N0.getOperand(0); + if (N00.getValueType().getSizeInBits() < EVTBits) + return DAG.getNode(ISD::SIGN_EXTEND, VT, N00, N1); + } + // fold (sext_in_reg x) -> (zext_in_reg x) if the sign bit is known zero. if (DAG.MaskedValueIsZero(N0, APInt::getBitsSet(VTBits, EVTBits-1, EVTBits))) return DAG.getZeroExtendInReg(N0, EVT); Added: llvm/trunk/test/CodeGen/X86/sext-trunc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-trunc.ll?rev=54239&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/sext-trunc.ll (added) +++ llvm/trunk/test/CodeGen/X86/sext-trunc.ll Wed Jul 30 19:50:31 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86 > %t +; RUN: grep movsbl %t +; RUN: not grep movz %t +; RUN: not grep and %t + +define i8 @foo(i16 signext %x) signext nounwind { + %retval56 = trunc i16 %x to i8 + ret i8 %retval56 +} From wangmp at apple.com Wed Jul 30 22:20:32 2008 From: wangmp at apple.com (Mon P Wang) Date: Thu, 31 Jul 2008 03:20:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> Author: wangmp Date: Wed Jul 30 22:20:30 2008 New Revision: 54240 URL: http://llvm.org/viewvc/llvm-project?rev=54240&view=rev Log: Updated atomic intrinsics names to match new names from r54195 Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=54240&r1=54239&r2=54240&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Jul 30 22:20:30 2008 @@ -4520,18 +4520,19 @@ Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); - C[2] = Builder.CreateIntCast(C[2], Ty, "cast"); + const Type* Ty[2]; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); + C[2] = Builder.CreateIntCast(C[2], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_cmp_swap, - &Ty, 1), + Ty, 2), C, C + 3); if (((DECL_FUNCTION_CODE(fndecl)) == BUILT_IN_BOOL_COMPARE_AND_SWAP_1) || ((DECL_FUNCTION_CODE(fndecl)) == BUILT_IN_BOOL_COMPARE_AND_SWAP_2) || @@ -4555,15 +4556,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_add, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4580,15 +4583,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_sub, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4605,15 +4610,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_or, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4630,15 +4637,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_and, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4655,15 +4664,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_xor, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4680,15 +4691,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_nand, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); return true; @@ -4706,15 +4719,17 @@ }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_swap, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateIntToPtr(Result, OrigTy); @@ -4732,15 +4747,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_add, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateAdd(Result, C[1]); Result = Builder.CreateIntToPtr(Result, OrigTy); @@ -4758,15 +4775,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_sub, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateSub(Result, C[1]); Result = Builder.CreateIntToPtr(Result, OrigTy); @@ -4784,15 +4803,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_or, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateOr(Result, C[1]); Result = Builder.CreateIntToPtr(Result, OrigTy); @@ -4810,15 +4831,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_xor, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateXor(Result, C[1]); Result = Builder.CreateIntToPtr(Result, OrigTy); @@ -4836,15 +4859,17 @@ Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); - const Type* Ty = OrigTy; - if (isa(Ty)) - Ty = TD.getIntPtrType(); - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_nand, - &Ty, 1), + Ty, 2), C, C + 2); Result = Builder.CreateAnd(Builder.CreateNot(Result), C[1]); Result = Builder.CreateIntToPtr(Result, OrigTy); From isanbard at gmail.com Wed Jul 30 23:36:07 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 30 Jul 2008 21:36:07 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54238 - /llvm-gcc-4.2/trunk/gcc/c-opts.c In-Reply-To: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> References: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> Message-ID: Thanks, Dale. I think my fingers got tired of typing ENABLE_LLVM all over the place. :-) -bw On Jul 30, 2008, at 4:51 PM, Dale Johannesen wrote: > Author: johannes > Date: Wed Jul 30 18:51:52 2008 > New Revision: 54238 > > URL: http://llvm.org/viewvc/llvm-project?rev=54238&view=rev > Log: > Fix -fno-builtin, broken by 54231. > > > Modified: > llvm-gcc-4.2/trunk/gcc/c-opts.c > > Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54238&r1=54237&r2=54238&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) > +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 18:51:52 2008 > @@ -661,7 +661,7 @@ > case OPT_fbuiltin: > flag_no_builtin = !value; > /* LLVM LOCAL begin */ > -#ifdef LLVM > +#ifdef ENABLE_LLVM > flag_no_simplify_libcalls = !value; > #endif > /* LLVM LOCAL end */ > @@ -691,7 +691,7 @@ > flag_hosted = value; > flag_no_builtin = !value; > /* LLVM LOCAL begin */ > -#ifdef LLVM > +#ifdef ENABLE_LLVM > flag_no_simplify_libcalls = !value; > #endif > /* LLVM LOCAL end */ > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Thu Jul 31 00:57:08 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 31 Jul 2008 05:57:08 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54243 - /llvm-gcc-4.2/trunk/gcc/dwarf2out.c Message-ID: <200807310557.m6V5v8Z8024261@zion.cs.uiuc.edu> Author: void Date: Thu Jul 31 00:57:07 2008 New Revision: 54243 URL: http://llvm.org/viewvc/llvm-project?rev=54243&view=rev Log: Take into account Obj-C++. Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=54243&r1=54242&r2=54243&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Thu Jul 31 00:57:07 2008 @@ -4096,7 +4096,10 @@ static inline dw_die_ref get_AT_ref (dw_die_ref, enum dwarf_attribute); static bool is_c_family (void); static bool is_cxx (void); +/* LLVM LOCAL begin */ static bool is_objc(void); +static bool is_objcxx(void); +/* LLVM LOCAL end */ static bool is_java (void); static bool is_fortran (void); static bool is_ada (void); @@ -5491,6 +5494,7 @@ return lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus; } +/* LLVM LOCAL begin */ /* Return TRUE if the language is objc. */ static inline bool @@ -5501,6 +5505,17 @@ return lang == DW_LANG_ObjC; } +/* Return TRUE if the language is objc++. */ + +static inline bool +is_objcxx (void) +{ + unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language); + + return lang == DW_LANG_ObjC_plus_plus; +} +/* LLVM LOCAL end */ + /* Return TRUE if the language is Fortran. */ static inline bool @@ -8623,7 +8638,8 @@ /* APPLE LOCAL begin Radar 5741731, typedefs used in '@try' blocks */ if (is_volatile_type - && is_objc () + /* LLVM LOCAL */ + && (is_objc () || is_objcxx ()) && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type))) { is_volatile_type = 0; From baldrick at free.fr Thu Jul 31 02:16:26 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 31 Jul 2008 09:16:26 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> Message-ID: <200807310916.26691.baldrick@free.fr> Hi, > @@ -4520,18 +4520,19 @@ > Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0) > }; > const Type *OrigTy = cast(C[0]->getType())->getElementType(); > - const Type* Ty = OrigTy; > - if (isa(Ty)) > - Ty = TD.getIntPtrType(); > - > - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); > - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); > - C[2] = Builder.CreateIntCast(C[2], Ty, "cast"); > + const Type* Ty[2]; > + if (isa(Ty[0])) You just used Ty[0] uninitialized. > @@ -4555,15 +4556,17 @@ > Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) > }; > const Type *OrigTy = cast(C[0]->getType())->getElementType(); > - const Type* Ty = OrigTy; > - if (isa(Ty)) > - Ty = TD.getIntPtrType(); > - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); > - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); > + const Type* Ty[2]; > + Ty[0] = OrigTy; > + if (isa(Ty[0])) > + Ty[0] = TD.getIntPtrType(); > + Ty[1] = C[0]->getType(); Here you may well have used C[0] uninitialized. More cases of this occur in the rest of the patch. Also, how about factorizing this code while you are there? It seems to be many copies of the same thing. Best wishes, Duncan. From baldrick at free.fr Thu Jul 31 02:20:22 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 31 Jul 2008 09:20:22 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54243 - /llvm-gcc-4.2/trunk/gcc/dwarf2out.c In-Reply-To: <200807310557.m6V5v8Z8024261@zion.cs.uiuc.edu> References: <200807310557.m6V5v8Z8024261@zion.cs.uiuc.edu> Message-ID: <200807310920.23026.baldrick@free.fr> Hi, > Take into account Obj-C++. I wondered about ObjC++, but the original patch (using dialect) seemed to only consider objc, so... Ciao, Duncan. From isanbard at gmail.com Thu Jul 31 02:28:59 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 31 Jul 2008 07:28:59 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54245 - in /llvm-gcc-4.2/trunk/gcc: gsyslimits.h limitx.h limity.h Message-ID: <200807310728.m6V7SxZA028521@zion.cs.uiuc.edu> Author: void Date: Thu Jul 31 02:28:59 2008 New Revision: 54245 URL: http://llvm.org/viewvc/llvm-project?rev=54245&view=rev Log: Grotesque hack to get the limits.h stuff working on non-Darwin platforms. This reverts the behavior to the old way of doing things if we're not on Darwin. Modified: llvm-gcc-4.2/trunk/gcc/gsyslimits.h llvm-gcc-4.2/trunk/gcc/limitx.h llvm-gcc-4.2/trunk/gcc/limity.h Modified: llvm-gcc-4.2/trunk/gcc/gsyslimits.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gsyslimits.h?rev=54245&r1=54244&r2=54245&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gsyslimits.h (original) +++ llvm-gcc-4.2/trunk/gcc/gsyslimits.h Thu Jul 31 02:28:59 2008 @@ -5,4 +5,10 @@ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ /* APPLE LOCAL begin 4401222 */ +/* LLVM LOCAL */ +#ifndef CONFIG_DARWIN_H +#include_next +#undef _GCC_NEXT_LIMITS_H +/* LLVM LOCAL */ +#endif /* not CONFIG_DARWIN_H */ /* APPLE LOCAL end 4401222 */ Modified: llvm-gcc-4.2/trunk/gcc/limitx.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/limitx.h?rev=54245&r1=54244&r2=54245&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/limitx.h (original) +++ llvm-gcc-4.2/trunk/gcc/limitx.h Thu Jul 31 02:28:59 2008 @@ -2,6 +2,27 @@ if the system has its own version of limits.h. */ /* APPLE LOCAL begin 4401222 */ +/* LLVM LOCAL */ +#ifdef CONFIG_DARWIN_H + +#ifndef _LIBC_LIMITS_H_ +/* Use "..." so that we find syslimits.h only in this same directory. */ +#include "syslimits.h" +#endif +#ifdef _GCC_NEXT_LIMITS_H +#include_next +#undef _GCC_NEXT_LIMITS_H +#endif + +/* LLVM LOCAL begin */ +#endif /* not CONFIG_DARWIN_H */ + +/* We use _GCC_LIMITS_H_ because we want this not to match + any macros that the system's limits.h uses for its own purposes. */ +/* LLVM LOCAL */ +#if !defined(_GCC_LIMITS_H_) && !defined(CONFIG_DARWIN_H) /* Terminated in limity.h. */ +#define _GCC_LIMITS_H_ + #ifndef _LIBC_LIMITS_H_ /* Use "..." so that we find syslimits.h only in this same directory. */ #include "syslimits.h" @@ -10,4 +31,5 @@ #include_next #undef _GCC_NEXT_LIMITS_H #endif +/* LLVM LOCAL end */ /* APPLE LOCAL end 4401222 */ Modified: llvm-gcc-4.2/trunk/gcc/limity.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/limity.h?rev=54245&r1=54244&r2=54245&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/limity.h (original) +++ llvm-gcc-4.2/trunk/gcc/limity.h Thu Jul 31 02:28:59 2008 @@ -1,2 +1,19 @@ /* APPLE LOCAL begin 4401222 */ + +/* This administrivia gets added to the end of limits.h + if the system has its own version of limits.h. */ + +#else /* not _GCC_LIMITS_H_ */ + +/* LLVM LOCAL */ +#ifndef CONFIG_DARWIN_H + +#ifdef _GCC_NEXT_LIMITS_H +#include_next /* recurse down to the real one */ +#endif + +/* LLVM LOCAL */ +#endif /* not CONFIG_DARWIN_H */ + +#endif /* not _GCC_LIMITS_H_ */ /* APPLE LOCAL end 4401222 */ From isanbard at gmail.com Thu Jul 31 03:03:28 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 31 Jul 2008 01:03:28 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54243 - /llvm-gcc-4.2/trunk/gcc/dwarf2out.c In-Reply-To: <200807310920.23026.baldrick@free.fr> References: <200807310557.m6V5v8Z8024261@zion.cs.uiuc.edu> <200807310920.23026.baldrick@free.fr> Message-ID: <764BDAF8-BCE3-4B25-910A-35DE54B715D4@gmail.com> On Jul 31, 2008, at 12:20 AM, Duncan Sands wrote: > Hi, > >> Take into account Obj-C++. > > I wondered about ObjC++, but the original patch (using dialect) > seemed to only consider objc, so... > It did, but other people brought up the question of ObjC++. I looked at the original bug report, and it would apply to ObjC++ as well. It has to do with the fact that ObjC makes variables in a @try block volatile be default. So, if you have a typedef that doesn't have volatile in it, then the dwarf stuff won't match up. This patch allows them to match. -bw From matthijs at stdin.nl Thu Jul 31 05:00:13 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Thu, 31 Jul 2008 12:00:13 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807310916.26691.baldrick@free.fr> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> Message-ID: <20080731100013.GJ8220@katherina.student.utwente.nl> Hi, > You just used Ty[0] uninitialized. This bug shows up in the llvm-gcc build, giving: /home/kooijman/src/llvm-gcc/obj/./gcc/xgcc -B/home/kooijman/src/llvm-gcc/obj/./gcc/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/bin/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/lib/ -isystem /home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/include -isystem /home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../llvm-gcc-4.2-trunk/libgomp -I. -I../../../llvm-gcc-4.2-trunk/libgomp/config/linux/x86 -I../../../llvm-gcc-4.2-trunk/libgomp/config/linux -I../../../llvm-gcc-4.2-trunk/libgomp/config/posix -I../../../llvm-gcc-4.2-trunk/libgomp -Wall -Werror -ftls-model=initial-exec -march=i486 -pthread -mtune=i686 -O2 -g -O2 -MT critical.lo -MD -MP -MF .deps/critical.Tpo -c ../../../llvm-gcc-4.2-trunk/libgomp/critical.c -fPIC -DPIC -o .libs/critical.o cc1: Constants.cpp:1854: static llvm::Constant* llvm::ConstantExpr::getIntegerCast(llvm::Constant*, const llvm::Type*, bool): Assertion `C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"' failed. ../../../llvm-gcc-4.2-trunk/libgomp/critical.c: In function 'GOMP_critical_name_start': ../../../llvm-gcc-4.2-trunk/libgomp/critical.c:54: internal compiler error: Aborted (backtrace from gdb shows that Ty is indeed unitialized) The fix seems simply, from looking at the other similar pieces of code this should be: > const Type *OrigTy = cast(C[0]->getType())->getElementType(); > - const Type* Ty = OrigTy; > - if (isa(Ty)) > - Ty = TD.getIntPtrType(); > - > - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); > - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); > - C[2] = Builder.CreateIntCast(C[2], Ty, "cast"); > + const Type* Ty[2]; + Ty[0] = OrigTy; > + if (isa(Ty[0])) > + Ty[0] = TD.getIntPtrType(); > + Ty[1] = C[0]->getType(); > + > + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); > + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); > + C[2] = Builder.CreateIntCast(C[2], Ty[0], "cast"); > > Result = > Builder.CreateCall(Intrinsic::getDeclaration(TheModule, > Intrinsic::atomic_cmp_swap, > - &Ty, 1), > + Ty, 2), > C, C + 3); I was going to write a piece here about the weirdness of this code, but halfway through this I suddenly saw what it was doing. Actually makes a lot of sense once you understand it (and realize that getIntPtrType() doesn't return a pointer-to-int type, but an int-that-fits-a-pointer type). One thing I am still wondering about: Doesn't the above code throw away the address space qualifer of C[0], if any? Preserving that was the orginal idea behind these changes, right? Or don't these builtin gcc function support different address spaces? I'm currently testing the one-line change above, if it works I'll commit it. > > @@ -4555,15 +4556,17 @@ > > Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) > > }; > > const Type *OrigTy = cast(C[0]->getType())->getElementType(); > > - const Type* Ty = OrigTy; > > - if (isa(Ty)) > > - Ty = TD.getIntPtrType(); > > - C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty)); > > - C[1] = Builder.CreateIntCast(C[1], Ty, "cast"); > > + const Type* Ty[2]; > > + Ty[0] = OrigTy; > > + if (isa(Ty[0])) > > + Ty[0] = TD.getIntPtrType(); > > + Ty[1] = C[0]->getType(); > > Here you may well have used C[0] uninitialized. More cases > of this occur in the rest of the patch. Why is that? C is initalized when it is declared: Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) }; or can Emit return uninitialized values? > Also, how about factorizing this code while you are there? > It seems to be many copies of the same thing. That seems like a nice idea :-) Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080731/94bd8d42/attachment.bin From baldrick at free.fr Thu Jul 31 05:09:15 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 31 Jul 2008 12:09:15 +0200 Subject: [llvm-commits] =?iso-8859-6?q?=5Bllvm-gcc-4=2E2=5D_r54240_-=09/ll?= =?iso-8859-6?q?vm-gcc-4=2E2/trunk/gcc/llvm-convert=2Ecpp?= In-Reply-To: <20080731100013.GJ8220@katherina.student.utwente.nl> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> Message-ID: <200807311209.15963.baldrick@free.fr> Hi, > > Here you may well have used C[0] uninitialized. More cases > > of this occur in the rest of the patch. > Why is that? C is initalized when it is declared: I didn't see the initialization of C in the patch, and didn't have time to look into it further. Thanks for looking deeper. Ciao, Duncan. From matthijs at stdin.nl Thu Jul 31 05:21:11 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Thu, 31 Jul 2008 12:21:11 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 -?/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807311209.15963.baldrick@free.fr> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> <200807311209.15963.baldrick@free.fr> Message-ID: <20080731102111.GK8220@katherina.student.utwente.nl> Hi Duncan, > I didn't see the initialization of C in the patch, and didn't > have time to look into it further. Thanks for looking deeper. I had exactly the same reflex when looking at the patch :-p I've commited the fix, let's see if there are any other breaking changes now. Normal compile works, trying bootstrap now. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080731/fb0b3842/attachment.bin From matthijs at stdin.nl Thu Jul 31 05:25:57 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Thu, 31 Jul 2008 10:25:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54246 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200807311025.m6VAPwen016603@zion.cs.uiuc.edu> Author: matthijs Date: Thu Jul 31 05:25:57 2008 New Revision: 54246 URL: http://llvm.org/viewvc/llvm-project?rev=54246&view=rev Log: Fix llvm-gcc compilation, broken by r54240. It forgot to initialize a variable, which is done now. This makes llvm-gcc compile without bootstrap, haven't tested bootstrap yet. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=54246&r1=54245&r2=54246&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Jul 31 05:25:57 2008 @@ -4521,6 +4521,7 @@ }; const Type *OrigTy = cast(C[0]->getType())->getElementType(); const Type* Ty[2]; + Ty[0] = OrigTy; if (isa(Ty[0])) Ty[0] = TD.getIntPtrType(); Ty[1] = C[0]->getType(); From matthijs at stdin.nl Thu Jul 31 07:20:47 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Thu, 31 Jul 2008 14:20:47 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <20080731100013.GJ8220@katherina.student.utwente.nl> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> Message-ID: <20080731122047.GL8220@katherina.student.utwente.nl> Hi Mon Ping, > I'm currently testing the one-line change above, if it works I'll commit it. The fix worked to fix the problem at hand (I can now succesfully do stage1 and stage2), but compilation breaks in stage3. I get the following error: /home/kooijman/src/llvm-gcc/obj/./gcc/xgcc -B/home/kooijman/src/llvm-gcc/obj/./gcc/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/bin/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/lib/ -isystem /home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/include -isystem /home/kooijman/src/llvm-gcc/obj/../install/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../llvm-gcc-4.2-trunk/libgomp -I. -I../../../llvm-gcc-4.2-trunk/libgomp/config/linux/x86 -I../../../llvm-gcc-4.2-trunk/libgomp/config/linux -I../../../llvm-gcc-4.2-trunk/libgomp/config/posix -I../../../llvm-gcc-4.2-trunk/libgomp -Wall -Werror -ftls-model=initial-exec -march=i486 -pthread -mtune=i686 -O2 -g -O2 -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c -fPIC -DPIC -o .libs/alloc.o In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h:50, from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function 'gomp_sem_wait': ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:45: error: incompatible type for argument 1 of '__sync_bool_compare_and_swap' ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function 'gomp_sem_post': ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:52: error: incompatible type for argument 1 of '__sync_bool_compare_and_swap' In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h:51, from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In function 'gomp_mutex_lock': ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:47: error: incompatible type for argument 1 of '__sync_bool_compare_and_swap' ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In function 'gomp_mutex_unlock': ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:54: error: incompatible type for argument 1 of '__sync_lock_test_and_set' This seems terribly related to the other error, but I can't really tell where this comes from (my gcc-fu is quite lacking in this respect). Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080731/e3689e26/attachment.bin From dalej at apple.com Thu Jul 31 11:58:13 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 31 Jul 2008 09:58:13 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54238 - /llvm-gcc-4.2/trunk/gcc/c-opts.c In-Reply-To: References: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> Message-ID: <087AE3E3-F553-4DE4-B15E-1AA269D20FF7@apple.com> On Jul 30, 2008, at 9:36 PMPDT, Bill Wendling wrote: > Thanks, Dale. I think my fingers got tired of typing ENABLE_LLVM all > over the place. :-) > > -bw Understandable. This shows up in llvm/test, btw, is running that too much to ask? > On Jul 30, 2008, at 4:51 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Wed Jul 30 18:51:52 2008 >> New Revision: 54238 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=54238&view=rev >> Log: >> Fix -fno-builtin, broken by 54231. >> >> >> Modified: >> llvm-gcc-4.2/trunk/gcc/c-opts.c >> >> Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=54238&r1=54237&r2=54238&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm-gcc-4.2/trunk/gcc/c-opts.c (original) >> +++ llvm-gcc-4.2/trunk/gcc/c-opts.c Wed Jul 30 18:51:52 2008 >> @@ -661,7 +661,7 @@ >> case OPT_fbuiltin: >> flag_no_builtin = !value; >> /* LLVM LOCAL begin */ >> -#ifdef LLVM >> +#ifdef ENABLE_LLVM >> flag_no_simplify_libcalls = !value; >> #endif >> /* LLVM LOCAL end */ >> @@ -691,7 +691,7 @@ >> flag_hosted = value; >> flag_no_builtin = !value; >> /* LLVM LOCAL begin */ >> -#ifdef LLVM >> +#ifdef ENABLE_LLVM >> flag_no_simplify_libcalls = !value; >> #endif >> /* LLVM LOCAL end */ >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From monping at apple.com Thu Jul 31 12:09:46 2008 From: monping at apple.com (Mon P Wang) Date: Thu, 31 Jul 2008 10:09:46 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <20080731122047.GL8220@katherina.student.utwente.nl> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> <20080731122047.GL8220@katherina.student.utwente.nl> Message-ID: <1427185E-5947-4A56-975C-877735AC3737@apple.com> Hi, Sorry about that. When I tried building on the gcc side, it went through so I thought it was fine. I take a look and see what is wrong. -- Mon Ping On Jul 31, 2008, at 5:20 AM, Matthijs Kooijman wrote: > Hi Mon Ping, > >> I'm currently testing the one-line change above, if it works I'll >> commit it. > The fix worked to fix the problem at hand (I can now succesfully do > stage1 and > stage2), but compilation breaks in stage3. > > I get the following error: > > /home/kooijman/src/llvm-gcc/obj/./gcc/xgcc -B/home/kooijman/src/llvm- > gcc/obj/./gcc/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc- > linux-gnu/bin/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc- > linux-gnu/lib/ -isystem /home/kooijman/src/llvm-gcc/obj/../install/ > i686-pc-linux-gnu/include -isystem /home/kooijman/src/llvm-gcc/ > obj/../install/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. - > I../../../llvm-gcc-4.2-trunk/libgomp -I. -I../../../llvm-gcc-4.2- > trunk/libgomp/config/linux/x86 -I../../../llvm-gcc-4.2-trunk/libgomp/ > config/linux -I../../../llvm-gcc-4.2-trunk/libgomp/config/posix - > I../../../llvm-gcc-4.2-trunk/libgomp -Wall -Werror -ftls- > model=initial-exec -march=i486 -pthread -mtune=i686 -O2 -g -O2 -MT > alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../../../llvm-gcc-4.2-trunk/ > libgomp/alloc.c -fPIC -DPIC -o .libs/alloc.o > In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h: > 50, > from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function > 'gomp_sem_wait': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:45: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function > 'gomp_sem_post': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:52: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h: > 51, > from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In > function 'gomp_mutex_lock': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:47: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In > function 'gomp_mutex_unlock': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:54: error: > incompatible type for argument 1 of '__sync_lock_test_and_set' > > This seems terribly related to the other error, but I can't really > tell where > this comes from (my gcc-fu is quite lacking in this respect). > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Thu Jul 31 13:06:45 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 31 Jul 2008 11:06:45 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54238 - /llvm-gcc-4.2/trunk/gcc/c-opts.c In-Reply-To: <087AE3E3-F553-4DE4-B15E-1AA269D20FF7@apple.com> References: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> <087AE3E3-F553-4DE4-B15E-1AA269D20FF7@apple.com> Message-ID: <16e5fdf90807311106t76bdb45dk4afc7cf385205abb@mail.gmail.com> On Thu, Jul 31, 2008 at 9:58 AM, Dale Johannesen wrote: > > On Jul 30, 2008, at 9:36 PMPDT, Bill Wendling wrote: > >> Thanks, Dale. I think my fingers got tired of typing ENABLE_LLVM all >> over the place. :-) >> >> -bw > > Understandable. This shows up in llvm/test, btw, is running that too > much to ask? > Not at all. I thought that I did, but now realize that my incremental tester isn't using the correct llvm-gcc. Sorry I dropped the ball on that. -bw From dalej at apple.com Thu Jul 31 13:13:12 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 31 Jul 2008 18:13:12 -0000 Subject: [llvm-commits] [llvm] r54248 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp Message-ID: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> Author: johannes Date: Thu Jul 31 13:13:12 2008 New Revision: 54248 URL: http://llvm.org/viewvc/llvm-project?rev=54248&view=rev Log: Add a flag to disable jump table generation (all switches use the binary search algorithm) for environments that don't support it. PPC64 JIT is such an environment; turn the flag on for that. Modified: llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/trunk/lib/Target/TargetMachine.cpp Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=54248&r1=54247&r2=54248&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Thu Jul 31 13:13:12 2008 @@ -97,6 +97,10 @@ /// VerboseAsm - When this flag is set, the asm printer prints additional /// comments to asm directives. extern bool VerboseAsm; + + /// DisableJumpTables - This flag indicates jump tables should not be + /// generated. + extern bool DisableJumpTables; } // End llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54248&r1=54247&r2=54248&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 31 13:13:12 2008 @@ -1916,8 +1916,9 @@ } static inline bool areJTsAllowed(const TargetLowering &TLI) { - return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || - TLI.isOperationLegal(ISD::BRIND, MVT::Other)); + return !DisableJumpTables && + (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || + TLI.isOperationLegal(ISD::BRIND, MVT::Other)); } /// handleJTSwitchCase - Emit jumptable for current switch case range Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=54248&r1=54247&r2=54248&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Jul 31 13:13:12 2008 @@ -43,7 +43,7 @@ : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) { setPow2DivIsCheap(); - + // Use _setjmp/_longjmp instead of setjmp/longjmp. setUseUnderscoreSetJmp(true); setUseUnderscoreLongJmp(true); Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Jul 31 13:13:12 2008 @@ -17,6 +17,7 @@ #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Target/TargetMachineRegistry.h" +#include "llvm/Target/TargetOptions.h" using namespace llvm; // Register the targets @@ -144,6 +145,9 @@ // instructions to materialize arbitrary global variable + function + // constant pool addresses. setRelocationModel(Reloc::PIC_); + // Temporary workaround for the inability of PPC64 JIT to handle jump + // tables. + DisableJumpTables = true; } else { setRelocationModel(Reloc::Static); } Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Thu Jul 31 13:13:12 2008 @@ -39,6 +39,7 @@ unsigned StackAlignment; bool RealignStack; bool VerboseAsm; + bool DisableJumpTables; } static cl::opt PrintCode("print-machineinstrs", @@ -156,6 +157,11 @@ cl::location(VerboseAsm), cl::init(false)); +static cl::opt +DisableSwitchTables(cl::Hidden, "disable-jump-tables", + cl::desc("Do not generate jump tables."), + cl::location(DisableJumpTables), + cl::init(false)); //--------------------------------------------------------------------------- // TargetMachine Class From bruno.cardoso at gmail.com Thu Jul 31 13:31:28 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Thu, 31 Jul 2008 18:31:28 -0000 Subject: [llvm-commits] [llvm] r54249 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsISelLowering.h Message-ID: <200807311831.m6VIVS1P001365@zion.cs.uiuc.edu> Author: bruno Date: Thu Jul 31 13:31:28 2008 New Revision: 54249 URL: http://llvm.org/viewvc/llvm-project?rev=54249&view=rev Log: Handle more SELECT corner cases considering legalize types, probabily wont work with the default legalizer. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54249&r1=54248&r2=54249&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Jul 31 13:31:28 2008 @@ -85,6 +85,12 @@ setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); + // Used by legalize types to correctly generate the setcc result. + // Without this, every float setcc comes with a AND with the result, + // we don't want this, since the fpcmp result goes to a flag register, + // which is used implicitly by brcond and select operations. + AddPromotedToType(ISD::SETCC, MVT::i1, MVT::i32); + // Mips Custom Operations setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); @@ -97,6 +103,11 @@ setOperationAction(ISD::SETCC, MVT::f32, Custom); setOperationAction(ISD::BRCOND, MVT::Other, Custom); + // We custom lower AND to handle the case where the DAG contain 'ands' + // setcc results with fp operands. This is necessary since the result + // from these are in a flag register (FCR31). + setOperationAction(ISD::AND, MVT::i32, Custom); + // Operations not directly supported by Mips. setOperationAction(ISD::BR_JT, MVT::Other, Expand); setOperationAction(ISD::BR_CC, MVT::Other, Expand); @@ -148,6 +159,7 @@ { switch (Op.getOpcode()) { + case ISD::AND: return LowerAND(Op, DAG); case ISD::BRCOND: return LowerBRCOND(Op, DAG); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG); @@ -347,24 +359,38 @@ //===----------------------------------------------------------------------===// SDValue MipsTargetLowering:: +LowerAND(SDValue Op, SelectionDAG &DAG) +{ + SDValue LHS = Op.getOperand(0); + SDValue RHS = Op.getOperand(1); + + if (LHS.getOpcode() != MipsISD::FPCmp || RHS.getOpcode() != MipsISD::FPCmp) + return Op; + + SDValue True = DAG.getConstant(1, MVT::i32); + SDValue False = DAG.getConstant(0, MVT::i32); + + SDValue LSEL = DAG.getNode(MipsISD::FPSelectCC, True.getValueType(), + LHS, True, False, LHS.getOperand(2)); + SDValue RSEL = DAG.getNode(MipsISD::FPSelectCC, True.getValueType(), + RHS, True, False, RHS.getOperand(2)); + + return DAG.getNode(ISD::AND, MVT::i32, LSEL, RSEL); +} + +SDValue MipsTargetLowering:: LowerBRCOND(SDValue Op, SelectionDAG &DAG) { // The first operand is the chain, the second is the condition, the third is // the block to branch to if the condition is true. SDValue Chain = Op.getOperand(0); SDValue Dest = Op.getOperand(2); - SDValue CondRes; - if (Op.getOperand(1).getOpcode() == ISD::AND) { - CondRes = Op.getOperand(1).getOperand(0); - if (CondRes.getOpcode() != MipsISD::FPCmp) - return Op; - } else if (Op.getOperand(1).getOpcode() == MipsISD::FPCmp) - CondRes = Op.getOperand(1); - else + if (Op.getOperand(1).getOpcode() != MipsISD::FPCmp) return Op; - SDValue CCNode = CondRes.getOperand(2); + SDValue CondRes = Op.getOperand(1); + SDValue CCNode = CondRes.getOperand(2); Mips::CondCode CC = (Mips::CondCode)cast(CCNode)->getValue(); SDValue BrCode = DAG.getConstant(GetFPBranchCodeFromCond(CC), MVT::i32); @@ -394,25 +420,15 @@ SDValue True = Op.getOperand(1); SDValue False = Op.getOperand(2); - // this can be a fp select but with a setcc comming from a - // integer compare. - if (Cond.getOpcode() == ISD::SETCC) - if (Cond.getOperand(0).getValueType().isInteger()) - return DAG.getNode(MipsISD::SelectCC, True.getValueType(), - Cond, True, False); - - // Otherwise we're dealing with floating point compare. - SDValue CondRes; - if (Cond.getOpcode() == ISD::AND) - CondRes = Cond.getOperand(0); - else if (Cond.getOpcode() == MipsISD::FPCmp) - CondRes = Cond; - else - assert(0 && "Incoming condition flag unknown"); + // if the incomming condition comes from fpcmp, the select + // operation must use FPSelectCC, otherwise SelectCC. + if (Cond.getOpcode() != MipsISD::FPCmp) + return DAG.getNode(MipsISD::SelectCC, True.getValueType(), + Cond, True, False); - SDValue CCNode = CondRes.getOperand(2); + SDValue CCNode = Cond.getOperand(2); return DAG.getNode(MipsISD::FPSelectCC, True.getValueType(), - CondRes, True, False, CCNode); + Cond, True, False, CCNode); } SDValue MipsTargetLowering:: Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=54249&r1=54248&r2=54249&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Thu Jul 31 13:31:28 2008 @@ -91,17 +91,18 @@ bool IsInSmallSection(unsigned Size); // Lower Operand specifics - SDValue LowerRET(SDValue Op, SelectionDAG &DAG); + SDValue LowerAND(SDValue Op, SelectionDAG &DAG); + SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG); SDValue LowerCALL(SDValue Op, SelectionDAG &DAG); + SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); SDValue LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG); SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG); SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG); SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG); - SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); - SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG); + SDValue LowerRET(SDValue Op, SelectionDAG &DAG); SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG); + SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG); SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG); - SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG); virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB); From bruno.cardoso at gmail.com Thu Jul 31 13:50:55 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Thu, 31 Jul 2008 18:50:55 -0000 Subject: [llvm-commits] [llvm] r54250 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200807311850.m6VIotXS002066@zion.cs.uiuc.edu> Author: bruno Date: Thu Jul 31 13:50:54 2008 New Revision: 54250 URL: http://llvm.org/viewvc/llvm-project?rev=54250&view=rev Log: Expand fcopysign Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54250&r1=54249&r2=54250&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Jul 31 13:50:54 2008 @@ -124,6 +124,7 @@ setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand); setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand); setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand); + setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand); // We don't have line number support yet. setOperationAction(ISD::DBG_STOPPOINT, MVT::Other, Expand); From dalej at apple.com Thu Jul 31 15:16:34 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 31 Jul 2008 20:16:34 -0000 Subject: [llvm-commits] [llvm] r54251 - /llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Message-ID: <200807312016.m6VKGY2Z005124@zion.cs.uiuc.edu> Author: johannes Date: Thu Jul 31 15:16:33 2008 New Revision: 54251 URL: http://llvm.org/viewvc/llvm-project?rev=54251&view=rev Log: Make sse2 explicit, for non-x86 hosts. Modified: llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Modified: llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll?rev=54251&r1=54250&r2=54251&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Thu Jul 31 15:16:33 2008 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=1 | grep movaps | count 76 -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=0 | grep movaps | count 1 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=1 -mattr=sse2 | grep movaps | count 76 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=0 -mattr=sse2 | grep movaps | count 1 ; PR2539 external global <4 x float>, align 1 ; <<4 x float>*>:0 [#uses=2] From dalej at apple.com Thu Jul 31 15:21:18 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 31 Jul 2008 20:21:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54252 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200807312021.m6VKLI5J005328@zion.cs.uiuc.edu> Author: johannes Date: Thu Jul 31 15:21:18 2008 New Revision: 54252 URL: http://llvm.org/viewvc/llvm-project?rev=54252&view=rev Log: Support __sync_and_and_fetch. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=54252&r1=54251&r2=54252&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Jul 31 15:21:18 2008 @@ -4820,6 +4820,34 @@ Result = Builder.CreateIntToPtr(Result, OrigTy); return true; } + case BUILT_IN_AND_AND_FETCH_1: + case BUILT_IN_AND_AND_FETCH_2: + case BUILT_IN_AND_AND_FETCH_4: + case BUILT_IN_AND_AND_FETCH_8: + case BUILT_IN_AND_AND_FETCH_16: { + const Type *ResultTy = ConvertType(TREE_TYPE(exp)); + tree arglist = TREE_OPERAND(exp, 1); + Value* C[2] = { + Emit(TREE_VALUE(arglist), 0), + Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) + }; + const Type *OrigTy = cast(C[0]->getType())->getElementType(); + const Type* Ty[2]; + Ty[0] = OrigTy; + if (isa(Ty[0])) + Ty[0] = TD.getIntPtrType(); + Ty[1] = C[0]->getType(); + C[0] = Builder.CreateBitCast(C[0], PointerType::getUnqual(Ty[0])); + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_and, + Ty, 2), + C, C + 2); + Result = Builder.CreateAnd(Result, C[1]); + Result = Builder.CreateIntToPtr(Result, OrigTy); + return true; + } case BUILT_IN_XOR_AND_FETCH_1: case BUILT_IN_XOR_AND_FETCH_2: case BUILT_IN_XOR_AND_FETCH_4: From kremenek at apple.com Thu Jul 31 15:31:37 2008 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 31 Jul 2008 20:31:37 -0000 Subject: [llvm-commits] [llvm] r54254 - /llvm/tags/checker/checker-71/ Message-ID: <200807312031.m6VKVbU9005781@zion.cs.uiuc.edu> Author: kremenek Date: Thu Jul 31 15:31:37 2008 New Revision: 54254 URL: http://llvm.org/viewvc/llvm-project?rev=54254&view=rev Log: Tagging checker-71. Added: llvm/tags/checker/checker-71/ - copied from r54253, llvm/trunk/ From daniel at zuster.org Thu Jul 31 15:40:39 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 31 Jul 2008 20:40:39 -0000 Subject: [llvm-commits] [test-suite] r54256 - in /test-suite/trunk/MultiSource/Benchmarks: BitBench/drop3/ BitBench/five11/ BitBench/uudecode/ BitBench/uuencode/ NPB-serial/is/ Message-ID: <200807312040.m6VKeeKo006171@zion.cs.uiuc.edu> Author: ddunbar Date: Thu Jul 31 15:40:39 2008 New Revision: 54256 URL: http://llvm.org/viewvc/llvm-project?rev=54256&view=rev Log: Add several svn:ignore properties Modified: test-suite/trunk/MultiSource/Benchmarks/BitBench/drop3/ (props changed) test-suite/trunk/MultiSource/Benchmarks/BitBench/five11/ (props changed) test-suite/trunk/MultiSource/Benchmarks/BitBench/uudecode/ (props changed) test-suite/trunk/MultiSource/Benchmarks/BitBench/uuencode/ (props changed) test-suite/trunk/MultiSource/Benchmarks/NPB-serial/is/ (props changed) Propchange: test-suite/trunk/MultiSource/Benchmarks/BitBench/drop3/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Thu Jul 31 15:40:39 2008 @@ -0,0 +1 @@ +Output Propchange: test-suite/trunk/MultiSource/Benchmarks/BitBench/five11/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Thu Jul 31 15:40:39 2008 @@ -0,0 +1 @@ +Output Propchange: test-suite/trunk/MultiSource/Benchmarks/BitBench/uudecode/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Thu Jul 31 15:40:39 2008 @@ -0,0 +1 @@ +Output Propchange: test-suite/trunk/MultiSource/Benchmarks/BitBench/uuencode/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Thu Jul 31 15:40:39 2008 @@ -0,0 +1 @@ +Output Propchange: test-suite/trunk/MultiSource/Benchmarks/NPB-serial/is/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Thu Jul 31 15:40:39 2008 @@ -0,0 +1 @@ +Output From monping at apple.com Thu Jul 31 18:58:25 2008 From: monping at apple.com (Mon P Wang) Date: Thu, 31 Jul 2008 16:58:25 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <20080731100013.GJ8220@katherina.student.utwente.nl> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> Message-ID: Hi Matthijs, Thanks for fixing my mistake. To answer your question, it is doing something useless and potentially bad. Assume the incoming pointer has an address space qualifier, we will throw it away with the bit cast and then call the intrinsic function that has be customized for the address space which would do an implicit cast to the address space. I don't know what gcc does in this case but it could throw an error that implicit cast between address spaces are not allowed (it probably should if doesn't know the relationship between the address spaces). What the code should do is to preserve the address space with something like const PointerType* PtrTy = cast(C[0]->getType()); const Type *OrigTy = PtrTy->getElementType(); const Type* Ty[2]; Ty[0] = OrigTy; if (isa(Ty[0])) Ty[0] = TD.getIntPtrType(); Ty[1] = PtrTy; C[0] = Builder.CreateBitCast(C[0], PointerType::get(Ty[0], PtrTy- >getAddressSpace())); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, id, Ty, 2), C, C + 2); I'm not sure why we need the bit cast in the first place though if Ty[0] was not changed. I'll send out a patch with this as I am doing some cleanup that Duncan suggested. -- Mon Ping On Jul 31, 2008, at 3:00 AM, Matthijs Kooijman wrote: >> + if (isa(Ty[0])) >> + Ty[0] = TD.getIntPtrType(); >> + Ty[1] = C[0]->getType(); >> + >> + C[0] = Builder.CreateBitCast(C[0], >> PointerType::getUnqual(Ty[0])); >> + C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); >> + C[2] = Builder.CreateIntCast(C[2], Ty[0], "cast"); >> >> Result = >> Builder.CreateCall(Intrinsic::getDeclaration(TheModule, >> >> Intrinsic::atomic_cmp_swap, >> - &Ty, 1), >> + Ty, 2), >> C, C + 3); > > I was going to write a piece here about the weirdness of this code, > but > halfway through this I suddenly saw what it was doing. Actually > makes a lot of > sense once you understand it (and realize that getIntPtrType() > doesn't return > a pointer-to-int type, but an int-that-fits-a-pointer type). > > One thing I am still wondering about: Doesn't the above code throw > away the > address space qualifer of C[0], if any? Preserving that was the > orginal idea > behind these changes, right? Or don't these builtin gcc function > support > different address spaces? From wangmp at apple.com Thu Jul 31 19:12:09 2008 From: wangmp at apple.com (Mon P Wang) Date: Thu, 31 Jul 2008 17:12:09 -0700 Subject: [llvm-commits] llvm-gcc address space cleanup Message-ID: <28A78AB0-0C52-4425-81EA-793A73A1FBFA@apple.com> Hi, Here is a patch to remove some redundancy that Duncan suggested for the changes that I made in the address space. Please let me know if you have any comments. -- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: addr_patch Type: application/octet-stream Size: 18089 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080731/9b87758f/attachment.obj From evan.cheng at apple.com Thu Jul 31 19:39:50 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 31 Jul 2008 17:39:50 -0700 Subject: [llvm-commits] [llvm] r54223 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/zext-inreg-0.ll test/CodeGen/X86/zext-inreg-1.ll test/CodeGen/X86/zext-inreg-2.ll In-Reply-To: <200807301809.m6UI9HB4000677@zion.cs.uiuc.edu> References: <200807301809.m6UI9HB4000677@zion.cs.uiuc.edu> Message-ID: <1D617A5A-18E4-45B4-BADA-B0ECFB51CD79@apple.com> Can we handle the them the same way as truncate by inserting MOV16to16_ or MOV32to32_? Evan On Jul 30, 2008, at 11:09 AM, Dan Gohman wrote: > Author: djg > Date: Wed Jul 30 13:09:17 2008 > New Revision: 54223 > > URL: http://llvm.org/viewvc/llvm-project?rev=54223&view=rev > Log: > Reapply r54147 with a constraint to only use the 8-bit > subreg form on x86-64, to avoid the problem with x86-32 > having GPRs that don't have 8-bit subregs. > > Also, change several 16-bit instructions to use > equivalent 32-bit instructions. These have a smaller > encoding and avoid partial-register updates. > > Added: > llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll > llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll > llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll > Modified: > llvm/trunk/lib/Target/X86/X86Instr64bit.td > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=54223&r1=54222&r2=54223&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) > +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jul 30 13:09:17 > 2008 > @@ -241,18 +241,22 @@ > "movs{lq|xd}\t{$src, $dst|$dst, $src}", > [(set GR64:$dst, (sextloadi64i32 addr:$src))]>; > > -def MOVZX64rr8 : RI<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 : > $src), > - "movz{bq|x}\t{$src, $dst|$dst, $src}", > - [(set GR64:$dst, (zext GR8:$src))]>, TB; > -def MOVZX64rm8 : RI<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem : > $src), > - "movz{bq|x}\t{$src, $dst|$dst, $src}", > - [(set GR64:$dst, (zextloadi64i8 addr:$src))]>, > TB; > -def MOVZX64rr16: RI<0xB7, MRMSrcReg, (outs GR64:$dst), (ins > GR16:$src), > - "movz{wq|x}\t{$src, $dst|$dst, $src}", > - [(set GR64:$dst, (zext GR16:$src))]>, TB; > -def MOVZX64rm16: RI<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem: > $src), > - "movz{wq|x}\t{$src, $dst|$dst, $src}", > - [(set GR64:$dst, (zextloadi64i16 addr:$src))]>, > TB; > +// Use movzbl instead of movzbq when the destination is a register; > it's > +// equivalent due to implicit zero-extending, and it has a smaller > encoding. > +def MOVZX64rr8 : I<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 : > $src), > + "movz{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR64:$dst, (zext GR8:$src))]>, TB; > +def MOVZX64rm8 : I<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem : > $src), > + "movz{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR64:$dst, (zextloadi64i8 addr:$src))]>, TB; > +// Use movzwl instead of movzwq when the destination is a register; > it's > +// equivalent due to implicit zero-extending, and it has a smaller > encoding. > +def MOVZX64rr16: I<0xB7, MRMSrcReg, (outs GR64:$dst), (ins > GR16:$src), > + "movz{wl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR64:$dst, (zext GR16:$src))]>, TB; > +def MOVZX64rm16: I<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem: > $src), > + "movz{wl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR64:$dst, (zextloadi64i16 addr:$src))]>, > TB; > > let neverHasSideEffects = 1 in { > let Defs = [RAX], Uses = [EAX] in > @@ -1093,9 +1097,9 @@ > // when we have a better way to specify isel priority. > let Defs = [EFLAGS], AddedComplexity = 1, > isReMaterializable = 1, isAsCheapAsAMove = 1 in > -def MOV64r0 : RI<0x31, MRMInitReg, (outs GR64:$dst), (ins), > - "xor{l}\t${dst:subreg32}, ${dst:subreg32}", > - [(set GR64:$dst, 0)]>; > +def MOV64r0 : I<0x31, MRMInitReg, (outs GR64:$dst), (ins), > + "xor{l}\t${dst:subreg32}, ${dst:subreg32}", > + [(set GR64:$dst, 0)]>; > > // Materialize i64 constant where top 32-bits are zero. > let AddedComplexity = 1, isReMaterializable = 1 in > @@ -1240,6 +1244,26 @@ > (SUBREG_TO_REG (i64 0), > (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)), > x86_subreg_32bit)>; > +// r & (2^16-1) ==> movz > +def : Pat<(and GR64:$src, 0xffff), > + (MOVZX64rr16 (i16 (EXTRACT_SUBREG GR64:$src, > x86_subreg_16bit)))>; > +// r & (2^8-1) ==> movz > +def : Pat<(and GR64:$src, 0xff), > + (MOVZX64rr8 (i8 (EXTRACT_SUBREG GR64:$src, > x86_subreg_8bit)))>; > + > +// TODO: The following two patterns could be adapted to apply to > x86-32, except > +// that they'll need some way to deal with the fact that in x86-32 > not all GPRs > +// have 8-bit subregs. The GR32_ and GR16_ classes are a step in > this direction, > +// but they aren't ready for this purpose yet. > + > +// r & (2^8-1) ==> movz > +def : Pat<(and GR32:$src1, 0xff), > + (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR32:$src1, > x86_subreg_8bit)))>, > + Requires<[In64BitMode]>; > +// r & (2^8-1) ==> movz > +def : Pat<(and GR16:$src1, 0xff), > + (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, > x86_subreg_8bit)))>, > + Requires<[In64BitMode]>; > > // (shl x, 1) ==> (add x, x) > def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>; > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=54223&r1=54222&r2=54223&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jul 30 13:09:17 2008 > @@ -2424,12 +2424,15 @@ > } // Defs = [EFLAGS] > > // Sign/Zero extenders > +// Use movsbl intead of movsbw; we don't care about the high 16 bits > +// of the register here. This has a smaller encoding and avoids a > +// partial-register update. > def MOVSX16rr8 : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src), > - "movs{bw|x}\t{$src, $dst|$dst, $src}", > - [(set GR16:$dst, (sext GR8:$src))]>, TB, OpSize; > + "movs{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR16:$dst, (sext GR8:$src))]>, TB; > def MOVSX16rm8 : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem : > $src), > - "movs{bw|x}\t{$src, $dst|$dst, $src}", > - [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, > TB, OpSize; > + "movs{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, TB; > def MOVSX32rr8 : I<0xBE, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src), > "movs{bl|x}\t{$src, $dst|$dst, $src}", > [(set GR32:$dst, (sext GR8:$src))]>, TB; > @@ -2443,12 +2446,15 @@ > "movs{wl|x}\t{$src, $dst|$dst, $src}", > [(set GR32:$dst, (sextloadi32i16 addr:$src))]>, TB; > > +// Use movzbl intead of movzbw; we don't care about the high 16 bits > +// of the register here. This has a smaller encoding and avoids a > +// partial-register update. > def MOVZX16rr8 : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src), > - "movz{bw|x}\t{$src, $dst|$dst, $src}", > - [(set GR16:$dst, (zext GR8:$src))]>, TB, OpSize; > + "movz{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR16:$dst, (zext GR8:$src))]>, TB; > def MOVZX16rm8 : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem : > $src), > - "movz{bw|x}\t{$src, $dst|$dst, $src}", > - [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, > TB, OpSize; > + "movz{bl|x}\t{$src, ${dst:subreg32}|$ > {dst:subreg32}, $src}", > + [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, TB; > def MOVZX32rr8 : I<0xB6, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src), > "movz{bl|x}\t{$src, $dst|$dst, $src}", > [(set GR32:$dst, (zext GR8:$src))]>, TB; > @@ -2488,9 +2494,11 @@ > def MOV8r0 : I<0x30, MRMInitReg, (outs GR8 :$dst), (ins), > "xor{b}\t$dst, $dst", > [(set GR8:$dst, 0)]>; > +// Use xorl instead of xorw since we don't care about the high 16 > bits, > +// it's smaller, and it avoids a partial-register update. > def MOV16r0 : I<0x31, MRMInitReg, (outs GR16:$dst), (ins), > - "xor{w}\t$dst, $dst", > - [(set GR16:$dst, 0)]>, OpSize; > + "xor{l}\t${dst:subreg32}, ${dst:subreg32}", > + [(set GR16:$dst, 0)]>; > def MOV32r0 : I<0x31, MRMInitReg, (outs GR32:$dst), (ins), > "xor{l}\t$dst, $dst", > [(set GR32:$dst, 0)]>; > @@ -2763,6 +2771,10 @@ > // Some peepholes > // > = > = > = > ----------------------------------------------------------------------= > ==// > > +// r & (2^16-1) ==> movz > +def : Pat<(and GR32:$src1, 0xffff), > + (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR32:$src1, > x86_subreg_16bit)))>; > + > // (shl x, 1) ==> (add x, x) > def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; > def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; > > Added: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=54223&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (added) > +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Wed Jul 30 13:09:17 > 2008 > @@ -0,0 +1,51 @@ > +; RUN: llvm-as < %s | llc -march=x86 | not grep and > +; RUN: llvm-as < %s | llc -march=x86-64 > %t > +; RUN: not grep and %t > +; RUN: not grep movzbq %t > +; RUN: not grep movzwq %t > +; RUN: not grep movzlq %t > + > +; These should use movzbl instead of 'and 255'. > +; This related to not having a ZERO_EXTEND_REG opcode. > + > +define i32 @c(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = and i32 %e, 65535 > + ret i32 %retval > +} > +define i64 @e(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 65535 > + ret i64 %retval > +} > +define i64 @f(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 4294967295 > + ret i64 %retval > +} > + > +define i32 @g(i8 %d) nounwind { > + %e = add i8 %d, 1 > + %retval = zext i8 %e to i32 > + ret i32 %retval > +} > +define i32 @h(i16 %d) nounwind { > + %e = add i16 %d, 1 > + %retval = zext i16 %e to i32 > + ret i32 %retval > +} > +define i64 @i(i8 %d) nounwind { > + %e = add i8 %d, 1 > + %retval = zext i8 %e to i64 > + ret i64 %retval > +} > +define i64 @j(i16 %d) nounwind { > + %e = add i16 %d, 1 > + %retval = zext i16 %e to i64 > + ret i64 %retval > +} > +define i64 @k(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = zext i32 %e to i64 > + ret i64 %retval > +} > > Added: llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll?rev=54223&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll (added) > +++ llvm/trunk/test/CodeGen/X86/zext-inreg-1.ll Wed Jul 30 13:09:17 > 2008 > @@ -0,0 +1,13 @@ > +; RUN: llvm-as < %s | llc -march=x86 | not grep and > + > +; These tests differ from the ones in zext-inreg-0.ll in that > +; on x86-64 they do require and instructions. > + > +; These should use movzbl instead of 'and 255'. > +; This related to not having ZERO_EXTEND_REG node. > + > +define i64 @h(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 281474976710655 > + ret i64 %retval > +} > > Added: llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll?rev=54223&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll (added) > +++ llvm/trunk/test/CodeGen/X86/zext-inreg-2.ll Wed Jul 30 13:09:17 > 2008 > @@ -0,0 +1,28 @@ > +; RUN: llvm-as < %s | llc -march=x86-64 > %t > +; RUN: not grep and %t > +; RUN: not grep movzbq %t > +; RUN: not grep movzwq %t > +; RUN: not grep movzlq %t > + > +; These should use movzbl instead of 'and 255'. > +; This related to not having a ZERO_EXTEND_REG opcode. > + > +; This test was split out of zext-inreg-0.ll because these > +; cases don't yet work on x86-32 due to the 8-bit subreg > +; issue. > + > +define i32 @a(i32 %d) nounwind { > + %e = add i32 %d, 1 > + %retval = and i32 %e, 255 > + ret i32 %retval > +} > +define i32 @b(float %d) nounwind { > + %tmp12 = fptoui float %d to i8 > + %retval = zext i8 %tmp12 to i32 > + ret i32 %retval > +} > +define i64 @d(i64 %d) nounwind { > + %e = add i64 %d, 1 > + %retval = and i64 %e, 255 > + ret i64 %retval > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From wangmp at apple.com Thu Jul 31 22:16:54 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 01 Aug 2008 03:16:54 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54260 - /llvm-gcc-4.2/trunk/gcc/c-common.c Message-ID: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> Author: wangmp Date: Thu Jul 31 22:16:51 2008 New Revision: 54260 URL: http://llvm.org/viewvc/llvm-project?rev=54260&view=rev Log: Removed an unnecessary condition check that seems to cause an optimization error that prevent building after r54240 Modified: llvm-gcc-4.2/trunk/gcc/c-common.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54260&r1=54259&r2=54260&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Thu Jul 31 22:16:51 2008 @@ -8821,7 +8821,7 @@ goto incompatible; type = TREE_TYPE (type); - if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) + if (!INTEGRAL_TYPE_P (type)) goto incompatible; size = tree_low_cst (TYPE_SIZE_UNIT (type), 1); From wangmp at apple.com Thu Jul 31 23:04:51 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 01 Aug 2008 04:04:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54261 - /llvm-gcc-4.2/trunk/gcc/c-common.c Message-ID: <200808010404.m7144pfC027148@zion.cs.uiuc.edu> Author: wangmp Date: Thu Jul 31 23:04:51 2008 New Revision: 54261 URL: http://llvm.org/viewvc/llvm-project?rev=54261&view=rev Log: Fixed r54260 as the second check is not redundant Modified: llvm-gcc-4.2/trunk/gcc/c-common.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54261&r1=54260&r2=54261&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Thu Jul 31 23:04:51 2008 @@ -8822,7 +8822,8 @@ type = TREE_TYPE (type); if (!INTEGRAL_TYPE_P (type)) - goto incompatible; + if ( !POINTER_TYPE_P (type)) + goto incompatible; size = tree_low_cst (TYPE_SIZE_UNIT (type), 1); if (size == 1 || size == 2 || size == 4 || size == 8 || size == 16) From wangmp at apple.com Thu Jul 31 23:31:27 2008 From: wangmp at apple.com (Mon P Wang) Date: Thu, 31 Jul 2008 21:31:27 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54240 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <20080731122047.GL8220@katherina.student.utwente.nl> References: <200807310320.m6V3KX9f019490@zion.cs.uiuc.edu> <200807310916.26691.baldrick@free.fr> <20080731100013.GJ8220@katherina.student.utwente.nl> <20080731122047.GL8220@katherina.student.utwente.nl> Message-ID: Hi, The OsX build is slightly different than the linux build as I didn't see this error. However, when I tried those functions on a program which used those intrinsics, I got a similar error. To debug it, I tried rebuilding at -O0 but the problem went away. We are failing in sync_resolve_size. The original code was if (TREE_CODE (type) != POINTER_TYPE) goto incompatible; type = TREE_TYPE (type); if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) goto incompatible; We failed on the second if and jumped to incompatible, which doesn't make sense since type is an integral type. When I removed the ! POINTER_TYPE_P, it worked. When I rewrote the expression to be if (!INTEGRAL_TYPE_P (type)) if (!POINTER_TYPE_P (type)) goto incompatible; It worked as well. The two pieces of code should be semantically equivalent. I don't know if the linux build has this same issue or not as I don't have linux machine near me right now (if i get time, I'll try it at home). I checked the above change in r54261. If the linux build still doesn't work, please let me know. Thanks, -- Mon Ping On Jul 31, 2008, at 5:20 AM, Matthijs Kooijman wrote: > Hi Mon Ping, > >> I'm currently testing the one-line change above, if it works I'll >> commit it. > The fix worked to fix the problem at hand (I can now succesfully do > stage1 and > stage2), but compilation breaks in stage3. > > I get the following error: > > /home/kooijman/src/llvm-gcc/obj/./gcc/xgcc -B/home/kooijman/src/llvm- > gcc/obj/./gcc/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc- > linux-gnu/bin/ -B/home/kooijman/src/llvm-gcc/obj/../install/i686-pc- > linux-gnu/lib/ -isystem /home/kooijman/src/llvm-gcc/obj/../install/ > i686-pc-linux-gnu/include -isystem /home/kooijman/src/llvm-gcc/ > obj/../install/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. - > I../../../llvm-gcc-4.2-trunk/libgomp -I. -I../../../llvm-gcc-4.2- > trunk/libgomp/config/linux/x86 -I../../../llvm-gcc-4.2-trunk/libgomp/ > config/linux -I../../../llvm-gcc-4.2-trunk/libgomp/config/posix - > I../../../llvm-gcc-4.2-trunk/libgomp -Wall -Werror -ftls- > model=initial-exec -march=i486 -pthread -mtune=i686 -O2 -g -O2 -MT > alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../../../llvm-gcc-4.2-trunk/ > libgomp/alloc.c -fPIC -DPIC -o .libs/alloc.o > In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h: > 50, > from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function > 'gomp_sem_wait': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:45: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h: In function > 'gomp_sem_post': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/sem.h:52: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > In file included from ../../../llvm-gcc-4.2-trunk/libgomp/libgomp.h: > 51, > from ../../../llvm-gcc-4.2-trunk/libgomp/alloc.c:32: > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In > function 'gomp_mutex_lock': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:47: error: > incompatible type for argument 1 of '__sync_bool_compare_and_swap' > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h: In > function 'gomp_mutex_unlock': > ../../../llvm-gcc-4.2-trunk/libgomp/config/linux/mutex.h:54: error: > incompatible type for argument 1 of '__sync_lock_test_and_set' > > This seems terribly related to the other error, but I can't really > tell where > this comes from (my gcc-fu is quite lacking in this respect). > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080731/160b80d7/attachment.html From isanbard at gmail.com Fri Aug 1 00:50:14 2008 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 01 Aug 2008 05:50:14 -0000 Subject: [llvm-commits] [llvm] r54262 - /llvm/trunk/include/llvm/ADT/ilist.h Message-ID: <200808010550.m715oEfG031559@zion.cs.uiuc.edu> Author: void Date: Fri Aug 1 00:50:13 2008 New Revision: 54262 URL: http://llvm.org/viewvc/llvm-project?rev=54262&view=rev Log: Removed unused parameters. Modified: llvm/trunk/include/llvm/ADT/ilist.h Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=54262&r1=54261&r2=54262&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Fri Aug 1 00:50:13 2008 @@ -80,11 +80,11 @@ static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); } static void deleteNode(NodeTy *V) { delete V; } - void addNodeToList(NodeTy *NTy) {} - void removeNodeFromList(NodeTy *NTy) {} - void transferNodesFromList(ilist_default_traits &SrcTraits, - ilist_iterator first, - ilist_iterator last) {} + void addNodeToList(NodeTy *) {} + void removeNodeFromList(NodeTy *) {} + void transferNodesFromList(ilist_default_traits & /*SrcTraits*/, + ilist_iterator /*first*/, + ilist_iterator /*last*/) {} }; // Template traits for intrusive list. By specializing this template class, you From isanbard at gmail.com Fri Aug 1 01:05:17 2008 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 01 Aug 2008 06:05:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54263 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp llvm-types.cpp Message-ID: <200808010605.m7165IKD032123@zion.cs.uiuc.edu> Author: void Date: Fri Aug 1 01:05:17 2008 New Revision: 54263 URL: http://llvm.org/viewvc/llvm-project?rev=54263&view=rev Log: Treat the new BLOCK_POINTER_TYPE in the exact same way as a POINTER_TYPE or REFERENCE_TYPE. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=54263&r1=54262&r2=54263&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Aug 1 01:05:17 2008 @@ -2320,7 +2320,8 @@ assert(TREE_TYPE (TREE_OPERAND (exp, 0)) && (TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE || - TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE) + TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE || + TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == BLOCK_POINTER_TYPE) && "Not calling a function pointer?"); tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0))); unsigned CallingConv; @@ -5680,7 +5681,8 @@ assert((TREE_CODE (ArrayType) == ARRAY_TYPE || TREE_CODE (ArrayType) == POINTER_TYPE || - TREE_CODE (ArrayType) == REFERENCE_TYPE) && + TREE_CODE (ArrayType) == REFERENCE_TYPE || + TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) && "Unknown ARRAY_REF!"); // As an LLVM extension, we allow ARRAY_REF with a pointer as the first @@ -6917,7 +6919,8 @@ tree IndexType = TREE_TYPE(Index); assert((TREE_CODE (ArrayType) == ARRAY_TYPE || TREE_CODE (ArrayType) == POINTER_TYPE || - TREE_CODE (ArrayType) == REFERENCE_TYPE) && + TREE_CODE (ArrayType) == REFERENCE_TYPE || + TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) && "Unknown ARRAY_REF!"); // Check for variable sized reference. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=54263&r1=54262&r2=54263&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Aug 1 01:05:17 2008 @@ -496,10 +496,14 @@ } case POINTER_TYPE: - case REFERENCE_TYPE: { + case REFERENCE_TYPE: + case BLOCK_POINTER_TYPE: { // type* and type& - unsigned T = TREE_CODE(type) == POINTER_TYPE ? DW_TAG_pointer_type : - DW_TAG_reference_type; + // FIXME: Should BLOCK_POINTER_TYP have its own DW_TAG? + unsigned T = (TREE_CODE(type) == POINTER_TYPE || + TREE_CODE(type) == BLOCK_POINTER_TYPE) ? + DW_TAG_pointer_type : + DW_TAG_reference_type; DerivedTypeDesc *DerivedTy = new DerivedTypeDesc(T); Ty = DerivedTy; // Set the slot early to prevent recursion difficulties. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=54263&r1=54262&r2=54263&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Fri Aug 1 01:05:17 2008 @@ -302,7 +302,8 @@ bool isSequentialCompatible(tree_node *type) { assert((TREE_CODE(type) == ARRAY_TYPE || TREE_CODE(type) == POINTER_TYPE || - TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!"); + TREE_CODE(type) == REFERENCE_TYPE || + TREE_CODE(type) == BLOCK_POINTER_TYPE) && "not a sequential type!"); // This relies on gcc types with constant size mapping to LLVM types with the // same size. It is possible for the component type not to have a size: // struct foo; extern foo bar[]; @@ -315,7 +316,8 @@ bool isArrayCompatible(tree_node *type) { assert((TREE_CODE(type) == ARRAY_TYPE || TREE_CODE(type) == POINTER_TYPE || - TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!"); + TREE_CODE(type) == REFERENCE_TYPE || + TREE_CODE(type) == BLOCK_POINTER_TYPE) && "not a sequential type!"); return (TREE_CODE(type) == ARRAY_TYPE) && ( // Arrays with no size are fine as long as their components are layed out @@ -598,6 +600,7 @@ case VECTOR_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: + case BLOCK_POINTER_TYPE: case OFFSET_TYPE: // These types have no holes. return true; @@ -784,6 +787,7 @@ case POINTER_TYPE: case REFERENCE_TYPE: + case BLOCK_POINTER_TYPE: if (const PointerType *Ty = cast_or_null(GET_TYPE_LLVM(type))){ // We already converted this type. If this isn't a case where we have to // reparse it, just return it. @@ -1219,7 +1223,8 @@ // types. tree RestrictArgTy = (DeclArgs) ? TREE_TYPE(DeclArgs) : ArgTy; if (TREE_CODE(RestrictArgTy) == POINTER_TYPE || - TREE_CODE(RestrictArgTy) == REFERENCE_TYPE) { + TREE_CODE(RestrictArgTy) == REFERENCE_TYPE || + TREE_CODE(RestrictArgTy) == BLOCK_POINTER_TYPE) { if (TYPE_RESTRICT(RestrictArgTy)) Attributes |= ParamAttr::NoAlias; } From baldrick at free.fr Fri Aug 1 02:12:11 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 1 Aug 2008 09:12:11 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54238 - /llvm-gcc-4.2/trunk/gcc/c-opts.c In-Reply-To: <087AE3E3-F553-4DE4-B15E-1AA269D20FF7@apple.com> References: <200807302351.m6UNpriI013066@zion.cs.uiuc.edu> <087AE3E3-F553-4DE4-B15E-1AA269D20FF7@apple.com> Message-ID: <200808010912.11787.baldrick@free.fr> > > Thanks, Dale. I think my fingers got tired of typing ENABLE_LLVM all > > over the place. :-) > > > > -bw > > Understandable. This shows up in llvm/test, btw, is running that too > much to ask? The mistake was mine: I sent that patch to Bill, with LLVM instead of ENABLE_LLVM. Unfortunately I couldn't test it because I couldn't (and still can't) get llvm-gcc to build. Sorry about that, Duncan. From baldrick at free.fr Fri Aug 1 02:52:53 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 1 Aug 2008 09:52:53 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54260 - /llvm-gcc-4.2/trunk/gcc/c-common.c In-Reply-To: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> References: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> Message-ID: <200808010952.54676.baldrick@free.fr> Hi, > Removed an unnecessary condition check that seems to cause an optimization > error that prevent building after r54240 I think this is completely the wrong approach. If I understand right, this code is being miscompiled. The correct solution is to fix the compiler, not to tweak the code! If it was being miscompiled by someone else's compiler, then I'd be alright with tweaking the code. But it's being miscompiled by our own compiler! What's more, I was told on irc [*] that this only happens (in stage3) if you bootstrap, not if you do a normal build. This suggests that llvm-gcc has miscompiled itself, and the miscompiled llvm-gcc is then miscompiling this code. This is badness, and must be fixed. So please revert your changes. Thanks, Duncan. From monping at apple.com Fri Aug 1 03:16:28 2008 From: monping at apple.com (Mon Ping Wang) Date: Fri, 1 Aug 2008 01:16:28 -0700 (PDT) Subject: [llvm-commits] [llvm-gcc-4.2] r54260 - /llvm-gcc-4.2/trunk/gcc/c-common.c In-Reply-To: <200808010952.54676.baldrick@free.fr> References: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> <200808010952.54676.baldrick@free.fr> Message-ID: <35979.67.120.114.18.1217578588.squirrel@webmail.apple.com> Hi Duncan, I completely agree with you. I view the checkin as a temporary workaround. The main reason why I checked it in was that I was concerned that my breaking the build is preventing other people from get any work done on llvm-gcc. I'm planning to try to figure out why the compiler is doing this weekend and try to fix it. But from your email, it sounds like this bug doesn't badly disrupt people's work flow. If that is the case, I don't have any problem of ripping out my hack. -- Mon Ping On Fri, August 1, 2008 12:52 am, Duncan Sands wrote: > Hi, > >> Removed an unnecessary condition check that seems to cause an >> optimization >> error that prevent building after r54240 > > I think this is completely the wrong approach. If I > understand right, this code is being miscompiled. The > correct solution is to fix the compiler, not to tweak > the code! If it was being miscompiled by someone else's > compiler, then I'd be alright with tweaking the code. > But it's being miscompiled by our own compiler! > What's more, I was told on irc [*] that this only happens > (in stage3) if you bootstrap, not if you do a normal > build. This suggests that llvm-gcc has miscompiled > itself, and the miscompiled llvm-gcc is then miscompiling > this code. This is badness, and must be fixed. > > So please revert your changes. > > Thanks, > > Duncan. > From baldrick at free.fr Fri Aug 1 03:27:53 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 1 Aug 2008 10:27:53 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r54260 - /llvm-gcc-4.2/trunk/gcc/c-common.c In-Reply-To: <35979.67.120.114.18.1217578588.squirrel@webmail.apple.com> References: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> <200808010952.54676.baldrick@free.fr> <35979.67.120.114.18.1217578588.squirrel@webmail.apple.com> Message-ID: <200808011027.53639.baldrick@free.fr> Hi Mon Ping, > I completely agree with you. I view the checkin as a temporary workaround. > The main reason why I checked it in was that I was concerned that my > breaking the build is preventing other people from get any work done on > llvm-gcc. I'm planning to try to figure out why the compiler is doing > this weekend and try to fix it. But from your email, it sounds like this > bug doesn't badly disrupt people's work flow. If that is the case, I don't > have any problem of ripping out my hack. right - since it only (apparently) impacts bootstrap, people can still build the compiler without your changes by disabling bootstrap. Ciao, Duncan. PS: I will try to look into it too, though for the moment I'm waiting for llvm.org to come back online so I can update. From baldrick at free.fr Fri Aug 1 07:23:50 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 01 Aug 2008 12:23:50 -0000 Subject: [llvm-commits] [llvm] r54266 - in /llvm/trunk/lib: Transforms/Scalar/ConstantProp.cpp VMCore/ConstantFold.h Message-ID: <200808011223.m71CNoVc030609@zion.cs.uiuc.edu> Author: baldrick Date: Fri Aug 1 07:23:49 2008 New Revision: 54266 URL: http://llvm.org/viewvc/llvm-project?rev=54266&view=rev Log: Fix comment typos. Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/VMCore/ConstantFold.h Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=54266&r1=54265&r2=54266&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Fri Aug 1 07:23:49 2008 @@ -14,7 +14,7 @@ // // Notice that: // * This pass has a habit of making definitions be dead. It is a good idea -// to to run a DIE pass sometime after running this pass. +// to run a DIE pass sometime after running this pass. // //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/VMCore/ConstantFold.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.h?rev=54266&r1=54265&r2=54266&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.h (original) +++ llvm/trunk/lib/VMCore/ConstantFold.h Fri Aug 1 07:23:49 2008 @@ -11,8 +11,8 @@ // interfaces are used by the ConstantExpr::get* methods to automatically fold // constants when possible. // -// These operators may return a null object if I don't know how to perform the -// specified operation on the specified constant types. +// These operators may return a null object if they don't know how to perform +// the specified operation on the specified constant types. // //===----------------------------------------------------------------------===// From wangmp at apple.com Fri Aug 1 10:22:22 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 01 Aug 2008 15:22:22 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54267 - /llvm-gcc-4.2/trunk/gcc/c-common.c Message-ID: <200808011522.m71FMNmQ004374@zion.cs.uiuc.edu> Author: wangmp Date: Fri Aug 1 10:22:20 2008 New Revision: 54267 URL: http://llvm.org/viewvc/llvm-project?rev=54267&view=rev Log: Revert patch r54260 Modified: llvm-gcc-4.2/trunk/gcc/c-common.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54267&r1=54266&r2=54267&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Fri Aug 1 10:22:20 2008 @@ -8821,9 +8821,8 @@ goto incompatible; type = TREE_TYPE (type); - if (!INTEGRAL_TYPE_P (type)) - if ( !POINTER_TYPE_P (type)) - goto incompatible; + if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) + goto incompatible; size = tree_low_cst (TYPE_SIZE_UNIT (type), 1); if (size == 1 || size == 2 || size == 4 || size == 8 || size == 16) From wangmp at apple.com Fri Aug 1 15:00:56 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 1 Aug 2008 13:00:56 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r54260 - /llvm-gcc-4.2/trunk/gcc/c-common.c In-Reply-To: <200808011027.53639.baldrick@free.fr> References: <200808010316.m713Gsei024945@zion.cs.uiuc.edu> <200808010952.54676.baldrick@free.fr> <35979.67.120.114.18.1217578588.squirrel@webmail.apple.com> <200808011027.53639.baldrick@free.fr> Message-ID: <31ACC137-0BD1-4CF1-A119-A564349B5A43@apple.com> Hi Duncan, I reverted the patch. Just to be clear, what this bug causes in llvm- gcc is that any call to an overloaded intrinsic based on width (char, short, int, etc..) should fail with the parameter mismatch error message. I'm not sure why we were not hitting it before. I need to take a look at which gcc is generating and why the parenthesis are effecting what code is generated. Effectively, the bug when compiling llvm-gcc is that !(a || b || c || d) is not the same as what is being generated for !(a || b) && !(c || d). -- Mon Ping On Aug 1, 2008, at 1:27 AM, Duncan Sands wrote: > Hi Mon Ping, > >> I completely agree with you. I view the checkin as a temporary >> workaround. >> The main reason why I checked it in was that I was concerned that my >> breaking the build is preventing other people from get any work >> done on >> llvm-gcc. I'm planning to try to figure out why the compiler is >> doing >> this weekend and try to fix it. But from your email, it sounds like >> this >> bug doesn't badly disrupt people's work flow. If that is the case, >> I don't >> have any problem of ripping out my hack. > > right - since it only (apparently) impacts bootstrap, people can still > build the compiler without your changes by disabling bootstrap. > > Ciao, > > Duncan. > > PS: I will try to look into it too, though for the moment I'm waiting > for llvm.org to come back online so I can update. From kremenek at apple.com Sat Aug 2 13:20:13 2008 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 02 Aug 2008 18:20:13 -0000 Subject: [llvm-commits] [llvm] r54269 - /llvm/tags/checker/checker-71/ Message-ID: <200808021820.m72IKDkg005233@zion.cs.uiuc.edu> Author: kremenek Date: Sat Aug 2 13:20:12 2008 New Revision: 54269 URL: http://llvm.org/viewvc/llvm-project?rev=54269&view=rev Log: Removing checker-71. Removed: llvm/tags/checker/checker-71/ From kremenek at apple.com Sat Aug 2 13:20:37 2008 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 02 Aug 2008 18:20:37 -0000 Subject: [llvm-commits] [llvm] r54271 - /llvm/tags/checker/checker-71/ Message-ID: <200808021820.m72IKcmR005265@zion.cs.uiuc.edu> Author: kremenek Date: Sat Aug 2 13:20:37 2008 New Revision: 54271 URL: http://llvm.org/viewvc/llvm-project?rev=54271&view=rev Log: Tagging checker-71. Added: llvm/tags/checker/checker-71/ - copied from r54270, llvm/trunk/ From bruno.cardoso at gmail.com Sat Aug 2 14:37:35 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Sat, 02 Aug 2008 19:37:35 -0000 Subject: [llvm-commits] [llvm] r54273 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsISelLowering.h Message-ID: <200808021937.m72JbZdl007851@zion.cs.uiuc.edu> Author: bruno Date: Sat Aug 2 14:37:33 2008 New Revision: 54273 URL: http://llvm.org/viewvc/llvm-project?rev=54273&view=rev Log: Apply the same pattern used in 'and' lowering for 'or' Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54273&r1=54272&r2=54273&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sat Aug 2 14:37:33 2008 @@ -86,7 +86,7 @@ setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); // Used by legalize types to correctly generate the setcc result. - // Without this, every float setcc comes with a AND with the result, + // Without this, every float setcc comes with a AND/OR with the result, // we don't want this, since the fpcmp result goes to a flag register, // which is used implicitly by brcond and select operations. AddPromotedToType(ISD::SETCC, MVT::i1, MVT::i32); @@ -103,10 +103,11 @@ setOperationAction(ISD::SETCC, MVT::f32, Custom); setOperationAction(ISD::BRCOND, MVT::Other, Custom); - // We custom lower AND to handle the case where the DAG contain 'ands' - // setcc results with fp operands. This is necessary since the result - // from these are in a flag register (FCR31). + // We custom lower AND/OR to handle the case where the DAG contain 'ands/ors' + // with operands comming from setcc fp comparions. This is necessary since + // the result from these setcc are in a flag registers (FCR31). setOperationAction(ISD::AND, MVT::i32, Custom); + setOperationAction(ISD::OR, MVT::i32, Custom); // Operations not directly supported by Mips. setOperationAction(ISD::BR_JT, MVT::Other, Expand); @@ -160,7 +161,7 @@ { switch (Op.getOpcode()) { - case ISD::AND: return LowerAND(Op, DAG); + case ISD::AND: return LowerANDOR(Op, DAG); case ISD::BRCOND: return LowerBRCOND(Op, DAG); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG); @@ -168,6 +169,7 @@ case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); + case ISD::OR: return LowerANDOR(Op, DAG); case ISD::RET: return LowerRET(Op, DAG); case ISD::SELECT: return LowerSELECT(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); @@ -360,7 +362,7 @@ //===----------------------------------------------------------------------===// SDValue MipsTargetLowering:: -LowerAND(SDValue Op, SelectionDAG &DAG) +LowerANDOR(SDValue Op, SelectionDAG &DAG) { SDValue LHS = Op.getOperand(0); SDValue RHS = Op.getOperand(1); @@ -376,7 +378,7 @@ SDValue RSEL = DAG.getNode(MipsISD::FPSelectCC, True.getValueType(), RHS, True, False, RHS.getOperand(2)); - return DAG.getNode(ISD::AND, MVT::i32, LSEL, RSEL); + return DAG.getNode(Op.getOpcode(), MVT::i32, LSEL, RSEL); } SDValue MipsTargetLowering:: Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=54273&r1=54272&r2=54273&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Sat Aug 2 14:37:33 2008 @@ -91,7 +91,7 @@ bool IsInSmallSection(unsigned Size); // Lower Operand specifics - SDValue LowerAND(SDValue Op, SelectionDAG &DAG); + SDValue LowerANDOR(SDValue Op, SelectionDAG &DAG); SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG); SDValue LowerCALL(SDValue Op, SelectionDAG &DAG); SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); From bruno.cardoso at gmail.com Sat Aug 2 14:42:37 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Sat, 02 Aug 2008 19:42:37 -0000 Subject: [llvm-commits] [llvm] r54274 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.td Message-ID: <200808021942.m72JgbUO008014@zion.cs.uiuc.edu> Author: bruno Date: Sat Aug 2 14:42:36 2008 New Revision: 54274 URL: http://llvm.org/viewvc/llvm-project?rev=54274&view=rev Log: Improved asm inline for hi,lo results Added hi,lo registers to be used,def implicitly. This provides better handle of instructions which use hi/lo. Fixes a small BranchAnalysis bug Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.td llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=54274&r1=54273&r2=54274&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Sat Aug 2 14:42:36 2008 @@ -59,6 +59,8 @@ } virtual std::string getSectionForFunction(const Function &F) const; + bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, + unsigned AsmVariant, const char *ExtraCode); void printOperand(const MachineInstr *MI, int opNum); void printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier = 0); @@ -337,6 +339,19 @@ return false; } +// Print out an operand for an inline asm expression. +bool MipsAsmPrinter:: +PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, + unsigned AsmVariant, const char *ExtraCode) +{ + // Does this asm operand have a single letter operand modifier? + if (ExtraCode && ExtraCode[0]) + return true; // Unknown modifier. + + printOperand(MI, OpNo); + return false; +} + void MipsAsmPrinter:: printOperand(const MachineInstr *MI, int opNum) { Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp?rev=54274&r1=54273&r2=54274&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Sat Aug 2 14:42:36 2008 @@ -11,7 +11,6 @@ // //===----------------------------------------------------------------------===// -//#include "Mips.h" #include "MipsInstrInfo.h" #include "MipsTargetMachine.h" #include "llvm/ADT/STLExtras.h" @@ -101,11 +100,11 @@ { if ((MI->getOpcode() == Mips::SW) || (MI->getOpcode() == Mips::SWC1) || (MI->getOpcode() == Mips::SWC1A) || (MI->getOpcode() == Mips::SDC1)) { - if ((MI->getOperand(0).isFrameIndex()) && // is a stack slot + if ((MI->getOperand(2).isFrameIndex()) && // is a stack slot (MI->getOperand(1).isImmediate()) && // the imm is zero (isZeroImm(MI->getOperand(1)))) { - FrameIndex = MI->getOperand(0).getIndex(); - return MI->getOperand(2).getReg(); + FrameIndex = MI->getOperand(2).getIndex(); + return MI->getOperand(0).getReg(); } } return 0; @@ -137,14 +136,27 @@ else if ((DestRC == Mips::AFGR32RegisterClass) && (SrcRC == Mips::CPURegsRegisterClass)) BuildMI(MBB, I, get(Mips::MTC1A), DestReg).addReg(SrcReg); + else if ((DestRC == Mips::AFGR32RegisterClass) && + (SrcRC == Mips::CPURegsRegisterClass)) + BuildMI(MBB, I, get(Mips::MTC1A), DestReg).addReg(SrcReg); else if ((SrcRC == Mips::CCRRegisterClass) && (SrcReg == Mips::FCR31)) return; // This register is used implicitly, no copy needed. else if ((DestRC == Mips::CCRRegisterClass) && (DestReg == Mips::FCR31)) return; // This register is used implicitly, no copy needed. - else + else if ((DestRC == Mips::HILORegisterClass) && + (SrcRC == Mips::CPURegsRegisterClass)) { + unsigned Opc = (DestReg == Mips::HI) ? Mips::MTHI : Mips::MTLO; + BuildMI(MBB, I, get(Opc), DestReg); + } else if ((SrcRC == Mips::HILORegisterClass) && + (DestRC == Mips::CPURegsRegisterClass)) { + unsigned Opc = (SrcReg == Mips::HI) ? Mips::MFHI : Mips::MFLO; + BuildMI(MBB, I, get(Opc), DestReg); + } else assert (0 && "DestRC != SrcRC, Can't copy this register"); + + return; } if (DestRC == Mips::CPURegsRegisterClass) @@ -280,8 +292,8 @@ if (Ops[0] == 0) { // COPY -> STORE unsigned SrcReg = MI->getOperand(2).getReg(); bool isKill = MI->getOperand(2).isKill(); - NewMI = BuildMI(MF, get(Mips::SW)).addFrameIndex(FI) - .addImm(0).addReg(SrcReg, false, false, isKill); + NewMI = BuildMI(MF, get(Mips::SW)).addReg(SrcReg, false, false, isKill) + .addImm(0).addFrameIndex(FI); } else { // COPY -> LOAD unsigned DstReg = MI->getOperand(0).getReg(); bool isDead = MI->getOperand(0).isDead(); @@ -312,8 +324,8 @@ if (Ops[0] == 0) { // COPY -> STORE unsigned SrcReg = MI->getOperand(1).getReg(); bool isKill = MI->getOperand(1).isKill(); - NewMI = BuildMI(MF, get(StoreOpc)).addFrameIndex(FI) - .addImm(0).addReg(SrcReg, false, false, isKill); + NewMI = BuildMI(MF, get(StoreOpc)).addReg(SrcReg, false, false, isKill) + .addImm(0).addFrameIndex(FI) ; } else { // COPY -> LOAD unsigned DstReg = MI->getOperand(0).getReg(); bool isDead = MI->getOperand(0).isDead(); @@ -487,7 +499,7 @@ unsigned SecondLastOpc = SecondLastInst->getOpcode(); Mips::CondCode BranchCode = GetCondFromBranchOpc(SecondLastOpc); - if (SecondLastOpc != Mips::COND_INVALID && LastOpc == Mips::J) { + if (BranchCode != Mips::COND_INVALID && LastOpc == Mips::J) { int SecondNumOp = SecondLastInst->getNumOperands(); TBB = SecondLastInst->getOperand(SecondNumOp-1).getMBB(); @@ -584,7 +596,7 @@ return 2; } -/// BlockHasNoFallThrough - Analyse if MachineBasicBlock does not +/// BlockHasNoFallThrough - Analyze if MachineBasicBlock does not /// fall-through into its successor block. bool MipsInstrInfo:: BlockHasNoFallThrough(MachineBasicBlock &MBB) const Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=54274&r1=54273&r2=54274&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Sat Aug 2 14:42:36 2008 @@ -315,7 +315,7 @@ [], itin>; // Move from Hi/Lo -class MoveFromTo func, string instr_asm>: +class MoveFromLOHI func, string instr_asm>: FR< 0x00, func, (outs CPURegs:$dst), @@ -323,6 +323,14 @@ !strconcat(instr_asm, "\t$dst"), [], IIHiLo>; +class MoveToLOHI func, string instr_asm>: + FR< 0x00, + func, + (outs), + (ins CPURegs:$src), + !strconcat(instr_asm, "\t$src"), + [], IIHiLo>; + // Count Leading Ones/Zeros in Word class CountLeading func, string instr_asm>: FR< 0x1c, @@ -459,14 +467,22 @@ "jr\t$target", [(MipsRet CPURegs:$target)], IIBranch>; /// Multiply and Divide Instructions. -def MULT : MulDiv<0x18, "mult", IIImul>; -def MULTu : MulDiv<0x19, "multu", IIImul>; -def DIV : MulDiv<0x1a, "div", IIIdiv>; -def DIVu : MulDiv<0x1b, "divu", IIIdiv>; -def MFHI : MoveFromTo<0x10, "mfhi">; -def MFLO : MoveFromTo<0x12, "mflo">; -def MTHI : MoveFromTo<0x11, "mthi">; -def MTLO : MoveFromTo<0x13, "mtlo">; +let Defs = [HI, LO] in { + def MULT : MulDiv<0x18, "mult", IIImul>; + def MULTu : MulDiv<0x19, "multu", IIImul>; + def DIV : MulDiv<0x1a, "div", IIIdiv>; + def DIVu : MulDiv<0x1b, "divu", IIIdiv>; +} + +let Defs = [HI] in + def MTHI : MoveToLOHI<0x11, "mthi">; +let Defs = [LO] in + def MTLO : MoveToLOHI<0x13, "mtlo">; + +let Uses = [HI] in + def MFHI : MoveFromLOHI<0x10, "mfhi">; +let Uses = [LO] in + def MFLO : MoveFromLOHI<0x12, "mflo">; /// Sign Ext In Register Instructions. let Predicates = [HasSEInReg] in { Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=54274&r1=54273&r2=54274&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Sat Aug 2 14:42:36 2008 @@ -217,14 +217,17 @@ "Instr doesn't have FrameIndex operand!"); } + #ifndef NDEBUG + DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; + DOUT << "<--------->\n"; + MI.print(DOUT); + #endif + int FrameIndex = MI.getOperand(i).getIndex(); int stackSize = MF.getFrameInfo()->getStackSize(); int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex); #ifndef NDEBUG - DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; - DOUT << "<--------->\n"; - MI.print(DOUT); DOUT << "FrameIndex : " << FrameIndex << "\n"; DOUT << "spOffset : " << spOffset << "\n"; DOUT << "stackSize : " << stackSize << "\n"; Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td?rev=54274&r1=54273&r2=54274&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td Sat Aug 2 14:42:36 2008 @@ -126,6 +126,10 @@ def D14 : AFPR<28, "F28", [F28, F29]>, DwarfRegNum<[60]>; def D15 : AFPR<30, "F30", [F30, F31]>, DwarfRegNum<[62]>; + // Hi/Lo registers + def HI : Register<"hi">, DwarfRegNum<[64]>; + def LO : Register<"lo">, DwarfRegNum<[65]>; + // Status flags register def FCR31 : Register<"FCR31">; } @@ -233,3 +237,7 @@ let CopyCost = -1; // Don't allow copying of status registers. } +def HILO : RegisterClass<"Mips", [i32], 32, [HI, LO]> { + //let CopyCost = -1; // Don't allow copying of hi/lo registers. +} + From isanbard at gmail.com Sat Aug 2 21:31:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 03 Aug 2008 02:31:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54275 - in /llvm-gcc-4.2/trunk/libgomp/testsuite: lib/libgomp-dg.exp libgomp.c++/c++.exp libgomp.c/c.exp Message-ID: <200808030231.m732VJsn020014@zion.cs.uiuc.edu> Author: void Date: Sat Aug 2 21:31:18 2008 New Revision: 54275 URL: http://llvm.org/viewvc/llvm-project?rev=54275&view=rev Log: Update the libgomp *.exp files. Modified: llvm-gcc-4.2/trunk/libgomp/testsuite/lib/libgomp-dg.exp llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c++/c++.exp llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c/c.exp Modified: llvm-gcc-4.2/trunk/libgomp/testsuite/lib/libgomp-dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libgomp/testsuite/lib/libgomp-dg.exp?rev=54275&r1=54274&r2=54275&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libgomp/testsuite/lib/libgomp-dg.exp (original) +++ llvm-gcc-4.2/trunk/libgomp/testsuite/lib/libgomp-dg.exp Sat Aug 2 21:31:18 2008 @@ -1,221 +1,4 @@ -# Damn dejagnu for not having proper library search paths for load_lib. -# We have to explicitly load everything that gcc-dg.exp wants to load. - -proc load_gcc_lib { filename } { - global srcdir loaded_libs - - load_file $srcdir/../../gcc/testsuite/lib/$filename - set loaded_libs($filename) "" -} - -load_lib dg.exp -load_gcc_lib file-format.exp -load_gcc_lib target-supports.exp -load_gcc_lib target-supports-dg.exp -load_gcc_lib scanasm.exp -load_gcc_lib scandump.exp -load_gcc_lib scanrtl.exp -load_gcc_lib scantree.exp -load_gcc_lib scanipa.exp -load_gcc_lib prune.exp -load_gcc_lib target-libpath.exp -load_gcc_lib wrapper.exp -load_gcc_lib gcc-defs.exp -load_gcc_lib gcc-dg.exp -load_gcc_lib gfortran-dg.exp - -set dg-do-what-default run - -# -# GCC_UNDER_TEST is the compiler under test. -# - -set libgomp_compile_options "" - -# -# libgomp_init -- This gets run more than it should be.... -# - -if [info exists TOOL_OPTIONS] { - set multilibs [get_multilibs $TOOL_OPTIONS] -} else { - set multilibs [get_multilibs] -} - -proc libgomp_init { args } { - global srcdir blddir objdir tool_root_dir - global libgomp_initialized - global tmpdir - global gluefile wrap_flags - global ALWAYS_CFLAGS - global CFLAGS - global TOOL_EXECUTABLE TOOL_OPTIONS - global GCC_UNDER_TEST - global TESTING_IN_BUILD_TREE - global target_triplet - global ld_library_path - global lang_test_file - global lang_library_path - global lang_link_flags - - set blddir [lookfor_file [get_multilibs] libgomp] - - # We set LC_ALL and LANG to C so that we get the same error - # messages as expected. - setenv LC_ALL C - setenv LANG C - - if ![info exists GCC_UNDER_TEST] then { - if [info exists TOOL_EXECUTABLE] { - set GCC_UNDER_TEST $TOOL_EXECUTABLE - } else { - set GCC_UNDER_TEST "[find_gcc]" - } - } - - if ![info exists tmpdir] { - set tmpdir "/tmp" - } - - if [info exists gluefile] { - unset gluefile - } - - if {![info exists CFLAGS]} { - set CFLAGS "" - } - - # Locate libgcc.a so we don't need to account for different values of - # SHLIB_EXT on different platforms - set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] - if {$gccdir != ""} { - set gccdir [file dirname $gccdir] - } - - # Compute what needs to be put into LD_LIBRARY_PATH - set ld_library_path ".:${blddir}/.libs" - - if { [info exists lang_test_file] && [file exists "${blddir}/"] } { - append ld_library_path ":${blddir}/${lang_library_path}" - } - - # Compute what needs to be added to the existing LD_LIBRARY_PATH. - if {$gccdir != ""} { - append ld_library_path ":${gccdir}" - set compiler [lindex $GCC_UNDER_TEST 0] - - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { - set mldir "" - regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir - set mldir [string trimright $mldir "\;@"] - if { "$mldir" == "." } { - continue - } - if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { - append ld_library_path ":${gccdir}/${mldir}" - } - } - } - } - set_ld_library_path_env_vars - - set ALWAYS_CFLAGS "" - lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/" - lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}" - lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.." - lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp" - if { [info exists lang_test_file] && [file exists "${blddir}/"] } { - lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${lang_library_path} ${lang_link_flags}" - } - - # We use atomic operations in the testcases to validate results. - if [istarget i?86-*-*] { - lappend ALWAYS_CFLAGS "additional_flags=-march=i486" - } - if [istarget sparc*-*-*] { - lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9" - } - - if [info exists TOOL_OPTIONS] { - lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS" - } - - # Make sure that lines are not wrapped. That can confuse the - # error-message parsing machinery. - lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0" - - # And, gee, turn on OpenMP. - lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" -} - -# -# libgomp_target_compile -- compile a source file -# - -proc libgomp_target_compile { source dest type options } { - global tmpdir - global libgomp_compile_options - global gluefile wrap_flags - global ALWAYS_CFLAGS - global GCC_UNDER_TEST - - libgomp_init - - if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=${wrap_flags}" - } - - lappend options "additional_flags=[libio_include_flags]" - lappend options "compiler=$GCC_UNDER_TEST" - - set options [concat $libgomp_compile_options $options] - - set options [concat "$ALWAYS_CFLAGS" $options] - - set options [dg-additional-files-options $options $source] - - set result [target_compile $source $dest $type $options] - - return $result -} - -# ??? The same as in standard.exp. Why doesn't anyone else have to -# define this? - -proc libgomp_load { program args } { - if { [llength $args] > 0 } { - set program_args [lindex $args 0] - } else { - set program_args "" - } - - if { [llength $args] > 1 } { - set input_file [lindex $args 1] - } else { - set input_file "" - } - return [remote_load target $program $program_args $input_file] -} - -proc libgomp_option_help { } { - send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n" -} - -proc libgomp_option_proc { option } { - if [regexp "^--additional_options," $option] { - global libgomp_compile_options - regsub "--additional_options," $option "" option - foreach x [split $option ","] { - lappend libgomp_compile_options "additional_flags=$x" - } - return 1 - } else { - return 0 - } -} - +# APPLE LOCAL file mainline proc libgomp-dg-test { prog do_what extra_tool_flags } { return [gcc-dg-test-1 libgomp_target_compile $prog $do_what $extra_tool_flags] } Modified: llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c++/c++.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c%2B%2B/c%2B%2B.exp?rev=54275&r1=54274&r2=54275&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c++/c++.exp (original) +++ llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c++/c++.exp Sat Aug 2 21:31:18 2008 @@ -1,17 +1,44 @@ -set lang_library_path "../libstdc++-v3/src/.libs" -set lang_test_file "${lang_library_path}/libstdc++.a" -set lang_link_flags "-lstdc++" - +# APPLE LOCAL file mainline load_lib libgomp-dg.exp +global shlib_ext + +set shlib_ext [get_shlib_extension] +set lang_link_flags "-lstdc++" +set lang_test_file_found 0 +set lang_library_path "../libstdc++-v3/src/.libs" + # Initialize dg. dg-init -if [file exists "${blddir}/${lang_test_file}"] { +set blddir [lookfor_file [get_multilibs] libgomp] +# Look for a static libstdc++ first. +if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] { + set lang_test_file "${lang_library_path}/libstdc++.a" + set lang_test_file_found 1 +# We may have a shared only build, so look for a shared libstdc++. +} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] { + set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}" + set lang_test_file_found 1 +# APPLE LOCAL begin mainline candidate +# We may be testing an installed compiler, if $blddir is blank look for 'g++' +} elseif { $blddir == "" } { + verbose -log "Testing an installed compiler - you'd better have installed g++" + set GCC_UNDER_TEST [transform "g++"] + set lang_test_file_found 1 +# APPLE LOCAL end mainline candidate +} else { + puts "No libstdc++ library found, will not execute c++ tests" +} + +if { $lang_test_file_found } { # Gather a list of all tests. set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]] + set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" + set_ld_library_path_env_vars + # Main loop. gfortran-dg-runtest $tests "" } Modified: llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c/c.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c/c.exp?rev=54275&r1=54274&r2=54275&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c/c.exp (original) +++ llvm-gcc-4.2/trunk/libgomp/testsuite/libgomp.c/c.exp Sat Aug 2 21:31:18 2008 @@ -1,3 +1,4 @@ +# APPLE LOCAL file mainline if [info exists lang_library_path] then { unset lang_library_path unset lang_test_file @@ -8,7 +9,7 @@ # If a testcase doesn't have special options, use these. if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS "-O2 -fopenmp" + set DEFAULT_CFLAGS "-O2" } # Initialize dg. @@ -17,6 +18,9 @@ # Gather a list of all tests. set tests [lsort [find $srcdir/$subdir *.c]] +set ld_library_path $always_ld_library_path +set_ld_library_path_env_vars + # Main loop. dg-runtest $tests "" $DEFAULT_CFLAGS From isanbard at gmail.com Sat Aug 2 23:04:13 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 03 Aug 2008 04:04:13 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54277 - in /llvm-gcc-4.2/trunk/gcc/config/arm: arm.c ieee754-df.S ieee754-sf.S lib1funcs.asm Message-ID: <200808030404.m7344DAc022785@zion.cs.uiuc.edu> Author: void Date: Sat Aug 2 23:04:12 2008 New Revision: 54277 URL: http://llvm.org/viewvc/llvm-project?rev=54277&view=rev Log: - ARM 4702983 Thumb VFP math - More compact switch tables support - Function alignment Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=54277&r1=54276&r2=54277&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Sat Aug 2 23:04:12 2008 @@ -9358,8 +9358,10 @@ if (GET_CODE (insn) == BARRIER) push_minipool_barrier (insn, address); + /* APPLE LOCAL begin ARM 6008578 */ else if (LABEL_P (insn)) address += get_label_pad (insn, address); + /* APPLE LOCAL end ARM 6008578 */ else if (INSN_P (insn)) { rtx table; Modified: llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S?rev=54277&r1=54276&r2=54277&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-df.S Sat Aug 2 23:04:12 2008 @@ -1382,3 +1382,256 @@ FUNC_END truncdfsf2 #endif /* L_truncdfsf2 */ + +/* APPLE LOCAL begin ARM 4702983 Thumb VFP math */ +#ifndef NOT_DARWIN +#if __ARM_ARCH__ > 5 +#ifdef L_muldf3vfp + +ARM_FUNC_START muldf3vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fmuld d5, d6, d7 + fmrrd r0, r1, d5 + RET + + FUNC_END muldf3vfp + +#endif + +#ifdef L_adddf3vfp + +ARM_FUNC_START adddf3vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + faddd d5, d6, d7 + fmrrd r0, r1, d5 + RET + + FUNC_END adddf3vfp + +#endif + +#ifdef L_subdf3vfp + +ARM_FUNC_START subdf3vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fsubd d5, d6, d7 + fmrrd r0, r1, d5 + RET + + FUNC_END subdf3vfp + +#endif + +#ifdef L_divdf3vfp + +ARM_FUNC_START divdf3vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fdivd d5, d6, d7 + fmrrd r0, r1, d5 + RET + + FUNC_END divdf3vfp + +#endif + +#ifdef L_eqdf2vfp + +ARM_FUNC_START eqdf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movne r0, #0 + moveq r0, #1 + RET + + FUNC_END eqdf2vfp + +#endif + +#ifdef L_nedf2vfp + +ARM_FUNC_START nedf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + moveq r0, #0 + movne r0, #1 + RET + + FUNC_END nedf2vfp + +#endif + +#ifdef L_ltdf2vfp + +ARM_FUNC_START ltdf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movpl r0, #0 + movmi r0, #1 + RET + + FUNC_END ltdf2vfp + +#endif + +#ifdef L_gtdf2vfp + +ARM_FUNC_START gtdf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movle r0, #0 + movgt r0, #1 + RET + + FUNC_END gtdf2vfp + +#endif + +#ifdef L_ledf2vfp + +ARM_FUNC_START ledf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movhi r0, #0 + movls r0, #1 + RET + + FUNC_END ledf2vfp + +#endif + +#ifdef L_gedf2vfp + +ARM_FUNC_START gedf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movlt r0, #0 + movge r0, #1 + RET + + FUNC_END gedf2vfp + +#endif + +#ifdef L_unorddf2vfp + +ARM_FUNC_START unorddf2vfp + + fmdrr d6, r0, r1 + fmdrr d7, r2, r3 + fcmpd d6, d7 + fmstat + movvc r0, #0 + movvs r0, #1 + RET + + FUNC_END unorddf2vfp + +#endif + +#ifdef L_fixdfsivfp + +ARM_FUNC_START fixdfsivfp + + fmdrr d7, r0, r1 + ftosizd s15, d7 + fmrs r0, s15 + RET + + FUNC_END fixdfsivfp + +#endif + +#ifdef L_fixunsdfsivfp + +ARM_FUNC_START fixunsdfsivfp + + fmdrr d7, r0, r1 + ftouizd s15, d7 + fmrs r0, s15 + RET + + FUNC_END fixunsdfsivfp + +#endif + +#ifdef L_extendsfdf2vfp + +ARM_FUNC_START extendsfdf2vfp + + fmsr s15, r0 + fcvtds d7, s15 + fmrrd r0, r1, d7 + RET + + FUNC_END extendsfdf2vfp + +#endif + +#ifdef L_truncdfsf2vfp + +ARM_FUNC_START truncdfsf2vfp + + fmdrr d7, r0, r1 + fcvtsd s15, d7 + fmrs r0, s15 + RET + + FUNC_END truncdfsf2vfp + +#endif + +#ifdef L_floatsidfvfp + +ARM_FUNC_START floatsidfvfp + + fmsr s15, r0 + fsitod d7, s15 + fmrrd r0, r1, d7 + RET + + FUNC_END floatsidfvfp + +#endif + +#ifdef L_floatsidfvfp + +ARM_FUNC_START floatunssidfvfp + + fmsr s15, r0 + fuitod d7, s15 + fmrrd r0, r1, d7 + RET + + FUNC_END floatunssidfvfp + +#endif + +#endif /* __ARM_ARCH__ > 5 */ +#endif /* NOT_DARWIN */ +/* APPLE LOCAL end ARM 4702983 Thumb VFP math */ Modified: llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S?rev=54277&r1=54276&r2=54277&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/ieee754-sf.S Sat Aug 2 23:04:12 2008 @@ -994,3 +994,230 @@ FUNC_END fixunssfsi #endif /* L_fixunssfsi */ + +/* APPLE LOCAL begin ARM 4702983 Thumb VFP math */ +#ifndef NOT_DARWIN +#if __ARM_ARCH__ > 5 +#ifdef L_mulsf3vfp + +ARM_FUNC_START mulsf3vfp + + fmsr s14, r0 + fmsr s15, r1 + fmuls s13, s14, s15 + fmrs r0, s13 + RET + + FUNC_END mulsf3vfp + +#endif + +#ifdef L_addsf3vfp + +ARM_FUNC_START addsf3vfp + + fmsr s14, r0 + fmsr s15, r1 + fadds s13, s14, s15 + fmrs r0, s13 + RET + + FUNC_END addsf3vfp + +#endif + +#ifdef L_subsf3vfp + +ARM_FUNC_START subsf3vfp + + fmsr s14, r0 + fmsr s15, r1 + fsubs s13, s14, s15 + fmrs r0, s13 + RET + + FUNC_END subsf3vfp + +#endif + +#ifdef L_divsf3vfp + +ARM_FUNC_START divsf3vfp + + fmsr s14, r0 + fmsr s15, r1 + fdivs s13, s14, s15 + fmrs r0, s13 + RET + + FUNC_END divsf3vfp + +#endif + +#ifdef L_eqsf2vfp + +ARM_FUNC_START eqsf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movne r0, #0 + moveq r0, #1 + RET + + FUNC_END eqsf2vfp + +#endif + +#ifdef L_nesf2vfp + +ARM_FUNC_START nesf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + moveq r0, #0 + movne r0, #1 + RET + + FUNC_END nesf2vfp + +#endif + +#ifdef L_ltsf2vfp + +ARM_FUNC_START ltsf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movpl r0, #0 + movmi r0, #1 + RET + + FUNC_END ltsf2vfp + +#endif + +#ifdef L_gtsf2vfp + +ARM_FUNC_START gtsf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movle r0, #0 + movgt r0, #1 + RET + + FUNC_END gtsf2vfp + +#endif + +#ifdef L_lesf2vfp + +ARM_FUNC_START lesf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movhi r0, #0 + movls r0, #1 + RET + + FUNC_END lesf2vfp + +#endif + +#ifdef L_gesf2vfp + +ARM_FUNC_START gesf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movlt r0, #0 + movge r0, #1 + RET + + FUNC_END gesf2vfp + +#endif + +#ifdef L_unordsf2vfp + +ARM_FUNC_START unordsf2vfp + + fmsr s14, r0 + fmsr s15, r1 + fcmps s14, s15 + fmstat + movvc r0, #0 + movvs r0, #1 + RET + + FUNC_END unordsf2vfp + +#endif + +#ifdef L_fixsfsivfp + +ARM_FUNC_START fixsfsivfp + + fmsr s15, r0 + ftosizs s15, s15 + fmrs r0, s15 + RET + + FUNC_END fixsfsivfp + +#endif + +#ifdef L_fixunssfsivfp + +ARM_FUNC_START fixunssfsivfp + + fmsr s15, r0 + ftouizs s15, s15 + fmrs r0, s15 + RET + + FUNC_END fixunssfsivfp + +#endif + +#ifdef L_floatsisfvfp + +ARM_FUNC_START floatsisfvfp + + fmsr s15, r0 + fsitos s15, s15 + fmrs r0, s15 + RET + + FUNC_END floatsisfvfp + +#endif + +#ifdef L_floatsisfvfp + +ARM_FUNC_START floatunssisfvfp + + fmsr s15, r0 + fuitos s15, s15 + fmrs r0, s15 + RET + + FUNC_END floatunssisfvfp + +#endif + +#endif /* __ARM_ARCH__ > 5 */ +#endif /* NOT_DARWIN */ +/* APPLE LOCAL end ARM 4702983 Thumb VFP math */ Modified: llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm?rev=54277&r1=54276&r2=54277&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/lib1funcs.asm Sat Aug 2 23:04:12 2008 @@ -345,7 +345,8 @@ .text .globl SYM (__$0) TYPE (__$0) - .align 0 + /* APPLE LOCAL ARM function alignment */ + .align 2 .arm SYM (__$0): #else @@ -1272,6 +1273,85 @@ #endif +/* APPLE LOCAL begin ARM 4790140 compact switch tables */ +/* ----------------------------------------------------------------------- */ +/* Thumb switch table implementation. Arm code, although must be called + from Thumb (the low bit of LR is expected to be 1). + Expects the call site to be followed by 1-byte count, then + 1-byte unsigned half-offsets (low bit of real offset is always 0, so + not stored), then the half-offset for the default case (not included + in the count). */ + +#ifdef L_switchu8 + + FUNC_START switchu8 + + ldrb ip, [lr, #-1] + cmp r0, ip + ldrccb r0, [lr, r0] + ldrcsb r0, [lr, ip] + add ip, lr, r0, lsl #1 + bx ip + + FUNC_END switchu8 +#endif + +/* Same with signed half-offsets. */ + +#ifdef L_switch8 + + FUNC_START switch8 + + ldrb ip, [lr, #-1] + cmp r0, ip + ldrccsb r0, [lr, r0] + ldrcssb r0, [lr, ip] + add ip, lr, r0, lsl #1 + bx ip + + FUNC_END switch8 +#endif + +/* Same with 16-bit signed half-offsets. (This one is not + all that efficient, there's no reg+reg< Author: void Date: Sat Aug 2 23:05:06 2008 New Revision: 54278 URL: http://llvm.org/viewvc/llvm-project?rev=54278&view=rev Log: Use __byref instead of __block Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c llvm-gcc-4.2/trunk/gcc/config/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=54278&r1=54277&r2=54278&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Sat Aug 2 23:05:06 2008 @@ -1086,13 +1086,9 @@ if (flag_blocks && !c_dialect_cxx ()) { /* APPLE LOCAL radar 6096219 */ builtin_define ("__byref=__attribute__((__blocks__(byref)))"); - /* APPLE LOCAL radar 6014138 */ - builtin_define ("__block=__attribute__((__blocks__(byref)))"); } else { builtin_define ("__byref="); - /* APPLE LOCAL radar 6014138 */ - builtin_define ("__block="); } /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=54278&r1=54277&r2=54278&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Sat Aug 2 23:05:06 2008 @@ -1044,6 +1044,7 @@ } while (0) #else /* LLVM LOCAL end */ + #define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME) \ do { \ if (FILE) { \ From isanbard at gmail.com Sat Aug 2 23:05:27 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 03 Aug 2008 04:05:27 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54279 - in /llvm-gcc-4.2/trunk/gcc/config: darwin.c rs6000/rs6000.c Message-ID: <200808030405.m7345RuG022860@zion.cs.uiuc.edu> Author: void Date: Sat Aug 2 23:05:27 2008 New Revision: 54279 URL: http://llvm.org/viewvc/llvm-project?rev=54279&view=rev Log: - stack-protector default 5095227 Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=54279&r1=54278&r2=54279&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Sat Aug 2 23:05:27 2008 @@ -2570,6 +2570,16 @@ darwin_stubs = true; /* APPLE LOCAL end ARM 5683689 */ /* APPLE LOCAL end axe stubs 5571540 */ + /* APPLE LOCAL begin stack-protector default 5095227 */ + /* Default flag_stack_protect to 1 if on 10.5 or later for user code,