OSDN Git Service

[AVR] Compute code model if one is not provided
authorMeador Inge <meadori@codesourcery.com>
Sun, 6 Aug 2017 12:02:17 +0000 (12:02 +0000)
committerMeador Inge <meadori@codesourcery.com>
Sun, 6 Aug 2017 12:02:17 +0000 (12:02 +0000)
commit5d99b15d8dc3f5f9bca64bd6817a5f499a2207ce
tree4d917a055dfd66c86ac718b1122174960d82bbaf
parent1256b9b46d2a1b37387304dc1bb6bd5af373029a
[AVR] Compute code model if one is not provided

The patch from r310028 fixed things to work with the new
`LLVMTargetMachine` constructor that came in on r309911.
However, the fix was partial since an object of type
`CodeModel::Model` must be passed to `LLVMTargetMachine`
(not one of `Optional<CodeModel::Model>`).

This patch fixes the problem in the same fashion that r309911
did for other machines: by checking if the passed optional
code model has a value and using `CodeModel::Small` if not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310200 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AVR/AVRTargetMachine.cpp