dblaikie added inline comments.

================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:3117
+    llvm::APSInt Value = Enum->getInitVal();
+    Value.setIsSigned(IsSigned);
+    Enumerators.push_back(DBuilder.createEnumerator(Enum->getName(), Value));
----------------
rnk wrote:
> dblaikie wrote:
> > Is the value already signed appropriately?
> > 
> > Removing this line of code (and the `bool IsSigned` variable, so it doesn't 
> > break `-Werror=unused-variable`) doesn't cause any tests to fail, that I 
> > can see.
> I'm afraid it might not be NFC. I took the cautious approach of trying to 
> leave things exactly as they were. Enums in C can have surprisingly different 
> behavior, IIRC.
I'd rather not leave in haunted-graveyard-y code like that.

Could we assert that Value.getIsSigned == IsSigned? Then if there's a case 
where it isn't we'll have a test case/justification for the code?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106585/new/

https://reviews.llvm.org/D106585

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to