diff options
| author | Paul Robinson <paul.robinson@sony.com> | 2018-11-19 18:29:28 +0000 |
|---|---|---|
| committer | Paul Robinson <paul.robinson@sony.com> | 2018-11-19 18:29:28 +0000 |
| commit | cda5421016f67236f60bbc1ba9e4e847e6dbeb71 (patch) | |
| tree | 4bd81caf1ef021ef98f84e73e902845b359170c4 /llvm/tools/opt/Debugify.cpp | |
| parent | 1c803f5988af77cc2d1d4ca12b9b4a3e1a094c35 (diff) | |
| download | bcm5719-llvm-cda5421016f67236f60bbc1ba9e4e847e6dbeb71.tar.gz bcm5719-llvm-cda5421016f67236f60bbc1ba9e4e847e6dbeb71.zip | |
[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
llvm-svn: 347239
Diffstat (limited to 'llvm/tools/opt/Debugify.cpp')
| -rw-r--r-- | llvm/tools/opt/Debugify.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp index 6c3cdc75e33..3b1effba159 100644 --- a/llvm/tools/opt/Debugify.cpp +++ b/llvm/tools/opt/Debugify.cpp @@ -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. |

