Add a thread-model knob for lowering atomics on baremetal & single threaded systems

http://reviews.llvm.org/D4984


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jonathan Roelofs
2014-08-21 14:35:47 +00:00
parent 0b994a70b0
commit 4c3be1aa0f
5 changed files with 146 additions and 3 deletions

View File

@ -54,6 +54,16 @@ RelocModel("relocation-model",
"Relocatable external references, non-relocatable code"),
clEnumValEnd));
cl::opt<ThreadModel::Model>
TMModel("thread-model",
cl::desc("Choose threading model"),
cl::init(ThreadModel::POSIX),
cl::values(clEnumValN(ThreadModel::POSIX, "posix",
"POSIX thread model"),
clEnumValN(ThreadModel::Single, "single",
"Single thread model"),
clEnumValEnd));
cl::opt<llvm::CodeModel::Model>
CMModel("code-model",
cl::desc("Choose code model"),
@ -245,6 +255,8 @@ static inline TargetOptions InitTargetOptionsFromCodeGenFlags() {
Options.MCOptions = InitMCTargetOptionsFromFlags();
Options.JTType = JTableType;
Options.ThreadModel = TMModel;
return Options;
}