[llvm-commits] [llvm] r50187 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp
Devang Patel
dpatel at apple.com
Wed Apr 23 15:01:33 PDT 2008
Dan,
Thanks!
-
Devang
On Apr 23, 2008, at 2:49 PM, Dan Gohman wrote:
> Author: djg
> Date: Wed Apr 23 16:49:29 2008
> New Revision: 50187
>
> URL: http://llvm.org/viewvc/llvm-project?rev=50187&view=rev
> Log:
> Initial CBE support for multiple return values.
>
> Modified:
> llvm/trunk/lib/Target/CBackend/CBackend.cpp
>
> Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=50187&r1=50186&r2=50187&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
> +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed Apr 23 16:49:29
> 2008
> @@ -283,6 +283,7 @@
> void visitInsertElementInst(InsertElementInst &I);
> void visitExtractElementInst(ExtractElementInst &I);
> void visitShuffleVectorInst(ShuffleVectorInst &SVI);
> + void visitGetResultInst(GetResultInst &GRI);
>
> void visitInstruction(Instruction &I) {
> cerr << "C Writer does not know about " << I;
> @@ -2174,6 +2175,24 @@
> return;
> }
>
> + if (I.getNumOperands() > 1) {
> + Out << " {\n";
> + Out << " ";
> + printType(Out, I.getParent()->getParent()->getReturnType());
> + Out << " llvm_cbe_mrv_temp = {\n";
> + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
> + Out << " ";
> + writeOperand(I.getOperand(i));
> + if (i != e - 1)
> + Out << ",";
> + Out << "\n";
> + }
> + Out << " };\n";
> + Out << " return llvm_cbe_mrv_temp;\n";
> + Out << " }\n";
> + return;
> + }
> +
> Out << " return";
> if (I.getNumOperands()) {
> Out << ' ';
> @@ -3184,6 +3203,17 @@
> Out << "}";
> }
>
> +void CWriter::visitGetResultInst(GetResultInst &GRI) {
> + Out << "(";
> + if (isa<UndefValue>(GRI.getOperand(0))) {
> + Out << "(";
> + printType(Out, GRI.getType());
> + Out << ") 0/*UNDEF*/";
> + } else {
> + Out << GetValueName(GRI.getOperand(0)) << ".field" <<
> GRI.getIndex();
> + }
> + Out << ")";
> +}
>
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> // External Interface declaration
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list