Current Path : /compat/linux/proc/self/root/usr/src/contrib/llvm/lib/Target/PTX/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/self/root/usr/src/contrib/llvm/lib/Target/PTX/PTXParamManager.cpp |
//===-- PTXParamManager.cpp - Manager for .param variables ----------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements the PTXParamManager class. // //===----------------------------------------------------------------------===// #include "PTXParamManager.h" #include "PTX.h" #include "llvm/ADT/StringExtras.h" using namespace llvm; PTXParamManager::PTXParamManager() { } unsigned PTXParamManager::addArgumentParam(unsigned Size) { PTXParam Param; Param.Type = PTX_PARAM_TYPE_ARGUMENT; Param.Size = Size; std::string Name; Name = "__param_"; Name += utostr(ArgumentParams.size()+1); Param.Name = Name; unsigned Index = AllParams.size(); AllParams[Index] = Param; ArgumentParams.push_back(Index); return Index; } unsigned PTXParamManager::addReturnParam(unsigned Size) { PTXParam Param; Param.Type = PTX_PARAM_TYPE_RETURN; Param.Size = Size; std::string Name; Name = "__ret_"; Name += utostr(ReturnParams.size()+1); Param.Name = Name; unsigned Index = AllParams.size(); AllParams[Index] = Param; ReturnParams.push_back(Index); return Index; } unsigned PTXParamManager::addLocalParam(unsigned Size) { PTXParam Param; Param.Type = PTX_PARAM_TYPE_LOCAL; Param.Size = Size; std::string Name; Name = "__localparam_"; Name += utostr(LocalParams.size()+1); Param.Name = Name; unsigned Index = AllParams.size(); AllParams[Index] = Param; LocalParams.push_back(Index); return Index; }