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

Side by Side Diff: lib/IR/InlineAsm.cpp

Issue 22474008: Add the new @llvm.nacl.atomic.fence.all intrinsic (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.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/Analysis/NaCl/PNaClABIVerifyModule.cpp ('k') | lib/IR/NaClAtomicIntrinsics.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 //===-- InlineAsm.cpp - Implement the InlineAsm class ---------------------===// 1 //===-- InlineAsm.cpp - Implement the InlineAsm class ---------------------===//
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 file implements the InlineAsm class. 10 // This file implements the InlineAsm class.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 StructType *STy = dyn_cast<StructType>(Ty->getReturnType()); 286 StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
287 if (STy == 0 || STy->getNumElements() != NumOutputs) 287 if (STy == 0 || STy->getNumElements() != NumOutputs)
288 return false; 288 return false;
289 break; 289 break;
290 } 290 }
291 291
292 if (Ty->getNumParams() != NumInputs) return false; 292 if (Ty->getNumParams() != NumInputs) return false;
293 return true; 293 return true;
294 } 294 }
295 295
296 // @LOCALMOD-START
297 bool InlineAsm::isAsmMemory() const {
298 bool retVoid = getFunctionType()->getReturnType()->isVoidTy();
299 bool noArgs = getFunctionType()->getNumParams() == 0 &&
300 !getFunctionType()->isVarArg();
301 bool isEmptyAsm = AsmString.empty();
302 // Different triples will encode "touch everything" differently, e.g.:
303 // - le32-unknown-nacl has "~{memory}".
304 // - x86 "~{memory},~{dirflag},~{fpsr},~{flags}".
jvoung (off chromium) 2013/08/07 22:32:11 Does that mean that in the backend, we need to con
JF 2013/08/07 22:47:41 Kind of. It comes from Clang's TargetInfo getClobb
305 // The following code therefore only searches for memory.
306 bool touchesMemory = Constraints.find("~{memory}") != std::string::npos;
307
308 return retVoid && noArgs && hasSideEffects() && isEmptyAsm && touchesMemory;
309 }
310 // @LOCALMOD-END
OLDNEW
« no previous file with comments | « lib/Analysis/NaCl/PNaClABIVerifyModule.cpp ('k') | lib/IR/NaClAtomicIntrinsics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698