llvm2alive: ignore a few harmless fn arg attributes
MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -643,6 +643,13 @@ public:
.getParamAttributes(arg.getArgNo());
for (auto &attr : attrs) {
switch (attr.getKindAsEnum()) {
+ case llvm::Attribute::ByVal:
+ case llvm::Attribute::InReg:
+ case llvm::Attribute::SExt:
+ case llvm::Attribute::ZExt:
+ // not important for IR verification
+ continue;
+
default:
*out << "ERROR: Unsupported attribute: " << attr.getAsString() << '\n';
return false;

MODIFY
tools/alive-tv.cpp
tools/alive-tv.cpp
@@ -103,6 +103,9 @@ static int cmpTypes(llvm::Type *TyL, llvm::Type *TyR,
llvm::PointerType *PTyL = llvm::dyn_cast<llvm::PointerType>(TyL);
llvm::PointerType *PTyR = llvm::dyn_cast<llvm::PointerType>(TyR);
+ if (FnL->getAttributes() != FnR->getAttributes())
+ return -1;
+
const llvm::DataLayout &DL = FnL->getParent()->getDataLayout();
if (PTyL && PTyL->getAddressSpace() == 0)
TyL = DL.getIntPtrType(TyL);

llvm2alive: ignore a few harmless fn arg attributes