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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/IR/CMakeLists.txt ('k') | lib/IR/Instructions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/IR/InlineAsm.cpp
diff --git a/lib/IR/InlineAsm.cpp b/lib/IR/InlineAsm.cpp
index 16d874f32fc39a76eb684d9a9cfe9e484822f05f..32a5ea8be2d9f15518d07be6046204f81ee7a5e2 100644
--- a/lib/IR/InlineAsm.cpp
+++ b/lib/IR/InlineAsm.cpp
@@ -287,3 +287,18 @@ bool InlineAsm::Verify(FunctionType *Ty, StringRef ConstStr) {
return true;
}
+// @LOCALMOD-START
+bool InlineAsm::isAsmMemory() const {
+ bool retVoid = getFunctionType()->getReturnType()->isVoidTy();
+ bool noArgs = getFunctionType()->getNumParams() == 0 &&
+ !getFunctionType()->isVarArg();
+ bool isEmptyAsm = AsmString.empty();
+ // Different triples will encode "touch everything" differently, e.g.:
+ // - le32-unknown-nacl has "~{memory}".
+ // - x86 "~{memory},~{dirflag},~{fpsr},~{flags}".
+ // The following code therefore only searches for memory.
+ bool touchesMemory = Constraints.find("~{memory}") != std::string::npos;
+
+ return retVoid && noArgs && hasSideEffects() && isEmptyAsm && touchesMemory;
+}
+// @LOCALMOD-END
« 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