BitcodeCommon.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- BitcodeCommon.h - Common code for encode/decode --------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This header defines common code to be used by BitcodeWriter and
  15. // BitcodeReader.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_BITCODE_BITCODECOMMON_H
  19. #define LLVM_BITCODE_BITCODECOMMON_H
  20. #include "llvm/ADT/Bitfields.h"
  21. namespace llvm {
  22. struct AllocaPackedValues {
  23. // We increased the number of bits needed to represent alignment to be more
  24. // than 5, but to preserve backward compatibility we store the upper bits
  25. // separately.
  26. using AlignLower = Bitfield::Element<unsigned, 0, 5>;
  27. using UsedWithInAlloca = Bitfield::Element<bool, AlignLower::NextBit, 1>;
  28. using ExplicitType = Bitfield::Element<bool, UsedWithInAlloca::NextBit, 1>;
  29. using SwiftError = Bitfield::Element<bool, ExplicitType::NextBit, 1>;
  30. using AlignUpper = Bitfield::Element<unsigned, SwiftError::NextBit, 3>;
  31. };
  32. } // namespace llvm
  33. #endif // LLVM_BITCODE_BITCODECOMMON_H
  34. #ifdef __GNUC__
  35. #pragma GCC diagnostic pop
  36. #endif