Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 1 | //===--- CodeGenFunction.h - Per-Function state for LLVM CodeGen ----------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Chris Lattner and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This is the internal per-function state used for llvm translation. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEGEN_CODEGENFUNCTION_H |
| 15 | #define CODEGEN_CODEGENFUNCTION_H |
| 16 | |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/DenseMap.h" |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 18 | #include "llvm/Support/LLVMBuilder.h" |
Chris Lattner | 45bb914 | 2007-06-09 02:28:57 +0000 | [diff] [blame] | 19 | #include <vector> |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 20 | |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 21 | namespace llvm { |
| 22 | class Module; |
| 23 | namespace clang { |
Chris Lattner | 45bb914 | 2007-06-09 02:28:57 +0000 | [diff] [blame] | 24 | class SourceLocation; |
| 25 | class TargetInfo; |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 26 | class ASTContext; |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 27 | class Decl; |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 28 | class FunctionDecl; |
Chris Lattner | d1af2d2 | 2007-05-29 23:17:50 +0000 | [diff] [blame] | 29 | class QualType; |
Chris Lattner | 45bb914 | 2007-06-09 02:28:57 +0000 | [diff] [blame] | 30 | class FunctionTypeProto; |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 31 | |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 32 | class Stmt; |
| 33 | class CompoundStmt; |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 34 | class LabelStmt; |
| 35 | class GotoStmt; |
Chris Lattner | 5269c03 | 2007-05-30 21:03:58 +0000 | [diff] [blame] | 36 | class IfStmt; |
Chris Lattner | 946aa31 | 2007-06-05 03:59:43 +0000 | [diff] [blame] | 37 | class WhileStmt; |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 38 | class DoStmt; |
| 39 | class ForStmt; |
Chris Lattner | 3f3dbee | 2007-06-02 03:19:07 +0000 | [diff] [blame] | 40 | class ReturnStmt; |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 41 | class DeclStmt; |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 42 | |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 43 | class Expr; |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 44 | class DeclRefExpr; |
Chris Lattner | 4347e369 | 2007-06-06 04:54:52 +0000 | [diff] [blame] | 45 | class StringLiteral; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 46 | class IntegerLiteral; |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 47 | class CastExpr; |
Chris Lattner | 2b228c9 | 2007-06-15 21:34:29 +0000 | [diff] [blame^] | 48 | class CallExpr; |
Chris Lattner | f0106d2 | 2007-06-02 19:33:17 +0000 | [diff] [blame] | 49 | class UnaryOperator; |
Chris Lattner | db91b16 | 2007-06-02 00:16:28 +0000 | [diff] [blame] | 50 | class BinaryOperator; |
Chris Lattner | d9d2fb1 | 2007-06-08 23:31:14 +0000 | [diff] [blame] | 51 | class ArraySubscriptExpr; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 52 | |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 53 | class BlockVarDecl; |
| 54 | class EnumConstantDecl; |
Chris Lattner | 53621a5 | 2007-06-13 20:44:40 +0000 | [diff] [blame] | 55 | class ParmVarDecl; |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 56 | namespace CodeGen { |
| 57 | class CodeGenModule; |
| 58 | |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 59 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 60 | /// RValue - This trivial value class is used to represent the result of an |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 61 | /// expression that is evaluated. It can be one of two things: either a simple |
| 62 | /// LLVM SSA value, or the address of an aggregate value in memory. These two |
| 63 | /// possibilities are discriminated by isAggregate/isScalar. |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 64 | class RValue { |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 65 | Value *V; |
Chris Lattner | db91b16 | 2007-06-02 00:16:28 +0000 | [diff] [blame] | 66 | // TODO: Encode this into the low bit of pointer for more efficient |
| 67 | // return-by-value. |
Chris Lattner | 5269c03 | 2007-05-30 21:03:58 +0000 | [diff] [blame] | 68 | bool IsAggregate; |
| 69 | public: |
| 70 | |
| 71 | bool isAggregate() const { return IsAggregate; } |
| 72 | bool isScalar() const { return !IsAggregate; } |
| 73 | |
| 74 | /// getVal() - Return the Value* of this scalar value. |
| 75 | Value *getVal() const { |
| 76 | assert(!isAggregate() && "Not a scalar!"); |
| 77 | return V; |
| 78 | } |
| 79 | |
| 80 | /// getAggregateVal() - Return the Value* of the address of the aggregate. |
| 81 | Value *getAggregateVal() const { |
| 82 | assert(isAggregate() && "Not an aggregate!"); |
| 83 | return V; |
| 84 | } |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 85 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 86 | static RValue get(Value *V) { |
| 87 | RValue ER; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 88 | ER.V = V; |
Chris Lattner | 5269c03 | 2007-05-30 21:03:58 +0000 | [diff] [blame] | 89 | ER.IsAggregate = false; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 90 | return ER; |
| 91 | } |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 92 | static RValue getAggregate(Value *V) { |
| 93 | RValue ER; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 94 | ER.V = V; |
Chris Lattner | 5269c03 | 2007-05-30 21:03:58 +0000 | [diff] [blame] | 95 | ER.IsAggregate = true; |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 96 | return ER; |
| 97 | } |
| 98 | }; |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 99 | |
| 100 | |
| 101 | /// LValue - This represents an lvalue references. Because C/C++ allow |
| 102 | /// bitfields, this is not a simple LLVM pointer, it may be a pointer plus a |
| 103 | /// bitrange. |
| 104 | class LValue { |
| 105 | // FIXME: Volatility. Restrict? |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 106 | // alignment? |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 107 | llvm::Value *V; |
| 108 | public: |
| 109 | bool isBitfield() const { return false; } |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 110 | |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 111 | llvm::Value *getAddress() const { assert(!isBitfield()); return V; } |
| 112 | |
| 113 | static LValue getAddr(Value *V) { |
| 114 | LValue R; |
| 115 | R.V = V; |
| 116 | return R; |
| 117 | } |
| 118 | }; |
| 119 | |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 120 | /// CodeGenFunction - This class organizes the per-function state that is used |
| 121 | /// while generating LLVM code. |
| 122 | class CodeGenFunction { |
| 123 | CodeGenModule &CGM; // Per-module state. |
Chris Lattner | d1af2d2 | 2007-05-29 23:17:50 +0000 | [diff] [blame] | 124 | TargetInfo &Target; |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 125 | LLVMBuilder Builder; |
Chris Lattner | 3f3dbee | 2007-06-02 03:19:07 +0000 | [diff] [blame] | 126 | |
| 127 | const FunctionDecl *CurFuncDecl; |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 128 | llvm::Function *CurFn; |
| 129 | |
Chris Lattner | 03df122 | 2007-06-02 04:53:11 +0000 | [diff] [blame] | 130 | /// AllocaInsertPoint - This is an instruction in the entry block before which |
| 131 | /// we prefer to insert allocas. |
| 132 | llvm::Instruction *AllocaInsertPt; |
| 133 | |
Chris Lattner | 6db1fb8 | 2007-06-02 22:49:07 +0000 | [diff] [blame] | 134 | const llvm::Type *LLVMIntTy; |
Chris Lattner | d9d2fb1 | 2007-06-08 23:31:14 +0000 | [diff] [blame] | 135 | unsigned LLVMPointerWidth; |
Chris Lattner | 6db1fb8 | 2007-06-02 22:49:07 +0000 | [diff] [blame] | 136 | |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 137 | /// LocalDeclMap - This keeps track of the LLVM allocas or globals for local C |
| 138 | /// decls. |
| 139 | DenseMap<const Decl*, llvm::Value*> LocalDeclMap; |
| 140 | |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 141 | /// LabelMap - This keeps track of the LLVM basic block for each C label. |
| 142 | DenseMap<const LabelStmt*, llvm::BasicBlock*> LabelMap; |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 143 | public: |
Chris Lattner | d1af2d2 | 2007-05-29 23:17:50 +0000 | [diff] [blame] | 144 | CodeGenFunction(CodeGenModule &cgm); |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 145 | |
Chris Lattner | 6db1fb8 | 2007-06-02 22:49:07 +0000 | [diff] [blame] | 146 | ASTContext &getContext() const; |
| 147 | |
Chris Lattner | d1af2d2 | 2007-05-29 23:17:50 +0000 | [diff] [blame] | 148 | const llvm::Type *ConvertType(QualType T, SourceLocation Loc); |
Chris Lattner | 45bb914 | 2007-06-09 02:28:57 +0000 | [diff] [blame] | 149 | void DecodeArgumentTypes(const FunctionTypeProto &FTP, |
| 150 | std::vector<const llvm::Type*> &ArgTys, |
| 151 | SourceLocation Loc); |
Chris Lattner | d1af2d2 | 2007-05-29 23:17:50 +0000 | [diff] [blame] | 152 | |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 153 | void GenerateCode(const FunctionDecl *FD); |
| 154 | |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 155 | |
| 156 | /// getBasicBlockForLabel - Return the LLVM basicblock that the specified |
| 157 | /// label maps to. |
| 158 | llvm::BasicBlock *getBasicBlockForLabel(const LabelStmt *S); |
| 159 | |
| 160 | |
| 161 | void EmitBlock(BasicBlock *BB); |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 162 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 163 | |
| 164 | /// EvaluateExprAsBool - Perform the usual unary conversions on the specified |
| 165 | /// expression and compare the result against zero, returning an Int1Ty value. |
| 166 | Value *EvaluateExprAsBool(const Expr *E); |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 167 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 168 | //===--------------------------------------------------------------------===// |
| 169 | // Conversions |
| 170 | //===--------------------------------------------------------------------===// |
| 171 | |
| 172 | /// EmitConversion - Convert the value specied by Val, whose type is ValTy, to |
| 173 | /// the type specified by DstTy, following the rules of C99 6.3. |
Chris Lattner | cf106ab | 2007-06-06 04:05:39 +0000 | [diff] [blame] | 174 | RValue EmitConversion(RValue Val, QualType ValTy, QualType DstTy, |
| 175 | SourceLocation Loc); |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 176 | |
| 177 | /// ConvertScalarValueToBool - Convert the specified expression value to a |
Chris Lattner | f0106d2 | 2007-06-02 19:33:17 +0000 | [diff] [blame] | 178 | /// boolean (i1) truth value. This is equivalent to "Val == 0". |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 179 | Value *ConvertScalarValueToBool(RValue Val, QualType Ty); |
Chris Lattner | f0106d2 | 2007-06-02 19:33:17 +0000 | [diff] [blame] | 180 | |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 181 | //===--------------------------------------------------------------------===// |
Chris Lattner | 53621a5 | 2007-06-13 20:44:40 +0000 | [diff] [blame] | 182 | // Declaration Emission |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 183 | //===--------------------------------------------------------------------===// |
| 184 | |
Chris Lattner | 1ad38f8 | 2007-06-09 01:20:56 +0000 | [diff] [blame] | 185 | void EmitDecl(const Decl &D); |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 186 | void EmitEnumConstantDecl(const EnumConstantDecl &D); |
Chris Lattner | 03df122 | 2007-06-02 04:53:11 +0000 | [diff] [blame] | 187 | void EmitBlockVarDecl(const BlockVarDecl &D); |
| 188 | void EmitLocalBlockVarDecl(const BlockVarDecl &D); |
Chris Lattner | 53621a5 | 2007-06-13 20:44:40 +0000 | [diff] [blame] | 189 | void EmitParmDecl(const ParmVarDecl &D, llvm::Value *Arg); |
Chris Lattner | 03df122 | 2007-06-02 04:53:11 +0000 | [diff] [blame] | 190 | |
Chris Lattner | 84915fa | 2007-06-02 04:16:21 +0000 | [diff] [blame] | 191 | //===--------------------------------------------------------------------===// |
Chris Lattner | 308f431 | 2007-05-29 23:50:05 +0000 | [diff] [blame] | 192 | // Statement Emission |
| 193 | //===--------------------------------------------------------------------===// |
| 194 | |
| 195 | void EmitStmt(const Stmt *S); |
| 196 | void EmitCompoundStmt(const CompoundStmt &S); |
Chris Lattner | ac24820 | 2007-05-30 00:13:02 +0000 | [diff] [blame] | 197 | void EmitLabelStmt(const LabelStmt &S); |
| 198 | void EmitGotoStmt(const GotoStmt &S); |
Chris Lattner | 5269c03 | 2007-05-30 21:03:58 +0000 | [diff] [blame] | 199 | void EmitIfStmt(const IfStmt &S); |
Chris Lattner | 946aa31 | 2007-06-05 03:59:43 +0000 | [diff] [blame] | 200 | void EmitWhileStmt(const WhileStmt &S); |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 201 | void EmitDoStmt(const DoStmt &S); |
| 202 | void EmitForStmt(const ForStmt &S); |
Chris Lattner | 3f3dbee | 2007-06-02 03:19:07 +0000 | [diff] [blame] | 203 | void EmitReturnStmt(const ReturnStmt &S); |
Chris Lattner | 1ad38f8 | 2007-06-09 01:20:56 +0000 | [diff] [blame] | 204 | void EmitDeclStmt(const DeclStmt &S); |
| 205 | |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 206 | //===--------------------------------------------------------------------===// |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 207 | // LValue Expression Emission |
| 208 | //===--------------------------------------------------------------------===// |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 209 | |
| 210 | /// EmitLValue - Emit code to compute a designator that specifies the location |
| 211 | /// of the expression. |
| 212 | /// |
| 213 | /// This can return one of two things: a simple address or a bitfield |
| 214 | /// reference. In either case, the LLVM Value* in the LValue structure is |
| 215 | /// guaranteed to be an LLVM pointer type. |
| 216 | /// |
| 217 | /// If this returns a bitfield reference, nothing about the pointee type of |
| 218 | /// the LLVM value is known: For example, it may not be a pointer to an |
| 219 | /// integer. |
| 220 | /// |
| 221 | /// If this returns a normal address, and if the lvalue's C type is fixed |
| 222 | /// size, this method guarantees that the returned pointer type will point to |
| 223 | /// an LLVM type of the same size of the lvalue's type. If the lvalue has a |
| 224 | /// variable length type, this is not possible. |
| 225 | /// |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 226 | LValue EmitLValue(const Expr *E); |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 227 | |
| 228 | /// EmitLoadOfLValue - Given an expression that represents a value lvalue, |
| 229 | /// this method emits the address of the lvalue, then loads the result as an |
| 230 | /// rvalue, returning the rvalue. |
| 231 | RValue EmitLoadOfLValue(const Expr *E); |
| 232 | |
| 233 | /// EmitStoreThroughLValue - Store the specified rvalue into the specified |
| 234 | /// lvalue, where both are guaranteed to the have the same type, and that type |
| 235 | /// is 'Ty'. |
| 236 | void EmitStoreThroughLValue(RValue Src, LValue Dst, QualType Ty); |
| 237 | |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 238 | LValue EmitDeclRefLValue(const DeclRefExpr *E); |
Chris Lattner | 4347e369 | 2007-06-06 04:54:52 +0000 | [diff] [blame] | 239 | LValue EmitStringLiteralLValue(const StringLiteral *E); |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 240 | LValue EmitUnaryOpLValue(const UnaryOperator *E); |
Chris Lattner | d9d2fb1 | 2007-06-08 23:31:14 +0000 | [diff] [blame] | 241 | LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E); |
Chris Lattner | d7f5886 | 2007-06-02 05:24:33 +0000 | [diff] [blame] | 242 | |
| 243 | //===--------------------------------------------------------------------===// |
Chris Lattner | 208ae96 | 2007-05-30 17:57:17 +0000 | [diff] [blame] | 244 | // Expression Emission |
| 245 | //===--------------------------------------------------------------------===// |
| 246 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 247 | RValue EmitExprWithUsualUnaryConversions(const Expr *E, QualType &ResTy); |
Chris Lattner | cf25024 | 2007-06-03 02:02:44 +0000 | [diff] [blame] | 248 | QualType EmitUsualArithmeticConversions(const BinaryOperator *E, |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 249 | RValue &LHS, RValue &RHS); |
Chris Lattner | db91b16 | 2007-06-02 00:16:28 +0000 | [diff] [blame] | 250 | |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 251 | RValue EmitExpr(const Expr *E); |
| 252 | RValue EmitIntegerLiteral(const IntegerLiteral *E); |
| 253 | |
| 254 | RValue EmitCastExpr(const CastExpr *E); |
Chris Lattner | 2b228c9 | 2007-06-15 21:34:29 +0000 | [diff] [blame^] | 255 | RValue EmitCallExpr(const CallExpr *E); |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 256 | |
Chris Lattner | f0106d2 | 2007-06-02 19:33:17 +0000 | [diff] [blame] | 257 | // Unary Operators. |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 258 | RValue EmitUnaryOperator(const UnaryOperator *E); |
| 259 | // FIXME: pre/post inc/dec |
| 260 | RValue EmitUnaryAddrOf (const UnaryOperator *E); |
| 261 | RValue EmitUnaryPlus (const UnaryOperator *E); |
| 262 | RValue EmitUnaryMinus (const UnaryOperator *E); |
| 263 | RValue EmitUnaryNot (const UnaryOperator *E); |
| 264 | RValue EmitUnaryLNot (const UnaryOperator *E); |
| 265 | // FIXME: SIZEOF/ALIGNOF(expr). |
| 266 | // FIXME: real/imag |
Chris Lattner | f0106d2 | 2007-06-02 19:33:17 +0000 | [diff] [blame] | 267 | |
Chris Lattner | db91b16 | 2007-06-02 00:16:28 +0000 | [diff] [blame] | 268 | // Binary Operators. |
Chris Lattner | 8394d79 | 2007-06-05 20:53:16 +0000 | [diff] [blame] | 269 | RValue EmitBinaryOperator(const BinaryOperator *E); |
| 270 | RValue EmitBinaryMul(const BinaryOperator *E); |
| 271 | RValue EmitBinaryDiv(const BinaryOperator *E); |
| 272 | RValue EmitBinaryRem(const BinaryOperator *E); |
| 273 | RValue EmitBinaryAdd(const BinaryOperator *E); |
| 274 | RValue EmitBinarySub(const BinaryOperator *E); |
| 275 | RValue EmitBinaryShl(const BinaryOperator *E); |
| 276 | RValue EmitBinaryShr(const BinaryOperator *E); |
| 277 | |
| 278 | // FIXME: relational |
| 279 | |
| 280 | RValue EmitBinaryAnd(const BinaryOperator *E); |
| 281 | RValue EmitBinaryXor(const BinaryOperator *E); |
| 282 | RValue EmitBinaryOr (const BinaryOperator *E); |
| 283 | RValue EmitBinaryLAnd(const BinaryOperator *E); |
| 284 | RValue EmitBinaryLOr(const BinaryOperator *E); |
| 285 | |
| 286 | RValue EmitBinaryAssign(const BinaryOperator *E); |
| 287 | // FIXME: Assignment. |
| 288 | |
| 289 | RValue EmitBinaryComma(const BinaryOperator *E); |
Chris Lattner | bed3144 | 2007-05-28 01:07:47 +0000 | [diff] [blame] | 290 | }; |
| 291 | } // end namespace CodeGen |
| 292 | } // end namespace clang |
| 293 | } // end namespace llvm |
| 294 | |
| 295 | #endif |