<commit_before>//===--- LValue.h - LValue Representation -----------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// A storage structure for holding l-values in Swift IR.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_IRGEN_LVALUE_H
#define SWIFT_IRGEN_LVALUE_H

namespace llvm {
  class Value;
}

namespace swift {
namespace irgen {

/// An l-value represents a reference to storage holding a value
/// of a type, as opposed to an r-value, which is an actual value
/// of the type.
class LValue {
public:
  LValue() : Address(nullptr) {}

  bool isValid() const { return Address != nullptr; }

  llvm::Value *getAddress() const {
    assert(isValid());
    return Address;
  }

  static LValue forAddress(llvm::Value *Address) {
    assert(Address != nullptr);

    LValue LV;
    LV.Address = Address;
    return LV;
  }

private:
  llvm::Value *Address;
};

} // end namespace irgen
} // end namespace swift

#endif
<commit_msg>LValues should also store the target alignment.<commit_after>//===--- LValue.h - LValue Representation -----------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// A storage structure for holding l-values in Swift IR.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_IRGEN_LVALUE_H
#define SWIFT_IRGEN_LVALUE_H

#include "IRGen.h"

namespace llvm {
  class Value;
}

namespace swift {
namespace irgen {

/// An l-value represents a reference to storage holding a value
/// of a type, as opposed to an r-value, which is an actual value
/// of the type.
class LValue {
public:
  LValue() : Address(nullptr) {}

  bool isValid() const { return Address != nullptr; }

  llvm::Value *getAddress() const {
    assert(isValid());
    return Address;
  }

  Alignment getAlignment() const {
    assert(isValid());
    return Align;
  }

  static LValue forAddress(llvm::Value *Address, Alignment Align) {
    assert(Address != nullptr);

    LValue LV;
    LV.Address = Address;
    LV.Align = Align;
    return LV;
  }

private:
  llvm::Value *Address;
  Alignment Align;
};

} // end namespace irgen
} // end namespace swift

#endif

{'fraction_non_alphanumeric': 0.22859046984338555, 'fraction_numerical': 0.006664445184938354, 'mean_word_length': 2.047715736040609, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1024273', 'n_tokens_mistral': 851, 'n_tokens_neox': 809, 'n_words': 292}