diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-12-24 23:16:03 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-12-24 23:16:03 +0000 |
commit | f58e712b013aa0608f2a9e44efe5f66e85d06dee (patch) | |
tree | d00cf620d19c4f1c16d9c6cc3a3c8a5ea9849a16 /gnu/llvm/include | |
parent | b6bd3e002fbd62bc24c8aa5cbbe485becd0d1aca (diff) |
Import LLVM 5.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/include')
-rw-r--r-- | gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h | 6 | ||||
-rw-r--r-- | gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h | 8 | ||||
-rw-r--r-- | gnu/llvm/include/llvm/IR/AutoUpgrade.h | 2 | ||||
-rw-r--r-- | gnu/llvm/include/llvm/Support/FormatVariadic.h | 17 |
4 files changed, 33 insertions, 0 deletions
diff --git a/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h index 0b07fe9aa23..9bbda718aca 100644 --- a/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -652,6 +652,12 @@ public: auto GTI = gep_type_begin(PointeeType, Operands); Type *TargetType; + + // Handle the case where the GEP instruction has a single operand, + // the basis, therefore TargetType is a nullptr. + if (Operands.empty()) + return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic; + for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) { TargetType = GTI.getIndexedType(); // We assume that the cost of Scalar GEP with constant index and the diff --git a/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h index 8347f00cbc7..5ef0ac90e3c 100644 --- a/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h @@ -807,6 +807,14 @@ public: return getReservedRegs().test(PhysReg); } + /// Returns true when the given register unit is considered reserved. + /// + /// Register units are considered reserved when for at least one of their + /// root registers, the root register and all super registers are reserved. + /// This currently iterates the register hierarchy and may be slower than + /// expected. + bool isReservedRegUnit(unsigned Unit) const; + /// isAllocatable - Returns true when PhysReg belongs to an allocatable /// register class and it hasn't been reserved. /// diff --git a/gnu/llvm/include/llvm/IR/AutoUpgrade.h b/gnu/llvm/include/llvm/IR/AutoUpgrade.h index b42a3d3ad95..3f406f0cf19 100644 --- a/gnu/llvm/include/llvm/IR/AutoUpgrade.h +++ b/gnu/llvm/include/llvm/IR/AutoUpgrade.h @@ -51,6 +51,8 @@ namespace llvm { /// module is modified. bool UpgradeModuleFlags(Module &M); + void UpgradeSectionAttributes(Module &M); + /// If the given TBAA tag uses the scalar TBAA format, create a new node /// corresponding to the upgrade to the struct-path aware TBAA format. /// Otherwise return the \p TBAANode itself. diff --git a/gnu/llvm/include/llvm/Support/FormatVariadic.h b/gnu/llvm/include/llvm/Support/FormatVariadic.h index c1153e84dfb..408c6d8b2e0 100644 --- a/gnu/llvm/include/llvm/Support/FormatVariadic.h +++ b/gnu/llvm/include/llvm/Support/FormatVariadic.h @@ -94,6 +94,15 @@ public: Adapters.reserve(ParamCount); } + formatv_object_base(formatv_object_base const &rhs) = delete; + + formatv_object_base(formatv_object_base &&rhs) + : Fmt(std::move(rhs.Fmt)), + Adapters(), // Adapters are initialized by formatv_object + Replacements(std::move(rhs.Replacements)) { + Adapters.reserve(rhs.Adapters.size()); + }; + void format(raw_ostream &S) const { for (auto &R : Replacements) { if (R.Type == ReplacementType::Empty) @@ -149,6 +158,14 @@ public: Parameters(std::move(Params)) { Adapters = apply_tuple(create_adapters(), Parameters); } + + formatv_object(formatv_object const &rhs) = delete; + + formatv_object(formatv_object &&rhs) + : formatv_object_base(std::move(rhs)), + Parameters(std::move(rhs.Parameters)) { + Adapters = apply_tuple(create_adapters(), Parameters); + } }; // \brief Format text given a format string and replacement parameters. |