Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.

No functional changes intended.

llvm-svn: 197652
This commit is contained in:
Aaron Ballman
2013-12-19 03:09:10 +00:00
parent dc265edb3b
commit c4327996ca
2 changed files with 14 additions and 18 deletions

View File

@@ -409,8 +409,7 @@ void CodeGenModule::setTLSMode(llvm::GlobalVariable *GV,
TLM = GetLLVMTLSModel(CodeGenOpts.getDefaultTLSModel());
// Override the TLS model if it is explicitly specified.
if (D.hasAttr<TLSModelAttr>()) {
const TLSModelAttr *Attr = D.getAttr<TLSModelAttr>();
if (const TLSModelAttr *Attr = D.getAttr<TLSModelAttr>()) {
TLM = GetLLVMTLSModel(Attr->getModel());
}