Skip to content
This repository was archived by the owner on Dec 20, 2019. It is now read-only.

Commit b295475

Browse files
committed
Merge remote-tracking branch 'llvm-mirror/release_50' into ldc-release_50
2 parents a4ddbea + 1368f40 commit b295475

File tree

128 files changed

+6773
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6773
-380
lines changed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR)
2626
set(LLVM_VERSION_MINOR 0)
2727
endif()
2828
if(NOT DEFINED LLVM_VERSION_PATCH)
29-
set(LLVM_VERSION_PATCH 0)
29+
set(LLVM_VERSION_PATCH 1)
3030
endif()
3131
if(NOT DEFINED LLVM_VERSION_SUFFIX)
3232
set(LLVM_VERSION_SUFFIX "")
@@ -208,10 +208,6 @@ include(VersionFromVCS)
208208
option(LLVM_APPEND_VC_REV
209209
"Embed the version control system revision id in LLVM" ON)
210210

211-
if( LLVM_APPEND_VC_REV )
212-
add_version_info_from_vcs(PACKAGE_VERSION)
213-
endif()
214-
215211
set(PACKAGE_NAME LLVM)
216212
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
217213
set(PACKAGE_BUGREPORT "http://llvm.org/bugs/")

docs/CMake.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,10 @@ LLVM-specific variables
248248

249249
**LLVM_APPEND_VC_REV**:BOOL
250250
Embed version control revision info (svn revision number or Git revision id).
251-
This is used among other things in the LLVM version string (stored in the
252-
PACKAGE_VERSION macro). For this to work cmake must be invoked before the
253-
build. Defaults to ON.
251+
The version info is provided by the ``LLVM_REVISION`` macro in
252+
``llvm/include/llvm/Support/VCSRevision.h``. Developers using git who don't
253+
need revision info can disable this option to avoid re-linking most binaries
254+
after a branch switch. Defaults to ON.
254255

255256
**LLVM_ENABLE_THREADS**:BOOL
256257
Build with threads support, if available. Defaults to ON.

include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,12 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
652652

653653
auto GTI = gep_type_begin(PointeeType, Operands);
654654
Type *TargetType;
655+
656+
// Handle the case where the GEP instruction has a single operand,
657+
// the basis, therefore TargetType is a nullptr.
658+
if (Operands.empty())
659+
return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic;
660+
655661
for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) {
656662
TargetType = GTI.getIndexedType();
657663
// We assume that the cost of Scalar GEP with constant index and the

include/llvm/CodeGen/MachineRegisterInfo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,14 @@ class MachineRegisterInfo {
807807
return getReservedRegs().test(PhysReg);
808808
}
809809

810+
/// Returns true when the given register unit is considered reserved.
811+
///
812+
/// Register units are considered reserved when for at least one of their
813+
/// root registers, the root register and all super registers are reserved.
814+
/// This currently iterates the register hierarchy and may be slower than
815+
/// expected.
816+
bool isReservedRegUnit(unsigned Unit) const;
817+
810818
/// isAllocatable - Returns true when PhysReg belongs to an allocatable
811819
/// register class and it hasn't been reserved.
812820
///

include/llvm/IR/AutoUpgrade.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ namespace llvm {
5151
/// module is modified.
5252
bool UpgradeModuleFlags(Module &M);
5353

54+
void UpgradeSectionAttributes(Module &M);
55+
5456
/// If the given TBAA tag uses the scalar TBAA format, create a new node
5557
/// corresponding to the upgrade to the struct-path aware TBAA format.
5658
/// Otherwise return the \p TBAANode itself.

include/llvm/Support/FormatVariadic.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ class formatv_object_base {
9494
Adapters.reserve(ParamCount);
9595
}
9696

97+
formatv_object_base(formatv_object_base const &rhs) = delete;
98+
99+
formatv_object_base(formatv_object_base &&rhs)
100+
: Fmt(std::move(rhs.Fmt)),
101+
Adapters(), // Adapters are initialized by formatv_object
102+
Replacements(std::move(rhs.Replacements)) {
103+
Adapters.reserve(rhs.Adapters.size());
104+
};
105+
97106
void format(raw_ostream &S) const {
98107
for (auto &R : Replacements) {
99108
if (R.Type == ReplacementType::Empty)
@@ -149,6 +158,14 @@ template <typename Tuple> class formatv_object : public formatv_object_base {
149158
Parameters(std::move(Params)) {
150159
Adapters = apply_tuple(create_adapters(), Parameters);
151160
}
161+
162+
formatv_object(formatv_object const &rhs) = delete;
163+
164+
formatv_object(formatv_object &&rhs)
165+
: formatv_object_base(std::move(rhs)),
166+
Parameters(std::move(rhs.Parameters)) {
167+
Adapters = apply_tuple(create_adapters(), Parameters);
168+
}
152169
};
153170

154171
// \brief Format text given a format string and replacement parameters.

lib/AsmParser/LLParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ bool LLParser::ValidateEndOfModule() {
240240
UpgradeDebugInfo(*M);
241241

242242
UpgradeModuleFlags(*M);
243+
UpgradeSectionAttributes(*M);
243244

244245
if (!Slots)
245246
return false;

lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Expected<bool> hasObjCCategoryInModule(BitstreamCursor &Stream) {
264264
if (convertToString(Record, 0, S))
265265
return error("Invalid record");
266266
// Check for the i386 and other (x86_64, ARM) conventions
267-
if (S.find("__DATA, __objc_catlist") != std::string::npos ||
267+
if (S.find("__DATA,__objc_catlist") != std::string::npos ||
268268
S.find("__OBJC,__category") != std::string::npos)
269269
return true;
270270
break;

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE(
621621
auto *SP = cast<DISubprogram>(Scope->getScopeNode());
622622

623623
DIE *ContextDIE;
624+
DwarfCompileUnit *ContextCU = this;
624625

625626
if (includeMinimalInlineScopes())
626627
ContextDIE = &getUnitDie();
@@ -631,18 +632,23 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE(
631632
else if (auto *SPDecl = SP->getDeclaration()) {
632633
ContextDIE = &getUnitDie();
633634
getOrCreateSubprogramDIE(SPDecl);
634-
} else
635+
} else {
635636
ContextDIE = getOrCreateContextDIE(resolve(SP->getScope()));
637+
// The scope may be shared with a subprogram that has already been
638+
// constructed in another CU, in which case we need to construct this
639+
// subprogram in the same CU.
640+
ContextCU = DD->lookupCU(ContextDIE->getUnitDie());
641+
}
636642

637643
// Passing null as the associated node because the abstract definition
638644
// shouldn't be found by lookup.
639-
AbsDef = &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr);
640-
applySubprogramAttributesToDefinition(SP, *AbsDef);
645+
AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr);
646+
ContextCU->applySubprogramAttributesToDefinition(SP, *AbsDef);
641647

642-
if (!includeMinimalInlineScopes())
643-
addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
644-
if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef))
645-
addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
648+
if (!ContextCU->includeMinimalInlineScopes())
649+
ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
650+
if (DIE *ObjectPointer = ContextCU->createAndAddScopeChildren(Scope, *AbsDef))
651+
ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
646652
}
647653

648654
DIE *DwarfCompileUnit::constructImportedEntityDIE(

lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class DwarfDebug : public DebugHandlerBase {
283283
// 0, referencing the comp_dir of all the type units that use it.
284284
MCDwarfDwoLineTable SplitTypeUnitFileTable;
285285
/// @}
286-
286+
287287
/// True iff there are multiple CUs in this module.
288288
bool SingleCU;
289289
bool IsDarwin;
@@ -562,6 +562,9 @@ class DwarfDebug : public DebugHandlerBase {
562562
bool isLexicalScopeDIENull(LexicalScope *Scope);
563563

564564
bool hasDwarfPubSections(bool includeMinimalInlineScopes) const;
565+
566+
/// Find the matching DwarfCompileUnit for the given CU DIE.
567+
DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); }
565568
};
566569
} // End of namespace llvm
567570

0 commit comments

Comments
 (0)