Ignore:
Timestamp:
Feb 21, 2017, 2:22:21 PM (2 years ago)
Author:
nmedfort
Message:

Work on parenthesis matching and expandable buffers. Changed CBuilder CreateMemZero? to zero n bytes rather than n units to conform to the built-in CreateMemSet? and CreateMemCpy? methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r5320 r5337  
    263263}
    264264
    265 void CBuilder::CreateMemZero(Value * ptr, Value * size, const unsigned alignment) {
    266     DataLayout DL(getModule());
    267     IntegerType * const intTy = getIntPtrTy(DL);
    268     Constant * width = ConstantExpr::getSizeOf(ptr->getType()->getPointerElementType());
    269     if (LLVM_UNLIKELY(width->getType() != intTy)) {
    270         width = ConstantExpr::getIntegerCast(width, intTy, false);
    271     }
    272     if (size->getType() != intTy) {
    273         if (isa<Constant>(size)) {
    274             size = ConstantExpr::getIntegerCast(cast<Constant>(size), intTy, false);
    275         } else {
    276             size = CreateZExtOrTrunc(size, intTy);
    277         }
    278     }
    279     if (isa<Constant>(size)) {
    280         size = ConstantExpr::getMul(cast<Constant>(size), width);
    281     } else {
    282         size = CreateMul(size, width);
    283     }
    284     assert (size->getType() == intTy);
    285     CreateMemSet(CreatePointerCast(ptr, getInt8PtrTy()), getInt8(0), size, alignment);
    286 }
    287 
    288265PointerType * CBuilder::getVoidPtrTy() const {
    289266    return TypeBuilder<void *, false>::get(getContext());
Note: See TracChangeset for help on using the changeset viewer.