blob: 37b242e29e488f7cb745f73d96555da9d5ea8f7b [file] [log] [blame]
Daniel Dunbar7bf5b3d2008-07-29 23:18:29 +00001//===-- CodeGenFunction.h - Per-Function state for LLVM CodeGen -*- C++ -*-===//
Chris Lattner4b009652007-07-25 00:24:17 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner959e5be2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner4b009652007-07-25 00:24:17 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This is the internal per-function state used for llvm translation.
11//
12//===----------------------------------------------------------------------===//
13
Chris Lattner2629b882008-02-29 17:10:38 +000014#ifndef CLANG_CODEGEN_CODEGENFUNCTION_H
15#define CLANG_CODEGEN_CODEGENFUNCTION_H
Chris Lattner4b009652007-07-25 00:24:17 +000016
Chris Lattnerb326b172008-03-30 23:03:07 +000017#include "clang/AST/Type.h"
Chris Lattner4b009652007-07-25 00:24:17 +000018#include "llvm/ADT/DenseMap.h"
19#include "llvm/ADT/SmallVector.h"
Chris Lattner676bf212008-04-13 07:32:11 +000020#include "llvm/Support/IRBuilder.h"
Ted Kremenek2719e982008-06-17 02:43:46 +000021#include "clang/AST/Expr.h"
22#include "clang/AST/ExprObjC.h"
23
Chris Lattner4b009652007-07-25 00:24:17 +000024#include <vector>
Daniel Dunbar879788d2008-08-04 16:51:22 +000025#include <map>
Chris Lattner4b009652007-07-25 00:24:17 +000026
Daniel Dunbara04840b2008-08-23 03:46:30 +000027#include "CGValue.h"
28
Chris Lattner4b009652007-07-25 00:24:17 +000029namespace llvm {
Daniel Dunbar64789f82008-08-11 05:35:13 +000030 class BasicBlock;
Chris Lattner4b009652007-07-25 00:24:17 +000031 class Module;
32}
33
34namespace clang {
35 class ASTContext;
36 class Decl;
Daniel Dunbar64789f82008-08-11 05:35:13 +000037 class EnumConstantDecl;
Chris Lattner4b009652007-07-25 00:24:17 +000038 class FunctionDecl;
Daniel Dunbar64789f82008-08-11 05:35:13 +000039 class FunctionTypeProto;
40 class LabelStmt;
Chris Lattnerb326b172008-03-30 23:03:07 +000041 class ObjCMethodDecl;
Chris Lattner4b009652007-07-25 00:24:17 +000042 class TargetInfo;
Daniel Dunbar64789f82008-08-11 05:35:13 +000043 class VarDecl;
Devang Patelaebd83f2007-10-23 02:10:49 +000044
Chris Lattner4b009652007-07-25 00:24:17 +000045namespace CodeGen {
46 class CodeGenModule;
Devang Patelaebd83f2007-10-23 02:10:49 +000047 class CodeGenTypes;
Devang Patel7a78e432007-11-01 19:11:01 +000048 class CGRecordLayout;
Chris Lattner4b009652007-07-25 00:24:17 +000049
Chris Lattner4b009652007-07-25 00:24:17 +000050/// CodeGenFunction - This class organizes the per-function state that is used
51/// while generating LLVM code.
52class CodeGenFunction {
Chris Lattner41b1fca2007-08-26 23:13:56 +000053public:
Chris Lattner4b009652007-07-25 00:24:17 +000054 CodeGenModule &CGM; // Per-module state.
55 TargetInfo &Target;
Chris Lattner41b1fca2007-08-26 23:13:56 +000056
Chris Lattner5280c5f2007-08-21 16:57:55 +000057 typedef std::pair<llvm::Value *, llvm::Value *> ComplexPairTy;
Chris Lattnerfaf23db2008-08-08 19:57:58 +000058 llvm::IRBuilder<> Builder;
Chris Lattner4b009652007-07-25 00:24:17 +000059
Chris Lattner6e6a5972008-04-04 04:07:35 +000060 // Holds the Decl for the current function or method
Chris Lattner8c7c6a12008-06-17 18:05:57 +000061 const Decl *CurFuncDecl;
Chris Lattnerb326b172008-03-30 23:03:07 +000062 QualType FnRetTy;
Chris Lattner4b009652007-07-25 00:24:17 +000063 llvm::Function *CurFn;
64
65 /// AllocaInsertPoint - This is an instruction in the entry block before which
66 /// we prefer to insert allocas.
67 llvm::Instruction *AllocaInsertPt;
Daniel Dunbar879788d2008-08-04 16:51:22 +000068
Chris Lattner4b009652007-07-25 00:24:17 +000069 const llvm::Type *LLVMIntTy;
Hartmut Kaiserff08d2c2007-10-17 15:00:17 +000070 uint32_t LLVMPointerWidth;
Chris Lattner4b009652007-07-25 00:24:17 +000071
Chris Lattner9fba49a2007-08-24 05:35:26 +000072private:
Daniel Dunbar879788d2008-08-04 16:51:22 +000073 /// LabelIDs - Track arbitrary ids assigned to labels for use in
74 /// implementing the GCC address-of-label extension and indirect
75 /// goto. IDs are assigned to labels inside getIDForAddrOfLabel().
76 std::map<const LabelStmt*, unsigned> LabelIDs;
77
78 /// IndirectSwitches - Record the list of switches for indirect
79 /// gotos. Emission of the actual switching code needs to be delayed
80 /// until all AddrLabelExprs have been seen.
81 std::vector<llvm::SwitchInst*> IndirectSwitches;
82
Chris Lattner4b009652007-07-25 00:24:17 +000083 /// LocalDeclMap - This keeps track of the LLVM allocas or globals for local C
84 /// decls.
85 llvm::DenseMap<const Decl*, llvm::Value*> LocalDeclMap;
86
87 /// LabelMap - This keeps track of the LLVM basic block for each C label.
88 llvm::DenseMap<const LabelStmt*, llvm::BasicBlock*> LabelMap;
89
90 // BreakContinueStack - This keeps track of where break and continue
91 // statements should jump to.
92 struct BreakContinue {
93 BreakContinue(llvm::BasicBlock *bb, llvm::BasicBlock *cb)
94 : BreakBlock(bb), ContinueBlock(cb) {}
95
96 llvm::BasicBlock *BreakBlock;
97 llvm::BasicBlock *ContinueBlock;
98 };
99 llvm::SmallVector<BreakContinue, 8> BreakContinueStack;
100
Devang Patelbc372382007-10-09 17:08:50 +0000101 /// SwitchInsn - This is nearest current switch instruction. It is null if
102 /// if current context is not in a switch.
Devang Patele58e0802007-10-04 23:45:31 +0000103 llvm::SwitchInst *SwitchInsn;
104
Devang Patelbc372382007-10-09 17:08:50 +0000105 /// CaseRangeBlock - This block holds if condition check for last case
106 /// statement range in current switch instruction.
Devang Patel347ca322007-10-08 20:57:48 +0000107 llvm::BasicBlock *CaseRangeBlock;
108
Chris Lattner4b009652007-07-25 00:24:17 +0000109public:
110 CodeGenFunction(CodeGenModule &cgm);
111
112 ASTContext &getContext() const;
113
Chris Lattnerb326b172008-03-30 23:03:07 +0000114 void GenerateObjCMethod(const ObjCMethodDecl *OMD);
Daniel Dunbar7bf5b3d2008-07-29 23:18:29 +0000115 void GenerateCode(const FunctionDecl *FD,
116 llvm::Function *Fn);
Chris Lattner8c7c6a12008-06-17 18:05:57 +0000117 void GenerateFunction(const Stmt *Body);
Chris Lattner4b009652007-07-25 00:24:17 +0000118
119 const llvm::Type *ConvertType(QualType T);
Chris Lattner6e6a5972008-04-04 04:07:35 +0000120
Daniel Dunbarace33292008-08-16 03:19:19 +0000121 /// LoadObjCSelf - Load the value of self. This function is only
122 /// valid while generating code for an Objective-C method.
Chris Lattner6e6a5972008-04-04 04:07:35 +0000123 llvm::Value *LoadObjCSelf();
Chris Lattner8c7c6a12008-06-17 18:05:57 +0000124
125 /// isObjCPointerType - Return true if the specificed AST type will map onto
126 /// some Objective-C pointer type.
127 static bool isObjCPointerType(QualType T);
128
Chris Lattner4b009652007-07-25 00:24:17 +0000129 /// hasAggregateLLVMType - Return true if the specified AST type will map into
130 /// an aggregate LLVM type or is void.
131 static bool hasAggregateLLVMType(QualType T);
132
133 /// getBasicBlockForLabel - Return the LLVM basicblock that the specified
134 /// label maps to.
135 llvm::BasicBlock *getBasicBlockForLabel(const LabelStmt *S);
136
137
138 void EmitBlock(llvm::BasicBlock *BB);
Chris Lattner9d4e6202007-12-02 01:43:38 +0000139
Daniel Dunbar9503b782008-08-16 00:56:44 +0000140 /// ErrorUnsupported - Print out an error that codegen doesn't support the
Chris Lattner9d4e6202007-12-02 01:43:38 +0000141 /// specified stmt yet.
Daniel Dunbar9503b782008-08-16 00:56:44 +0000142 void ErrorUnsupported(const Stmt *S, const char *Type);
Chris Lattner4b009652007-07-25 00:24:17 +0000143
144 //===--------------------------------------------------------------------===//
145 // Helpers
146 //===--------------------------------------------------------------------===//
147
148 /// CreateTempAlloca - This creates a alloca and inserts it into the entry
149 /// block.
150 llvm::AllocaInst *CreateTempAlloca(const llvm::Type *Ty,
151 const char *Name = "tmp");
152
153 /// EvaluateExprAsBool - Perform the usual unary conversions on the specified
154 /// expression and compare the result against zero, returning an Int1Ty value.
155 llvm::Value *EvaluateExprAsBool(const Expr *E);
156
Chris Lattnere24c4cf2007-08-31 22:49:20 +0000157 /// EmitAnyExpr - Emit code to compute the specified expression which can have
158 /// any type. The result is returned as an RValue struct. If this is an
159 /// aggregate expression, the aggloc/agglocvolatile arguments indicate where
160 /// the result should be returned.
161 RValue EmitAnyExpr(const Expr *E, llvm::Value *AggLoc = 0,
162 bool isAggLocVolatile = false);
Devang Patel97299362007-09-28 21:49:18 +0000163
164 /// isDummyBlock - Return true if BB is an empty basic block
165 /// with no predecessors.
166 static bool isDummyBlock(const llvm::BasicBlock *BB);
167
Devang Patele58e0802007-10-04 23:45:31 +0000168 /// StartBlock - Start new block named N. If insert block is a dummy block
169 /// then reuse it.
170 void StartBlock(const char *N);
171
Devang Patel7a78e432007-11-01 19:11:01 +0000172 /// getCGRecordLayout - Return record layout info.
173 const CGRecordLayout *getCGRecordLayout(CodeGenTypes &CGT, QualType RTy);
Lauro Ramos Venancio934fb022008-02-26 21:41:45 +0000174
175 /// GetAddrOfStaticLocalVar - Return the address of a static local variable.
Steve Naroff72a6ebc2008-04-15 22:42:06 +0000176 llvm::Constant *GetAddrOfStaticLocalVar(const VarDecl *BVD);
Dan Gohman4751a3a2008-05-22 00:50:06 +0000177
178 /// getAccessedFieldNo - Given an encoded value and a result number, return
179 /// the input field number being accessed.
180 static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts);
181
Daniel Dunbar879788d2008-08-04 16:51:22 +0000182 unsigned GetIDForAddrOfLabel(const LabelStmt *L);
183
Chris Lattner4b009652007-07-25 00:24:17 +0000184 //===--------------------------------------------------------------------===//
Chris Lattner4b009652007-07-25 00:24:17 +0000185 // Declaration Emission
186 //===--------------------------------------------------------------------===//
187
188 void EmitDecl(const Decl &D);
189 void EmitEnumConstantDecl(const EnumConstantDecl &D);
Steve Naroff72a6ebc2008-04-15 22:42:06 +0000190 void EmitBlockVarDecl(const VarDecl &D);
191 void EmitLocalBlockVarDecl(const VarDecl &D);
192 void EmitStaticBlockVarDecl(const VarDecl &D);
Daniel Dunbarace33292008-08-16 03:19:19 +0000193
194 /// EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
195 void EmitParmDecl(const VarDecl &D, llvm::Value *Arg);
Chris Lattner4b009652007-07-25 00:24:17 +0000196
197 //===--------------------------------------------------------------------===//
198 // Statement Emission
199 //===--------------------------------------------------------------------===//
200
201 void EmitStmt(const Stmt *S);
Chris Lattnere24c4cf2007-08-31 22:49:20 +0000202 RValue EmitCompoundStmt(const CompoundStmt &S, bool GetLast = false,
203 llvm::Value *AggLoc = 0, bool isAggVol = false);
Chris Lattner09cee852008-07-26 20:23:23 +0000204 void EmitLabel(const LabelStmt &S); // helper for EmitLabelStmt.
Chris Lattner4b009652007-07-25 00:24:17 +0000205 void EmitLabelStmt(const LabelStmt &S);
206 void EmitGotoStmt(const GotoStmt &S);
Daniel Dunbar879788d2008-08-04 16:51:22 +0000207 void EmitIndirectGotoStmt(const IndirectGotoStmt &S);
Chris Lattner4b009652007-07-25 00:24:17 +0000208 void EmitIfStmt(const IfStmt &S);
209 void EmitWhileStmt(const WhileStmt &S);
210 void EmitDoStmt(const DoStmt &S);
211 void EmitForStmt(const ForStmt &S);
212 void EmitReturnStmt(const ReturnStmt &S);
213 void EmitDeclStmt(const DeclStmt &S);
214 void EmitBreakStmt();
215 void EmitContinueStmt();
Devang Patele58e0802007-10-04 23:45:31 +0000216 void EmitSwitchStmt(const SwitchStmt &S);
217 void EmitDefaultStmt(const DefaultStmt &S);
218 void EmitCaseStmt(const CaseStmt &S);
Devang Patel347ca322007-10-08 20:57:48 +0000219 void EmitCaseStmtRange(const CaseStmt &S);
Anders Carlssonaf6a6c22008-02-05 16:35:33 +0000220 void EmitAsmStmt(const AsmStmt &S);
221
Chris Lattner4b009652007-07-25 00:24:17 +0000222 //===--------------------------------------------------------------------===//
223 // LValue Expression Emission
224 //===--------------------------------------------------------------------===//
225
226 /// EmitLValue - Emit code to compute a designator that specifies the location
227 /// of the expression.
228 ///
229 /// This can return one of two things: a simple address or a bitfield
230 /// reference. In either case, the LLVM Value* in the LValue structure is
231 /// guaranteed to be an LLVM pointer type.
232 ///
233 /// If this returns a bitfield reference, nothing about the pointee type of
234 /// the LLVM value is known: For example, it may not be a pointer to an
235 /// integer.
236 ///
237 /// If this returns a normal address, and if the lvalue's C type is fixed
238 /// size, this method guarantees that the returned pointer type will point to
239 /// an LLVM type of the same size of the lvalue's type. If the lvalue has a
240 /// variable length type, this is not possible.
241 ///
242 LValue EmitLValue(const Expr *E);
243
244 /// EmitLoadOfLValue - Given an expression that represents a value lvalue,
245 /// this method emits the address of the lvalue, then loads the result as an
246 /// rvalue, returning the rvalue.
Chris Lattner4b009652007-07-25 00:24:17 +0000247 RValue EmitLoadOfLValue(LValue V, QualType LVType);
Nate Begemanaf6ed502008-04-18 23:10:10 +0000248 RValue EmitLoadOfExtVectorElementLValue(LValue V, QualType LVType);
Lauro Ramos Venanciob40307c2008-01-22 20:17:04 +0000249 RValue EmitLoadOfBitfieldLValue(LValue LV, QualType ExprType);
Chris Lattner4b009652007-07-25 00:24:17 +0000250
Chris Lattner944f7962007-08-03 16:18:34 +0000251
Chris Lattner4b009652007-07-25 00:24:17 +0000252 /// EmitStoreThroughLValue - Store the specified rvalue into the specified
253 /// lvalue, where both are guaranteed to the have the same type, and that type
254 /// is 'Ty'.
255 void EmitStoreThroughLValue(RValue Src, LValue Dst, QualType Ty);
Nate Begemanaf6ed502008-04-18 23:10:10 +0000256 void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst,
257 QualType Ty);
Lauro Ramos Venancio2d7a34c2008-01-22 22:36:45 +0000258 void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, QualType Ty);
Christopher Lambad327ba2007-12-29 05:02:41 +0000259
260 // Note: only availabe for agg return types
261 LValue EmitCallExprLValue(const CallExpr *E);
Chris Lattner4b009652007-07-25 00:24:17 +0000262
263 LValue EmitDeclRefLValue(const DeclRefExpr *E);
264 LValue EmitStringLiteralLValue(const StringLiteral *E);
Chris Lattner69909292008-08-10 01:53:14 +0000265 LValue EmitPredefinedLValue(const PredefinedExpr *E);
Chris Lattner4b009652007-07-25 00:24:17 +0000266 LValue EmitUnaryOpLValue(const UnaryOperator *E);
267 LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E);
Nate Begemanaf6ed502008-04-18 23:10:10 +0000268 LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E);
Devang Patelaebd83f2007-10-23 02:10:49 +0000269 LValue EmitMemberExpr(const MemberExpr *E);
Eli Friedmanf3c2cb42008-05-13 23:18:27 +0000270 LValue EmitCompoundLiteralLValue(const CompoundLiteralExpr *E);
Eli Friedmand3550112008-02-09 08:50:58 +0000271
272 LValue EmitLValueForField(llvm::Value* Base, FieldDecl* Field,
Eli Friedman2e630542008-06-13 23:01:12 +0000273 bool isUnion, unsigned CVRQualifiers);
Chris Lattnerb326b172008-03-30 23:03:07 +0000274
275 LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E);
Chris Lattner4b009652007-07-25 00:24:17 +0000276 //===--------------------------------------------------------------------===//
Chris Lattnerbdb8ffb2007-08-11 00:04:45 +0000277 // Scalar Expression Emission
Chris Lattner4b009652007-07-25 00:24:17 +0000278 //===--------------------------------------------------------------------===//
279
Chris Lattner4b009652007-07-25 00:24:17 +0000280 RValue EmitCallExpr(const CallExpr *E);
Ted Kremenek2719e982008-06-17 02:43:46 +0000281
282 RValue EmitCallExpr(Expr *FnExpr, CallExpr::const_arg_iterator ArgBeg,
283 CallExpr::const_arg_iterator ArgEnd);
284
Eli Friedman261f4ad2008-01-30 01:32:06 +0000285 RValue EmitCallExpr(llvm::Value *Callee, QualType FnType,
Ted Kremenek2719e982008-06-17 02:43:46 +0000286 CallExpr::const_arg_iterator ArgBeg,
287 CallExpr::const_arg_iterator ArgEnd);
288
Daniel Dunbara04840b2008-08-23 03:46:30 +0000289 RValue EmitCallExprExt(llvm::Value *Callee,
290 QualType ResultType,
291 CallExpr::const_arg_iterator ArgBeg,
292 CallExpr::const_arg_iterator ArgEnd,
293 llvm::Value **ExtraArgs,
294 unsigned NumExtraArgs);
295
Chris Lattner35055b82007-08-26 22:58:05 +0000296 RValue EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
Chris Lattner4b009652007-07-25 00:24:17 +0000297
Anders Carlssone1449c12007-12-09 23:17:02 +0000298 llvm::Value *EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E);
299 llvm::Value *EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
300
Anders Carlssona9234fe2007-12-10 19:35:18 +0000301 llvm::Value *EmitShuffleVector(llvm::Value* V1, llvm::Value *V2, ...);
Nate Begemanec2d1062007-12-30 02:59:45 +0000302 llvm::Value *EmitVector(llvm::Value * const *Vals, unsigned NumVals,
303 bool isSplat = false);
Anders Carlsson68b8be92007-12-15 21:23:30 +0000304
Daniel Dunbarf1f7f192008-08-20 00:28:19 +0000305 llvm::Value *EmitObjCProtocolExpr(const ObjCProtocolExpr *E);
Chris Lattner9fba49a2007-08-24 05:35:26 +0000306 llvm::Value *EmitObjCStringLiteral(const ObjCStringLiteral *E);
Chris Lattner6ee20e32008-06-24 17:04:18 +0000307 llvm::Value *EmitObjCSelectorExpr(const ObjCSelectorExpr *E);
Daniel Dunbara04840b2008-08-23 03:46:30 +0000308 RValue EmitObjCMessageExpr(const ObjCMessageExpr *E);
Chris Lattner6ee20e32008-06-24 17:04:18 +0000309
310
Chris Lattnerbdb8ffb2007-08-11 00:04:45 +0000311 //===--------------------------------------------------------------------===//
Chris Lattner41b1fca2007-08-26 23:13:56 +0000312 // Expression Emission
Chris Lattnerbdb8ffb2007-08-11 00:04:45 +0000313 //===--------------------------------------------------------------------===//
Chris Lattner41b1fca2007-08-26 23:13:56 +0000314
315 // Expressions are broken into three classes: scalar, complex, aggregate.
Chris Lattnerbdb8ffb2007-08-11 00:04:45 +0000316
Chris Lattner9fba49a2007-08-24 05:35:26 +0000317 /// EmitScalarExpr - Emit the computation of the specified expression of
318 /// LLVM scalar type, returning the result.
319 llvm::Value *EmitScalarExpr(const Expr *E);
320
Chris Lattner4e05d1e2007-08-26 06:48:56 +0000321 /// EmitScalarConversion - Emit a conversion from the specified type to the
322 /// specified destination type, both of which are LLVM scalar types.
323 llvm::Value *EmitScalarConversion(llvm::Value *Src, QualType SrcTy,
324 QualType DstTy);
325
Chris Lattnerfb182ee2007-08-26 16:34:22 +0000326 /// EmitComplexToScalarConversion - Emit a conversion from the specified
327 /// complex type to the specified destination type, where the destination
328 /// type is an LLVM scalar type.
329 llvm::Value *EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy,
330 QualType DstTy);
331
Chris Lattner4e05d1e2007-08-26 06:48:56 +0000332
Chris Lattnerbdb8ffb2007-08-11 00:04:45 +0000333 /// EmitAggExpr - Emit the computation of the specified expression of
334 /// aggregate type. The result is computed into DestPtr. Note that if
335 /// DestPtr is null, the value of the aggregate expression is not needed.
336 void EmitAggExpr(const Expr *E, llvm::Value *DestPtr, bool VolatileDest);
Chris Lattner8d0cc2f2007-08-21 05:54:00 +0000337
338 /// EmitComplexExpr - Emit the computation of the specified expression of
Chris Lattner348c8a22007-08-23 23:43:33 +0000339 /// complex type, returning the result.
Chris Lattner5280c5f2007-08-21 16:57:55 +0000340 ComplexPairTy EmitComplexExpr(const Expr *E);
Chris Lattner348c8a22007-08-23 23:43:33 +0000341
342 /// EmitComplexExprIntoAddr - Emit the computation of the specified expression
343 /// of complex type, storing into the specified Value*.
Chris Lattner8e1f6e02007-08-26 16:22:13 +0000344 void EmitComplexExprIntoAddr(const Expr *E, llvm::Value *DestAddr,
345 bool DestIsVolatile);
Chris Lattnere24c4cf2007-08-31 22:49:20 +0000346 /// LoadComplexFromAddr - Load a complex number from the specified address.
347 ComplexPairTy LoadComplexFromAddr(llvm::Value *SrcAddr, bool SrcIsVolatile);
Chris Lattner85970f32008-05-08 05:58:21 +0000348
349 /// GenerateStaticBlockVarDecl - return the the static
350 /// declaration of local variable.
351 llvm::GlobalValue *GenerateStaticBlockVarDecl(const VarDecl &D,
352 bool NoInit,
353 const char *Separator);
Daniel Dunbar879788d2008-08-04 16:51:22 +0000354
Anders Carlssonc9f8ccd2008-08-22 16:00:37 +0000355 // GenerateStaticBlockVarDecl - return the static declaration of
356 // a local variable. Performs initialization of the variable if necessary.
357 llvm::GlobalValue *GenerateStaticCXXBlockVarDecl(const VarDecl &D);
358
Daniel Dunbar879788d2008-08-04 16:51:22 +0000359 //===--------------------------------------------------------------------===//
360 // Internal Helpers
361 //===--------------------------------------------------------------------===//
362
363private:
364 /// EmitIndirectSwitches - Emit code for all of the switch
365 /// instructions in IndirectSwitches.
366 void EmitIndirectSwitches();
Chris Lattner4b009652007-07-25 00:24:17 +0000367};
368} // end namespace CodeGen
369} // end namespace clang
370
371#endif