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

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

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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/IR/CMakeLists.txt ('k') | lib/IR/Instructions.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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 StructType *STy = dyn_cast<StructType>(Ty->getReturnType()); 280 StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
281 if (!STy || STy->getNumElements() != NumOutputs) 281 if (!STy || STy->getNumElements() != NumOutputs)
282 return false; 282 return false;
283 break; 283 break;
284 } 284 }
285 285
286 if (Ty->getNumParams() != NumInputs) return false; 286 if (Ty->getNumParams() != NumInputs) return false;
287 return true; 287 return true;
288 } 288 }
289 289
290 // @LOCALMOD-START
291 bool InlineAsm::isAsmMemory() const {
292 bool retVoid = getFunctionType()->getReturnType()->isVoidTy();
293 bool noArgs = getFunctionType()->getNumParams() == 0 &&
294 !getFunctionType()->isVarArg();
295 bool isEmptyAsm = AsmString.empty();
296 // Different triples will encode "touch everything" differently, e.g.:
297 // - le32-unknown-nacl has "~{memory}".
298 // - x86 "~{memory},~{dirflag},~{fpsr},~{flags}".
299 // The following code therefore only searches for memory.
300 bool touchesMemory = Constraints.find("~{memory}") != std::string::npos;
301
302 return retVoid && noArgs && hasSideEffects() && isEmptyAsm && touchesMemory;
303 }
304 // @LOCALMOD-END
OLDNEW
« no previous file with comments | « lib/IR/CMakeLists.txt ('k') | lib/IR/Instructions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698