Ignore:
Timestamp:
Jan 19, 2017, 2:41:02 PM (2 years ago)
Author:
nmedfort
Message:

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File:
1 edited

Legend:

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

    r5260 r5267  
    66
    77#include "CBuilder.h"
    8 #include <llvm/IR/IRBuilder.h>
    98#include <llvm/IR/Module.h>
    109#include <llvm/IR/Constants.h>
    1110#include <llvm/IR/Intrinsics.h>
    1211#include <llvm/IR/Function.h>
    13 #include <llvm/Support/raw_ostream.h>
    1412#include <llvm/IR/TypeBuilder.h>
    1513
     
    9492    Function * malloc = m->getFunction("malloc");
    9593    if (malloc == nullptr) {
    96         Type * const voidPtrTy = getVoidPtrTy();
     94        PointerType * const voidPtrTy = getVoidPtrTy();
    9795        malloc = cast<Function>(m->getOrInsertFunction("malloc", voidPtrTy, intTy, nullptr));
    9896        malloc->setCallingConv(CallingConv::C);
     
    203201    Function * realloc = m->getFunction("realloc");
    204202    if (realloc == nullptr) {
    205         Type * const voidPtrTy = getVoidPtrTy();
     203        PointerType * const voidPtrTy = getVoidPtrTy();
    206204        realloc = cast<Function>(m->getOrInsertFunction("realloc", voidPtrTy, voidPtrTy, intTy, nullptr));
    207205        realloc->setCallingConv(CallingConv::C);
     
    230228}
    231229
    232 
    233230LoadInst * CBuilder::CreateAtomicLoadAcquire(Value * ptr) {
    234231    unsigned alignment = dyn_cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits()/8;
     
    245242}
    246243
    247 //
    248 // int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
    249 //                    void *(*start_routine)(void*), void *arg);
    250 //
    251244Value * CBuilder::CreatePThreadCreateCall(Value * thread, Value * attr, Function * start_routine, Value * arg) {
    252245    Function * pthreadCreateFunc = mMod->getFunction("pthread_create");
     
    266259}
    267260
    268 //  #include <pthread.h>
    269 //  void pthread_exit(void *value_ptr);
    270 
    271261Value * CBuilder::CreatePThreadExitCall(Value * value_ptr) {
    272262    Function * pthreadExitFunc = mMod->getFunction("pthread_exit");
     
    281271}
    282272
    283 //  int pthread_join(pthread_t thread, void **value_ptr);
    284273Value * CBuilder::CreatePThreadJoinCall(Value * thread, Value * value_ptr){
    285274    Type * pthreadTy = getSizeTy();
     
    292281}
    293282
    294 CBuilder::CBuilder(llvm::Module * m, unsigned archBitWidth, unsigned CacheAlignment)
     283CBuilder::CBuilder(llvm::Module * m, unsigned GeneralRegisterWidthInBits, unsigned CacheLineAlignmentInBytes)
    295284: IRBuilder<>(m->getContext())
    296285, mMod(m)
    297 , mCacheLineAlignment(CacheAlignment)
    298 , mSizeType(getIntNTy(archBitWidth)) {
    299 }
     286, mCacheLineAlignment(CacheLineAlignmentInBytes)
     287, mSizeType(getIntNTy(GeneralRegisterWidthInBits)) {
     288}
Note: See TracChangeset for help on using the changeset viewer.