dblaikie added inline comments.
================
Comment at: lib/CodeGen/CGDebugInfo.cpp:2490-2491
for (const auto *Enum : ED->enumerators()) {
- Enumerators.push_back(DBuilder.createEnumerator(
- Enum->getName(), Enum->getInitVal().getSExtValue()));
+ const auto &InitVal = Enum->getInitVal();
+ bool IsSigned = ED->getIntegerType()->isSignedIntegerType();
+ auto Value = IsSigned ? InitVal.getSExtValue() : InitVal.getZExtValue();
----------------
Move this "IsSigned" outside the loop, since it's loop invariant?
Repository:
rC Clang
https://reviews.llvm.org/D42736
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits