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

Side by Side Diff: lib/Transforms/NaCl/RemoveAsmMemory.cpp

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 //===- RemoveAsmMemory.cpp - Remove ``asm("":::"memory")`` ----------------===// 1 //===- RemoveAsmMemory.cpp - Remove ``asm("":::"memory")`` ----------------===//
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 pass removes all instances of ``asm("":::"memory")``. 10 // This pass removes all instances of ``asm("":::"memory")``.
(...skipping 27 matching lines...) Expand all
38 AsmDirectivesVisitor() : ModifiedFunction(false) {} 38 AsmDirectivesVisitor() : ModifiedFunction(false) {}
39 ~AsmDirectivesVisitor() {} 39 ~AsmDirectivesVisitor() {}
40 bool modifiedFunction() const { return ModifiedFunction; } 40 bool modifiedFunction() const { return ModifiedFunction; }
41 41
42 /// Only Call Instructions are ever inline assembly directives. 42 /// Only Call Instructions are ever inline assembly directives.
43 void visitCallInst(CallInst &CI); 43 void visitCallInst(CallInst &CI);
44 44
45 private: 45 private:
46 bool ModifiedFunction; 46 bool ModifiedFunction;
47 47
48 AsmDirectivesVisitor(const AsmDirectivesVisitor &) LLVM_DELETED_FUNCTION; 48 AsmDirectivesVisitor(const AsmDirectivesVisitor &) = delete;
49 AsmDirectivesVisitor &operator=( 49 AsmDirectivesVisitor &operator=(const AsmDirectivesVisitor &) = delete;
50 const AsmDirectivesVisitor &) LLVM_DELETED_FUNCTION;
51 }; 50 };
52 } 51 }
53 52
54 char RemoveAsmMemory::ID = 0; 53 char RemoveAsmMemory::ID = 0;
55 INITIALIZE_PASS(RemoveAsmMemory, "remove-asm-memory", 54 INITIALIZE_PASS(RemoveAsmMemory, "remove-asm-memory",
56 "remove all instances of ``asm(\"\":::\"memory\")``", false, 55 "remove all instances of ``asm(\"\":::\"memory\")``", false,
57 false) 56 false)
58 57
59 bool RemoveAsmMemory::runOnFunction(Function &F) { 58 bool RemoveAsmMemory::runOnFunction(Function &F) {
60 AsmDirectivesVisitor AV; 59 AsmDirectivesVisitor AV;
(...skipping 10 matching lines...) Expand all
71 // sequentially consistent fence. Other passes rewrite this fence to 70 // sequentially consistent fence. Other passes rewrite this fence to
72 // an equivalent stable NaCl intrinsic, meaning that this assembly can 71 // an equivalent stable NaCl intrinsic, meaning that this assembly can
73 // be removed. 72 // be removed.
74 CI.eraseFromParent(); 73 CI.eraseFromParent();
75 ModifiedFunction = true; 74 ModifiedFunction = true;
76 } 75 }
77 76
78 namespace llvm { 77 namespace llvm {
79 FunctionPass *createRemoveAsmMemoryPass() { return new RemoveAsmMemory(); } 78 FunctionPass *createRemoveAsmMemoryPass() { return new RemoveAsmMemory(); }
80 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698