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

Side by Side Diff: lib/CodeGen/TargetInfo.cpp

Issue 22294002: Treat __sync_synchronize and asm("":::"memory") as stronger fences. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-clang.git@master
Patch Set: Make isAsmMemory a member of InlineAsm as suggested by eliben. 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 | « lib/CodeGen/TargetInfo.h ('k') | test/CodeGen/NaCl/atomics.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===---- TargetInfo.cpp - Encapsulate target details -----------*- C++ -*-===// 1 //===---- TargetInfo.cpp - Encapsulate target details -----------*- C++ -*-===//
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 // These classes wrap the information about a call or function 10 // These classes wrap the information about a call or function
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 }; 430 };
431 431
432 class PNaClTargetCodeGenInfo : public TargetCodeGenInfo { 432 class PNaClTargetCodeGenInfo : public TargetCodeGenInfo {
433 public: 433 public:
434 PNaClTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT) 434 PNaClTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT)
435 : TargetCodeGenInfo(new PNaClABIInfo(CGT)) {} 435 : TargetCodeGenInfo(new PNaClABIInfo(CGT)) {}
436 436
437 /// For PNaCl we don't want llvm.pow.* intrinsics to be emitted instead 437 /// For PNaCl we don't want llvm.pow.* intrinsics to be emitted instead
438 /// of library function calls. 438 /// of library function calls.
439 bool emitIntrinsicForPow() const { return false; } 439 bool emitIntrinsicForPow() const { return false; }
440 bool addAsmMemoryAroundSyncSynchronize() const { return true; } // @LOCALMOD
441 bool asmMemoryIsFence() const { return true; } // @LOCALMOD
440 }; 442 };
441 443
442 void PNaClABIInfo::computeInfo(CGFunctionInfo &FI) const { 444 void PNaClABIInfo::computeInfo(CGFunctionInfo &FI) const {
443 FI.getReturnInfo() = classifyReturnType(FI.getReturnType()); 445 FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
444 446
445 for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end(); 447 for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
446 it != ie; ++it) 448 it != ie; ++it)
447 it->info = classifyArgumentType(it->type); 449 it->info = classifyArgumentType(it->type);
448 } 450 }
449 451
(...skipping 4750 matching lines...) Expand 10 before | Expand all | Expand 10 after
5200 HasAVX)); 5202 HasAVX));
5201 default: 5203 default:
5202 return *(TheTargetCodeGenInfo = new X86_64TargetCodeGenInfo(Types, 5204 return *(TheTargetCodeGenInfo = new X86_64TargetCodeGenInfo(Types,
5203 HasAVX)); 5205 HasAVX));
5204 } 5206 }
5205 } 5207 }
5206 case llvm::Triple::hexagon: 5208 case llvm::Triple::hexagon:
5207 return *(TheTargetCodeGenInfo = new HexagonTargetCodeGenInfo(Types)); 5209 return *(TheTargetCodeGenInfo = new HexagonTargetCodeGenInfo(Types));
5208 } 5210 }
5209 } 5211 }
OLDNEW
« no previous file with comments | « lib/CodeGen/TargetInfo.h ('k') | test/CodeGen/NaCl/atomics.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698