blob: 5ff8dd654efa1e749b2a2c91e245e1986e4eacb2 [file] [log] [blame]
Alexey Bataev9959db52014-05-06 10:08:46 +00001//===----- CGOpenMPRuntime.h - Interface to OpenMP Runtimes -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This provides a class for OpenMP runtime code generation.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramer2f5db8b2014-08-13 16:25:19 +000014#ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIME_H
15#define LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIME_H
Alexey Bataev9959db52014-05-06 10:08:46 +000016
Alexander Musmanc6388682014-12-15 07:07:06 +000017#include "clang/Basic/OpenMPKinds.h"
Chandler Carruth0d9593d2015-01-14 11:29:14 +000018#include "clang/Basic/SourceLocation.h"
Alexey Bataev9959db52014-05-06 10:08:46 +000019#include "llvm/ADT/DenseMap.h"
Alexey Bataev97720002014-11-11 04:05:39 +000020#include "llvm/ADT/DenseSet.h"
Alexey Bataev3a3bf0b2014-09-22 10:01:53 +000021#include "llvm/ADT/StringMap.h"
Alexey Bataev97720002014-11-11 04:05:39 +000022#include "llvm/IR/ValueHandle.h"
Alexey Bataev18095712014-10-10 12:19:54 +000023
24namespace llvm {
25class ArrayType;
26class Constant;
27class Function;
28class FunctionType;
Alexey Bataev97720002014-11-11 04:05:39 +000029class GlobalVariable;
Alexey Bataev18095712014-10-10 12:19:54 +000030class StructType;
31class Type;
32class Value;
33} // namespace llvm
Alexey Bataev9959db52014-05-06 10:08:46 +000034
Alexey Bataev9959db52014-05-06 10:08:46 +000035namespace clang {
Alexey Bataevcc37cc12014-11-20 04:34:54 +000036class Expr;
Alexey Bataev18095712014-10-10 12:19:54 +000037class OMPExecutableDirective;
38class VarDecl;
39
Alexey Bataev9959db52014-05-06 10:08:46 +000040namespace CodeGen {
41
Alexey Bataev18095712014-10-10 12:19:54 +000042class CodeGenFunction;
43class CodeGenModule;
Alexey Bataev9959db52014-05-06 10:08:46 +000044
45class CGOpenMPRuntime {
46public:
Alexey Bataev8f7c1b02014-12-05 04:09:23 +000047
48private:
49 enum OpenMPRTLFunction {
50 /// \brief Call to void __kmpc_fork_call(ident_t *loc, kmp_int32 argc,
51 /// kmpc_micro microtask, ...);
52 OMPRTL__kmpc_fork_call,
53 /// \brief Call to void *__kmpc_threadprivate_cached(ident_t *loc,
54 /// kmp_int32 global_tid, void *data, size_t size, void ***cache);
55 OMPRTL__kmpc_threadprivate_cached,
56 /// \brief Call to void __kmpc_threadprivate_register( ident_t *,
57 /// void *data, kmpc_ctor ctor, kmpc_cctor cctor, kmpc_dtor dtor);
58 OMPRTL__kmpc_threadprivate_register,
59 // Call to __kmpc_int32 kmpc_global_thread_num(ident_t *loc);
60 OMPRTL__kmpc_global_thread_num,
61 // Call to void __kmpc_critical(ident_t *loc, kmp_int32 global_tid,
62 // kmp_critical_name *crit);
63 OMPRTL__kmpc_critical,
64 // Call to void __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid,
65 // kmp_critical_name *crit);
66 OMPRTL__kmpc_end_critical,
67 // Call to kmp_int32 __kmpc_cancel_barrier(ident_t *loc, kmp_int32
68 // global_tid);
69 OMPRTL__kmpc_cancel_barrier,
Alexander Musmanc6388682014-12-15 07:07:06 +000070 // Calls for static scheduling 'omp for' loops.
71 OMPRTL__kmpc_for_static_init_4,
72 OMPRTL__kmpc_for_static_init_4u,
73 OMPRTL__kmpc_for_static_init_8,
74 OMPRTL__kmpc_for_static_init_8u,
75 OMPRTL__kmpc_for_static_fini,
Alexey Bataev8f7c1b02014-12-05 04:09:23 +000076 // Call to void __kmpc_serialized_parallel(ident_t *loc, kmp_int32
77 // global_tid);
78 OMPRTL__kmpc_serialized_parallel,
79 // Call to void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32
80 // global_tid);
81 OMPRTL__kmpc_end_serialized_parallel,
82 // Call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid,
83 // kmp_int32 num_threads);
84 OMPRTL__kmpc_push_num_threads,
85 // Call to void __kmpc_flush(ident_t *loc, ...);
86 OMPRTL__kmpc_flush,
87 // Call to kmp_int32 __kmpc_master(ident_t *, kmp_int32 global_tid);
88 OMPRTL__kmpc_master,
89 // Call to void __kmpc_end_master(ident_t *, kmp_int32 global_tid);
90 OMPRTL__kmpc_end_master,
Alexey Bataev9f797f32015-02-05 05:57:51 +000091 // Call to kmp_int32 __kmpc_omp_taskyield(ident_t *, kmp_int32 global_tid,
92 // int end_part);
93 OMPRTL__kmpc_omp_taskyield,
Alexey Bataev8f7c1b02014-12-05 04:09:23 +000094 };
95
Alexey Bataev9959db52014-05-06 10:08:46 +000096 /// \brief Values for bit flags used in the ident_t to describe the fields.
97 /// All enumeric elements are named and described in accordance with the code
98 /// from http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h
99 enum OpenMPLocationFlags {
100 /// \brief Use trampoline for internal microtask.
101 OMP_IDENT_IMD = 0x01,
102 /// \brief Use c-style ident structure.
103 OMP_IDENT_KMPC = 0x02,
104 /// \brief Atomic reduction option for kmpc_reduce.
105 OMP_ATOMIC_REDUCE = 0x10,
106 /// \brief Explicit 'barrier' directive.
107 OMP_IDENT_BARRIER_EXPL = 0x20,
108 /// \brief Implicit barrier in code.
109 OMP_IDENT_BARRIER_IMPL = 0x40,
110 /// \brief Implicit barrier in 'for' directive.
111 OMP_IDENT_BARRIER_IMPL_FOR = 0x40,
112 /// \brief Implicit barrier in 'sections' directive.
113 OMP_IDENT_BARRIER_IMPL_SECTIONS = 0xC0,
114 /// \brief Implicit barrier in 'single' directive.
115 OMP_IDENT_BARRIER_IMPL_SINGLE = 0x140
116 };
Alexey Bataev9959db52014-05-06 10:08:46 +0000117 CodeGenModule &CGM;
118 /// \brief Default const ident_t object used for initialization of all other
119 /// ident_t objects.
120 llvm::Constant *DefaultOpenMPPSource;
Alexey Bataev18095712014-10-10 12:19:54 +0000121 /// \brief Map of flags and corresponding default locations.
Alexey Bataev15007ba2014-05-07 06:18:01 +0000122 typedef llvm::DenseMap<unsigned, llvm::Value *> OpenMPDefaultLocMapTy;
123 OpenMPDefaultLocMapTy OpenMPDefaultLocMap;
Alexey Bataev9959db52014-05-06 10:08:46 +0000124 llvm::Value *GetOrCreateDefaultOpenMPLocation(OpenMPLocationFlags Flags);
125 /// \brief Describes ident structure that describes a source location.
126 /// All descriptions are taken from
127 /// http://llvm.org/svn/llvm-project/openmp/trunk/runtime/src/kmp.h
128 /// Original structure:
129 /// typedef struct ident {
130 /// kmp_int32 reserved_1; /**< might be used in Fortran;
131 /// see above */
132 /// kmp_int32 flags; /**< also f.flags; KMP_IDENT_xxx flags;
133 /// KMP_IDENT_KMPC identifies this union
134 /// member */
135 /// kmp_int32 reserved_2; /**< not really used in Fortran any more;
136 /// see above */
137 ///#if USE_ITT_BUILD
138 /// /* but currently used for storing
139 /// region-specific ITT */
140 /// /* contextual information. */
141 ///#endif /* USE_ITT_BUILD */
142 /// kmp_int32 reserved_3; /**< source[4] in Fortran, do not use for
143 /// C++ */
144 /// char const *psource; /**< String describing the source location.
145 /// The string is composed of semi-colon separated
146 // fields which describe the source file,
147 /// the function and a pair of line numbers that
148 /// delimit the construct.
149 /// */
150 /// } ident_t;
151 enum IdentFieldIndex {
152 /// \brief might be used in Fortran
153 IdentField_Reserved_1,
154 /// \brief OMP_IDENT_xxx flags; OMP_IDENT_KMPC identifies this union member.
155 IdentField_Flags,
156 /// \brief Not really used in Fortran any more
157 IdentField_Reserved_2,
158 /// \brief Source[4] in Fortran, do not use for C++
159 IdentField_Reserved_3,
160 /// \brief String describing the source location. The string is composed of
161 /// semi-colon separated fields which describe the source file, the function
162 /// and a pair of line numbers that delimit the construct.
163 IdentField_PSource
164 };
165 llvm::StructType *IdentTy;
Alexey Bataev18095712014-10-10 12:19:54 +0000166 /// \brief Map for SourceLocation and OpenMP runtime library debug locations.
Alexey Bataevf002aca2014-05-30 05:48:40 +0000167 typedef llvm::DenseMap<unsigned, llvm::Value *> OpenMPDebugLocMapTy;
168 OpenMPDebugLocMapTy OpenMPDebugLocMap;
Alexey Bataev9959db52014-05-06 10:08:46 +0000169 /// \brief The type for a microtask which gets passed to __kmpc_fork_call().
170 /// Original representation is:
171 /// typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);
172 llvm::FunctionType *Kmpc_MicroTy;
Alexey Bataev18095712014-10-10 12:19:54 +0000173 /// \brief Stores debug location and ThreadID for the function.
174 struct DebugLocThreadIdTy {
175 llvm::Value *DebugLoc;
176 llvm::Value *ThreadID;
177 };
178 /// \brief Map of local debug location, ThreadId and functions.
179 typedef llvm::DenseMap<llvm::Function *, DebugLocThreadIdTy>
180 OpenMPLocThreadIDMapTy;
181 OpenMPLocThreadIDMapTy OpenMPLocThreadIDMap;
Alexey Bataev3a3bf0b2014-09-22 10:01:53 +0000182 /// \brief Type kmp_critical_name, originally defined as typedef kmp_int32
183 /// kmp_critical_name[8];
184 llvm::ArrayType *KmpCriticalNameTy;
Alexey Bataev97720002014-11-11 04:05:39 +0000185 /// \brief An ordered map of auto-generated variables to their unique names.
186 /// It stores variables with the following names: 1) ".gomp_critical_user_" +
187 /// <critical_section_name> + ".var" for "omp critical" directives; 2)
188 /// <mangled_name_for_global_var> + ".cache." for cache for threadprivate
189 /// variables.
190 llvm::StringMap<llvm::AssertingVH<llvm::Constant>, llvm::BumpPtrAllocator>
191 InternalVars;
Alexey Bataev9959db52014-05-06 10:08:46 +0000192
Alexey Bataev9959db52014-05-06 10:08:46 +0000193 /// \brief Emits object of ident_t type with info for source location.
Alexey Bataev9959db52014-05-06 10:08:46 +0000194 /// \param Flags Flags for OpenMP location.
195 ///
196 llvm::Value *
197 EmitOpenMPUpdateLocation(CodeGenFunction &CGF, SourceLocation Loc,
198 OpenMPLocationFlags Flags = OMP_IDENT_KMPC);
199
Alexey Bataevd74d0602014-10-13 06:02:40 +0000200 /// \brief Returns pointer to ident_t type.
Alexey Bataev9959db52014-05-06 10:08:46 +0000201 llvm::Type *getIdentTyPointerTy();
202
Alexey Bataevd74d0602014-10-13 06:02:40 +0000203 /// \brief Returns pointer to kmpc_micro type.
Alexey Bataev9959db52014-05-06 10:08:46 +0000204 llvm::Type *getKmpc_MicroPointerTy();
205
206 /// \brief Returns specified OpenMP runtime function.
207 /// \param Function OpenMP runtime function.
208 /// \return Specified function.
209 llvm::Constant *CreateRuntimeFunction(OpenMPRTLFunction Function);
Alexey Bataev3a3bf0b2014-09-22 10:01:53 +0000210
Alexey Bataev97720002014-11-11 04:05:39 +0000211 /// \brief If the specified mangled name is not in the module, create and
212 /// return threadprivate cache object. This object is a pointer's worth of
213 /// storage that's reserved for use by the OpenMP runtime.
NAKAMURA Takumicdcbfba2014-11-11 07:58:06 +0000214 /// \param VD Threadprivate variable.
Alexey Bataev97720002014-11-11 04:05:39 +0000215 /// \return Cache variable for the specified threadprivate.
216 llvm::Constant *getOrCreateThreadPrivateCache(const VarDecl *VD);
217
Alexey Bataevd74d0602014-10-13 06:02:40 +0000218 /// \brief Emits address of the word in a memory where current thread id is
219 /// stored.
220 virtual llvm::Value *EmitThreadIDAddress(CodeGenFunction &CGF,
221 SourceLocation Loc);
222
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000223 /// \brief Gets thread id value for the current thread.
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000224 ///
225 llvm::Value *GetOpenMPThreadID(CodeGenFunction &CGF, SourceLocation Loc);
226
Alexey Bataev97720002014-11-11 04:05:39 +0000227 /// \brief Gets (if variable with the given name already exist) or creates
228 /// internal global variable with the specified Name. The created variable has
229 /// linkage CommonLinkage by default and is initialized by null value.
230 /// \param Ty Type of the global variable. If it is exist already the type
231 /// must be the same.
232 /// \param Name Name of the variable.
233 llvm::Constant *GetOrCreateInternalVariable(llvm::Type *Ty,
234 const llvm::Twine &Name);
235
236 /// \brief Set of threadprivate variables with the generated initializer.
237 llvm::DenseSet<const VarDecl *> ThreadPrivateWithDefinition;
238
239 /// \brief Emits initialization code for the threadprivate variables.
240 /// \param VDAddr Address of the global variable \a VD.
241 /// \param Ctor Pointer to a global init function for \a VD.
242 /// \param CopyCtor Pointer to a global copy function for \a VD.
243 /// \param Dtor Pointer to a global destructor function for \a VD.
244 /// \param Loc Location of threadprivate declaration.
245 void EmitOMPThreadPrivateVarInit(CodeGenFunction &CGF, llvm::Value *VDAddr,
246 llvm::Value *Ctor, llvm::Value *CopyCtor,
247 llvm::Value *Dtor, SourceLocation Loc);
248
Alexey Bataev75ddfab2014-12-01 11:32:38 +0000249 /// \brief Returns corresponding lock object for the specified critical region
250 /// name. If the lock object does not exist it is created, otherwise the
251 /// reference to the existing copy is returned.
252 /// \param CriticalName Name of the critical region.
253 ///
254 llvm::Value *GetCriticalRegionLock(StringRef CriticalName);
255
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000256public:
257 explicit CGOpenMPRuntime(CodeGenModule &CGM);
258 virtual ~CGOpenMPRuntime() {}
259
Alexey Bataev18095712014-10-10 12:19:54 +0000260 /// \brief Emits outlined function for the specified OpenMP directive \a D
261 /// (required for parallel and task directives). This outlined function has
262 /// type void(*)(kmp_int32 /*ThreadID*/, kmp_int32 /*BoundID*/, struct
263 /// context_vars*).
264 /// \param D OpenMP directive.
265 /// \param ThreadIDVar Variable for thread id in the current OpenMP region.
266 ///
267 virtual llvm::Value *
268 EmitOpenMPOutlinedFunction(const OMPExecutableDirective &D,
269 const VarDecl *ThreadIDVar);
270
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000271 /// \brief Cleans up references to the objects in finished function.
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000272 ///
273 void FunctionFinished(CodeGenFunction &CGF);
274
275 /// \brief Emits code for parallel call of the \a OutlinedFn with variables
276 /// captured in a record which address is stored in \a CapturedStruct.
Alexey Bataev18095712014-10-10 12:19:54 +0000277 /// \param OutlinedFn Outlined function to be run in parallel threads. Type of
278 /// this function is void(*)(kmp_int32, kmp_int32, struct context_vars*).
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000279 /// \param CapturedStruct A pointer to the record with the references to
280 /// variables used in \a OutlinedFn function.
281 ///
282 virtual void EmitOMPParallelCall(CodeGenFunction &CGF, SourceLocation Loc,
283 llvm::Value *OutlinedFn,
284 llvm::Value *CapturedStruct);
285
Alexey Bataevd74d0602014-10-13 06:02:40 +0000286 /// \brief Emits code for serial call of the \a OutlinedFn with variables
287 /// captured in a record which address is stored in \a CapturedStruct.
288 /// \param OutlinedFn Outlined function to be run in serial mode.
289 /// \param CapturedStruct A pointer to the record with the references to
290 /// variables used in \a OutlinedFn function.
291 ///
292 virtual void EmitOMPSerialCall(CodeGenFunction &CGF, SourceLocation Loc,
293 llvm::Value *OutlinedFn,
294 llvm::Value *CapturedStruct);
295
Alexey Bataev75ddfab2014-12-01 11:32:38 +0000296 /// \brief Emits a critical region.
Alexey Bataev18095712014-10-10 12:19:54 +0000297 /// \param CriticalName Name of the critical region.
Alexey Bataev75ddfab2014-12-01 11:32:38 +0000298 /// \param CriticalOpGen Generator for the statement associated with the given
299 /// critical region.
300 virtual void EmitOMPCriticalRegion(CodeGenFunction &CGF,
301 StringRef CriticalName,
302 const std::function<void()> &CriticalOpGen,
303 SourceLocation Loc);
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000304
Alexey Bataev8d690652014-12-04 07:23:53 +0000305 /// \brief Emits a master region.
306 /// \param MasterOpGen Generator for the statement associated with the given
307 /// master region.
308 virtual void EmitOMPMasterRegion(CodeGenFunction &CGF,
309 const std::function<void()> &MasterOpGen,
310 SourceLocation Loc);
311
Alexey Bataev9f797f32015-02-05 05:57:51 +0000312 /// \brief Emits code for a taskyield directive.
313 virtual void EmitOMPTaskyieldCall(CodeGenFunction &CGF, SourceLocation Loc);
314
Alexey Bataev8f7c1b02014-12-05 04:09:23 +0000315 /// \brief Emits explicit barrier for OpenMP threads.
316 /// \param IsExplicit true, if it is explicitly specified barrier.
Alexey Bataev4a5bb772014-10-08 14:01:46 +0000317 ///
318 virtual void EmitOMPBarrierCall(CodeGenFunction &CGF, SourceLocation Loc,
Alexey Bataev8f7c1b02014-12-05 04:09:23 +0000319 bool IsExplicit = true);
Alexey Bataevb2059782014-10-13 08:23:51 +0000320
Alexander Musmanc6388682014-12-15 07:07:06 +0000321 /// \brief Check if the specified \a ScheduleKind is static non-chunked.
322 /// This kind of worksharing directive is emitted without outer loop.
323 /// \param ScheduleKind Schedule kind specified in the 'schedule' clause.
324 /// \param Chunked True if chunk is specified in the clause.
325 ///
326 virtual bool isStaticNonchunked(OpenMPScheduleClauseKind ScheduleKind,
327 bool Chunked) const;
328
Alexander Musmandf7a8e22015-01-22 08:49:35 +0000329 /// \brief Check if the specified \a ScheduleKind is dynamic.
330 /// This kind of worksharing directive is emitted without outer loop.
331 /// \param ScheduleKind Schedule Kind specified in the 'schedule' clause.
332 ///
333 virtual bool isDynamic(OpenMPScheduleClauseKind ScheduleKind) const;
334
Alexander Musmanc6388682014-12-15 07:07:06 +0000335 /// \brief Call the appropriate runtime routine to initialize it before start
336 /// of loop.
337 ///
338 /// Depending on the loop schedule, it is nesessary to call some runtime
339 /// routine before start of the OpenMP loop to get the loop upper / lower
340 /// bounds \a LB and \a UB and stride \a ST.
341 ///
342 /// \param CGF Reference to current CodeGenFunction.
343 /// \param Loc Clang source location.
NAKAMURA Takumieca08382014-12-17 14:47:06 +0000344 /// \param SchedKind Schedule kind, specified by the 'schedule' clause.
Alexander Musmanc6388682014-12-15 07:07:06 +0000345 /// \param IVSize Size of the iteration variable in bits.
346 /// \param IVSigned Sign of the interation variable.
347 /// \param IL Address of the output variable in which the flag of the
348 /// last iteration is returned.
349 /// \param LB Address of the output variable in which the lower iteration
350 /// number is returned.
351 /// \param UB Address of the output variable in which the upper iteration
352 /// number is returned.
353 /// \param ST Address of the output variable in which the stride value is
354 /// returned nesessary to generated the static_chunked scheduled loop.
355 /// \param Chunk Value of the chunk for the static_chunked scheduled loop.
356 /// For the default (nullptr) value, the chunk 1 will be used.
357 ///
358 virtual void EmitOMPForInit(CodeGenFunction &CGF, SourceLocation Loc,
359 OpenMPScheduleClauseKind SchedKind,
360 unsigned IVSize, bool IVSigned, llvm::Value *IL,
361 llvm::Value *LB, llvm::Value *UB, llvm::Value *ST,
362 llvm::Value *Chunk = nullptr);
363
364 /// \brief Call the appropriate runtime routine to notify that we finished
365 /// all the work with current loop.
366 ///
367 /// \param CGF Reference to current CodeGenFunction.
368 /// \param Loc Clang source location.
369 /// \param ScheduleKind Schedule kind, specified by the 'schedule' clause.
370 ///
371 virtual void EmitOMPForFinish(CodeGenFunction &CGF, SourceLocation Loc,
372 OpenMPScheduleClauseKind ScheduleKind);
373
Alexey Bataevb2059782014-10-13 08:23:51 +0000374 /// \brief Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
375 /// global_tid, kmp_int32 num_threads) to generate code for 'num_threads'
376 /// clause.
377 /// \param NumThreads An integer value of threads.
378 virtual void EmitOMPNumThreadsClause(CodeGenFunction &CGF,
379 llvm::Value *NumThreads,
380 SourceLocation Loc);
Alexey Bataev97720002014-11-11 04:05:39 +0000381
382 /// \brief Returns address of the threadprivate variable for the current
383 /// thread.
NAKAMURA Takumicdcbfba2014-11-11 07:58:06 +0000384 /// \param VD Threadprivate variable.
Alexey Bataev97720002014-11-11 04:05:39 +0000385 /// \param VDAddr Address of the global variable \a VD.
386 /// \param Loc Location of the reference to threadprivate var.
387 /// \return Address of the threadprivate variable for the current thread.
388 virtual llvm::Value *getOMPAddrOfThreadPrivate(CodeGenFunction &CGF,
389 const VarDecl *VD,
390 llvm::Value *VDAddr,
391 SourceLocation Loc);
392
393 /// \brief Emit a code for initialization of threadprivate variable. It emits
394 /// a call to runtime library which adds initial value to the newly created
395 /// threadprivate variable (if it is not constant) and registers destructor
396 /// for the variable (if any).
397 /// \param VD Threadprivate variable.
398 /// \param VDAddr Address of the global variable \a VD.
399 /// \param Loc Location of threadprivate declaration.
400 /// \param PerformInit true if initialization expression is not constant.
401 virtual llvm::Function *
402 EmitOMPThreadPrivateVarDefinition(const VarDecl *VD, llvm::Value *VDAddr,
403 SourceLocation Loc, bool PerformInit,
404 CodeGenFunction *CGF = nullptr);
Alexey Bataevcc37cc12014-11-20 04:34:54 +0000405
406 /// \brief Emit flush of the variables specified in 'omp flush' directive.
407 /// \param Vars List of variables to flush.
408 virtual void EmitOMPFlush(CodeGenFunction &CGF, ArrayRef<const Expr *> Vars,
409 SourceLocation Loc);
Alexey Bataev9959db52014-05-06 10:08:46 +0000410};
Alexey Bataev23b69422014-06-18 07:08:49 +0000411} // namespace CodeGen
412} // namespace clang
Alexey Bataev9959db52014-05-06 10:08:46 +0000413
414#endif