github.com/alexanius/gollvm12@v0.0.0-20230419200121-b152358b84f3/passes/GollvmPasses.h (about) 1 //===--- GollvmPasses.h - Gollvm specific backend passes ------------------===// 2 // 3 // Copyright 2018 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_GOLLVM_PASSES_GOLLVMPASSES_H 10 #define LLVM_GOLLVM_PASSES_GOLLVMPASSES_H 11 12 #include "llvm/ADT/SmallVector.h" 13 14 namespace llvm { 15 16 class DataLayout; 17 class FunctionPass; 18 class ModulePass; 19 class PassRegistry; 20 class Type; 21 class Value; 22 23 void initializeGoAnnotationPass(PassRegistry&); 24 void initializeGoNilChecksPass(PassRegistry&); 25 void initializeGoSafeGetgPass(PassRegistry&); 26 void initializeGoStatepointsLegacyPassPass(PassRegistry&); 27 void initializeGoWrappersPass(PassRegistry&); 28 void initializeRemoveAddrSpacePassPass(PassRegistry&); 29 30 FunctionPass *createGoAnnotationPass(); 31 FunctionPass *createGoNilChecksPass(); 32 ModulePass *createGoSafeGetgPass(); 33 ModulePass *createGoStatepointsLegacyPass(); 34 FunctionPass *createGoWrappersPass(); 35 ModulePass *createRemoveAddrSpacePass(const DataLayout&); 36 37 void linkGoGC(); 38 void linkGoGCPrinter(); 39 40 } // namespace llvm 41 42 namespace gollvm { 43 namespace passes { 44 45 // Helper functions. 46 47 // Whether a type contains pointer. 48 bool hasPointer(llvm::Type *); 49 50 // Compute the pointer bitmap for type T, stored into Words. 51 void getPtrBitmapForType(llvm::Type *T, const llvm::DataLayout &DL, 52 llvm::SmallVectorImpl<llvm::Value *> &Words); 53 54 } // namespace passes 55 } // namespace gollvm 56 57 #endif