summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Target/LLVMIR/ModuleTranslation.cpp')
-rw-r--r--mlir/lib/Target/LLVMIR/ModuleTranslation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 58bbc9c873b..8a9c649feb3 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -339,10 +339,12 @@ bool ModuleTranslation::convertOneFunction(Function &func) {
// NB: Attribute already verified to be boolean, so check if we can indeed
// attach the attribute to this argument, based on its type.
auto argTy = mlirArg->getType().dyn_cast<LLVM::LLVMType>();
- if (!argTy.getUnderlyingType()->isPointerTy())
- return argTy.getContext()->emitError(
+ if (!argTy.getUnderlyingType()->isPointerTy()) {
+ argTy.getContext()->emitError(
func.getLoc(),
"llvm.noalias attribute attached to LLVM non-pointer argument");
+ return true;
+ }
if (attr.getValue())
llvmArg.addAttr(llvm::Attribute::AttrKind::NoAlias);
}
OpenPOWER on IntegriCloud