Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: lib/CodeGen/TargetInfo.h

Issue 22294002: Treat __sync_synchronize and asm("":::"memory") as stronger fences. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-clang.git@master
Patch Set: Make isAsmMemory a member of InlineAsm as suggested by eliben. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/CodeGen/CGStmt.cpp ('k') | lib/CodeGen/TargetInfo.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===---- TargetInfo.h - Encapsulate target details -------------*- C++ -*-===// 1 //===---- TargetInfo.h - Encapsulate target details -------------*- C++ -*-===//
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 // These classes wrap the information about a call or function 10 // These classes wrap the information about a call or function
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 /// will lead to C99 violations. 164 /// will lead to C99 violations.
165 /// 165 ///
166 /// However, some platforms make the conventions identical except 166 /// However, some platforms make the conventions identical except
167 /// for passing additional out-of-band information to a variadic 167 /// for passing additional out-of-band information to a variadic
168 /// function: for example, x86-64 passes the number of SSE 168 /// function: for example, x86-64 passes the number of SSE
169 /// arguments in %al. On these platforms, it is desireable to 169 /// arguments in %al. On these platforms, it is desireable to
170 /// call unprototyped functions using the variadic convention so 170 /// call unprototyped functions using the variadic convention so
171 /// that unprototyped calls to varargs functions still succeed. 171 /// that unprototyped calls to varargs functions still succeed.
172 virtual bool isNoProtoCallVariadic(const CodeGen::CallArgList &args, 172 virtual bool isNoProtoCallVariadic(const CodeGen::CallArgList &args,
173 const FunctionNoProtoType *fnType) const; 173 const FunctionNoProtoType *fnType) const;
174
175 // @LOCALMOD-START
176 /// Determine whether the sequentially consistent fence generated for
177 /// the legacy GCC-style ``__sync_synchronize()`` builtin should be
178 /// surrounded by empty assembly directives which touch all of
179 /// memory. This allows platforms which aim for portability to
180 /// isolate themselves from changes in sequentially consistent
181 /// fence's semantics, since its intent is to represent the
182 /// C11/C++11 memory model which only orders atomic memory accesses.
183 /// This won't guarantee that all accesses (e.g. those to
184 /// non-escaping objects) will not be reordered.
185 virtual bool addAsmMemoryAroundSyncSynchronize() const {
186 return false;
187 }
188
189 /// Determine whether a full sequentially consistent fence should be
190 /// emitted when ``asm("":::"memory")`` is encountered, treating it
191 /// like ``__sync_synchronize()``.
192 virtual bool asmMemoryIsFence() const {
193 return false;
194 }
195 // @LOCALMOD-END
174 }; 196 };
175 } 197 }
176 198
177 #endif // CLANG_CODEGEN_TARGETINFO_H 199 #endif // CLANG_CODEGEN_TARGETINFO_H
OLDNEW
« no previous file with comments | « lib/CodeGen/CGStmt.cpp ('k') | lib/CodeGen/TargetInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698