diff options
| author | Dehao Chen <dehao@google.com> | 2016-10-07 15:21:31 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2016-10-07 15:21:31 +0000 |
| commit | 6e0c8446db8bebe774ff6e927d5d4c5503ff338d (patch) | |
| tree | 9964726d49ee90c38a35abe9d23696469bb4c955 /llvm/lib/Transforms/Utils | |
| parent | e239e951609a573c485ff7dacff0573068e8879d (diff) | |
| download | bcm5719-llvm-6e0c8446db8bebe774ff6e927d5d4c5503ff338d.tar.gz bcm5719-llvm-6e0c8446db8bebe774ff6e927d5d4c5503ff338d.zip | |
Invoke add-discriminator at -g0 -fsample-profile
Summary: -fsample-profile needs discriminator, which will not be added if built with -g0. This patch makes sure the discriminator is added for sample-profile at -g0. A followup patch will be send out to update clang tests.
Reviewers: davidxl, dblaikie, echristo, dnovillo
Subscribers: mehdi_amini, probinson, llvm-commits
Differential Revision: https://reviews.llvm.org/D25132
llvm-svn: 283565
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/AddDiscriminators.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp index ee409220b46..45b4fab07ed 100644 --- a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp +++ b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp @@ -159,10 +159,7 @@ static bool addDiscriminators(Function &F) { // If the function has debug information, but the user has disabled // discriminators, do nothing. // Simlarly, if the function has no debug info, do nothing. - // Finally, if this module is built with dwarf versions earlier than 4, - // do nothing (discriminator support is a DWARF 4 feature). - if (NoDiscriminators || !F.getSubprogram() || - F.getParent()->getDwarfVersion() < 4) + if (NoDiscriminators || !F.getSubprogram()) return false; bool Changed = false; |

