LEFT | RIGHT |
1 //===--- CodeGenFunction.cpp - Emit LLVM Code from ASTs for a Function ----===// | 1 //===--- CodeGenFunction.cpp - Emit LLVM Code from ASTs for a Function ----===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This coordinates the per-function state used while generating code. | 10 // This coordinates the per-function state used while generating code. |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 llvm::Value* CodeGenFunction::EmitVAListRef(const Expr* E) { | 1080 llvm::Value* CodeGenFunction::EmitVAListRef(const Expr* E) { |
1081 if (getContext().getBuiltinVaListType()->isArrayType()) | 1081 if (getContext().getBuiltinVaListType()->isArrayType()) |
1082 return EmitScalarExpr(E); | 1082 return EmitScalarExpr(E); |
1083 return EmitLValue(E).getAddress(); | 1083 return EmitLValue(E).getAddress(); |
1084 } | 1084 } |
1085 | 1085 |
1086 void CodeGenFunction::EmitDeclRefExprDbgValue(const DeclRefExpr *E,· | 1086 void CodeGenFunction::EmitDeclRefExprDbgValue(const DeclRefExpr *E,· |
1087 llvm::Constant *Init) { | 1087 llvm::Constant *Init) { |
1088 assert (Init && "Invalid DeclRefExpr initializer!"); | 1088 assert (Init && "Invalid DeclRefExpr initializer!"); |
1089 if (CGDebugInfo *Dbg = getDebugInfo()) | 1089 if (CGDebugInfo *Dbg = getDebugInfo()) |
1090 if (CGM.getCodeGenOpts().DebugInfo > CodeGenOptions::DebugLineTablesOnly) | 1090 if (CGM.getCodeGenOpts().DebugInfo >= CodeGenOptions::LimitedDebugInfo) |
1091 Dbg->EmitGlobalVariable(E->getDecl(), Init); | 1091 Dbg->EmitGlobalVariable(E->getDecl(), Init); |
1092 } | 1092 } |
1093 | 1093 |
1094 CodeGenFunction::PeepholeProtection | 1094 CodeGenFunction::PeepholeProtection |
1095 CodeGenFunction::protectFromPeepholes(RValue rvalue) { | 1095 CodeGenFunction::protectFromPeepholes(RValue rvalue) { |
1096 // At the moment, the only aggressive peephole we do in IR gen | 1096 // At the moment, the only aggressive peephole we do in IR gen |
1097 // is trunc(zext) folding, but if we add more, we can easily | 1097 // is trunc(zext) folding, but if we add more, we can easily |
1098 // extend this protection. | 1098 // extend this protection. |
1099 | 1099 |
1100 if (!rvalue.isScalar()) return PeepholeProtection(); | 1100 if (!rvalue.isScalar()) return PeepholeProtection(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 // annotation on the first field of a struct and annotation on the struct | 1157 // annotation on the first field of a struct and annotation on the struct |
1158 // itself. | 1158 // itself. |
1159 if (VTy != CGM.Int8PtrTy) | 1159 if (VTy != CGM.Int8PtrTy) |
1160 V = Builder.Insert(new llvm::BitCastInst(V, CGM.Int8PtrTy)); | 1160 V = Builder.Insert(new llvm::BitCastInst(V, CGM.Int8PtrTy)); |
1161 V = EmitAnnotationCall(F, V, (*ai)->getAnnotation(), D->getLocation()); | 1161 V = EmitAnnotationCall(F, V, (*ai)->getAnnotation(), D->getLocation()); |
1162 V = Builder.CreateBitCast(V, VTy); | 1162 V = Builder.CreateBitCast(V, VTy); |
1163 } | 1163 } |
1164 | 1164 |
1165 return V; | 1165 return V; |
1166 } | 1166 } |
LEFT | RIGHT |