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

Side by Side Diff: lib/Analysis/NaCl/PNaClABIVerifyFunctions.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: Add note suggested by jvoung. 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 | « include/llvm/Transforms/NaCl.h ('k') | lib/Analysis/NaCl/PNaClABIVerifyModule.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 //===- PNaClABIVerifyFunctions.cpp - Verify PNaCl ABI rules ---------------===// 1 //===- PNaClABIVerifyFunctions.cpp - Verify PNaCl ABI rules ---------------===//
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 // Verify function-level PNaCl ABI requirements. 10 // Verify function-level PNaCl ABI requirements.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 switch (Call->getIntrinsicID()) { 413 switch (Call->getIntrinsicID()) {
414 default: break; // Other intrinsics don't require checks. 414 default: break; // Other intrinsics don't require checks.
415 // Disallow NaCl atomic intrinsics which don't have valid 415 // Disallow NaCl atomic intrinsics which don't have valid
416 // constant NaCl::AtomicOperation and NaCl::MemoryOrder 416 // constant NaCl::AtomicOperation and NaCl::MemoryOrder
417 // parameters. 417 // parameters.
418 case Intrinsic::nacl_atomic_load: 418 case Intrinsic::nacl_atomic_load:
419 case Intrinsic::nacl_atomic_store: 419 case Intrinsic::nacl_atomic_store:
420 case Intrinsic::nacl_atomic_rmw: 420 case Intrinsic::nacl_atomic_rmw:
421 case Intrinsic::nacl_atomic_cmpxchg: 421 case Intrinsic::nacl_atomic_cmpxchg:
422 case Intrinsic::nacl_atomic_fence: { 422 case Intrinsic::nacl_atomic_fence:
423 case Intrinsic::nacl_atomic_fence_all: {
423 // All overloads have memory order and RMW operation in the 424 // All overloads have memory order and RMW operation in the
424 // same parameter, arbitrarily use the I32 overload. 425 // same parameter, arbitrarily use the I32 overload.
425 Type *T = Type::getInt32Ty( 426 Type *T = Type::getInt32Ty(
426 Inst->getParent()->getParent()->getContext()); 427 Inst->getParent()->getParent()->getContext());
427 const NaCl::AtomicIntrinsics::AtomicIntrinsic *I = 428 const NaCl::AtomicIntrinsics::AtomicIntrinsic *I =
428 AtomicIntrinsics->find(Call->getIntrinsicID(), T); 429 AtomicIntrinsics->find(Call->getIntrinsicID(), T);
429 if (!hasAllowedAtomicMemoryOrder(I, Call)) 430 if (!hasAllowedAtomicMemoryOrder(I, Call))
430 return "invalid memory order"; 431 return "invalid memory order";
431 if (!hasAllowedAtomicRMWOperation(I, Call)) 432 if (!hasAllowedAtomicRMWOperation(I, Call))
432 return "invalid atomicRMW operation"; 433 return "invalid atomicRMW operation";
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 562 }
562 563
563 char PNaClABIVerifyFunctions::ID = 0; 564 char PNaClABIVerifyFunctions::ID = 0;
564 INITIALIZE_PASS(PNaClABIVerifyFunctions, "verify-pnaclabi-functions", 565 INITIALIZE_PASS(PNaClABIVerifyFunctions, "verify-pnaclabi-functions",
565 "Verify functions for PNaCl", false, true) 566 "Verify functions for PNaCl", false, true)
566 567
567 FunctionPass *llvm::createPNaClABIVerifyFunctionsPass( 568 FunctionPass *llvm::createPNaClABIVerifyFunctionsPass(
568 PNaClABIErrorReporter *Reporter) { 569 PNaClABIErrorReporter *Reporter) {
569 return new PNaClABIVerifyFunctions(Reporter); 570 return new PNaClABIVerifyFunctions(Reporter);
570 } 571 }
OLDNEW
« no previous file with comments | « include/llvm/Transforms/NaCl.h ('k') | lib/Analysis/NaCl/PNaClABIVerifyModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698