[llvm] r285084 - Move discriminator assignment to where it is used. (NFC)
Dehao Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 09:50:27 PDT 2016
Author: dehao
Date: Tue Oct 25 11:50:27 2016
New Revision: 285084
URL: http://llvm.org/viewvc/llvm-project?rev=285084&view=rev
Log:
Move discriminator assignment to where it is used. (NFC)
Modified:
llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp
Modified: llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp?rev=285084&r1=285083&r2=285084&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp Tue Oct 25 11:50:27 2016
@@ -199,8 +199,8 @@ static bool addDiscriminators(Function &
// discriminator is needed to distinguish both instructions.
auto R1 = Scopes.insert({Scope, nullptr});
DILexicalBlockFile *&NewScope = R1.first->second;
- unsigned Discriminator = InsertSuccess ? ++LDM[L] : LDM[L];
if (!NewScope) {
+ unsigned Discriminator = InsertSuccess ? ++LDM[L] : LDM[L];
auto *File = Builder.createFile(DIL->getFilename(),
Scope->getDirectory());
NewScope = Builder.createLexicalBlockFile(Scope, File, Discriminator);
More information about the llvm-commits
mailing list