OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |