From 881dba61e4e14d0d1a801049d0d08f23c9d5db94 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 28 Sep 2012 06:07:01 -0700 Subject: [PATCH] Fix build with LLVM top-of-tree --- func.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/func.cpp b/func.cpp index 6f23785c..8e072084 100644 --- a/func.cpp +++ b/func.cpp @@ -301,7 +301,13 @@ Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function, // on, all off, or mixed. If this is a simple function, then this // isn't worth the code bloat / overhead. bool checkMask = (type->isTask == true) || - ((function->hasFnAttr(llvm::Attribute::AlwaysInline) == false) && + ( +#if defined(LLVM_3_0) || defined(LLVM_3_1) + (function->hasFnAttr(llvm::Attribute::AlwaysInline) == false) +#else + (function->getFnAttributes().hasAlwaysInlineAttr() == false) +#endif + && costEstimate > CHECK_MASK_AT_FUNCTION_START_COST); checkMask &= (type->isUnmasked == false); checkMask &= (g->target.maskingIsFree == false);