[DebugInfo] DISubprogram flags get their own flags word. NFC.

This will hold flags specific to subprograms. In the future
we could potentially free up scarce bits in DIFlags by moving
subprogram-specific flags from there to the new flags word.

This patch does not change IR/bitcode formats, that will be
done in a follow-up.

Differential Revision: https://reviews.llvm.org/D54597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Paul Robinson
2018-11-19 18:29:28 +00:00
parent 7ca11331eb
commit eaa73537bb
16 changed files with 351 additions and 321 deletions
+6 -5
View File
@@ -96,11 +96,12 @@ bool applyDebugifyMetadata(Module &M,
continue;
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
bool IsLocalToUnit = F.hasPrivateLinkage() || F.hasInternalLinkage();
auto SP =
DIB.createFunction(CU, F.getName(), F.getName(), File, NextLine, SPType,
IsLocalToUnit, /*isDefinition=*/true, NextLine,
DINode::FlagZero, /*isOptimized=*/true);
DISubprogram::DISPFlags SPFlags =
DISubprogram::SPFlagDefinition | DISubprogram::SPFlagOptimized;
if (F.hasPrivateLinkage() || F.hasInternalLinkage())
SPFlags |= DISubprogram::SPFlagLocalToUnit;
auto SP = DIB.createFunction(CU, F.getName(), F.getName(), File, NextLine,
SPType, NextLine, DINode::FlagZero, SPFlags);
F.setSubprogram(SP);
for (BasicBlock &BB : F) {
// Attach debug locations.