DxilUtil.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilUtil.h //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // DXIL helper functions. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. namespace llvm {
  13. class Type;
  14. class GlobalVariable;
  15. class Function;
  16. class Module;
  17. class MemoryBuffer;
  18. class LLVMContext;
  19. class DiagnosticInfo;
  20. }
  21. namespace hlsl {
  22. class DxilFieldAnnotation;
  23. class DxilTypeSystem;
  24. namespace dxilutil {
  25. unsigned
  26. GetLegacyCBufferFieldElementSize(DxilFieldAnnotation &fieldAnnotation,
  27. llvm::Type *Ty, DxilTypeSystem &typeSys);
  28. llvm::Type *GetArrayEltTy(llvm::Type *Ty);
  29. bool HasDynamicIndexing(llvm::Value *V);
  30. bool IsStaticGlobal(llvm::GlobalVariable *GV);
  31. bool IsSharedMemoryGlobal(llvm::GlobalVariable *GV);
  32. bool RemoveUnusedFunctions(llvm::Module &M, llvm::Function *EntryFunc,
  33. llvm::Function *PatchConstantFunc, bool IsLib);
  34. std::unique_ptr<llvm::Module> LoadModuleFromBitcode(llvm::StringRef BC,
  35. llvm::LLVMContext &Ctx, std::string &DiagStr);
  36. std::unique_ptr<llvm::Module> LoadModuleFromBitcode(llvm::MemoryBuffer *MB,
  37. llvm::LLVMContext &Ctx, std::string &DiagStr);
  38. void PrintDiagnosticHandler(const llvm::DiagnosticInfo &DI, void *Context);
  39. }
  40. }