Line.cpp 748 B

123456789101112131415161718192021
  1. //===-- Line.cpp ----------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/DebugInfo/CodeView/Line.h"
  9. using namespace llvm;
  10. using namespace codeview;
  11. LineInfo::LineInfo(uint32_t StartLine, uint32_t EndLine, bool IsStatement) {
  12. LineData = StartLine & StartLineMask;
  13. uint32_t LineDelta = EndLine - StartLine;
  14. LineData |= (LineDelta << EndLineDeltaShift) & EndLineDeltaMask;
  15. if (IsStatement) {
  16. LineData |= StatementFlag;
  17. }
  18. }