[DebugInfo] Use per-enumerator signedness for DIEnumerator

Allegedly the DWARF backend ignores this field of DIEnumerator, but we
set it nonetheless in case we decide to use it in the future.
Alternatively, we could remove it, but it is simpler to pass down the
signed bit as it is in the AST for now.

Implemented to address comments on D106585

GitOrigin-RevId: f9f56488e02d1c09a9cd4acde61ce1c712e71405
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index f96c5ef..81c910f 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -3084,17 +3084,11 @@
 
   SmallString<256> Identifier = getTypeIdentifier(Ty, CGM, TheCU);
 
-  // Create elements for each enumerator. Use the signed-ness of the enum type,
-  // not the signedness of the enumerator. This matches the DWARF produced by
-  // GCC for C enums with positive enumerators.
   SmallVector<llvm::Metadata *, 16> Enumerators;
   ED = ED->getDefinition();
-  bool IsSigned = ED->getIntegerType()->isSignedIntegerType();
   for (const auto *Enum : ED->enumerators()) {
-    llvm::APSInt Value = Enum->getInitVal();
-    Value.setIsSigned(IsSigned);
     Enumerators.push_back(
-        DBuilder.createEnumerator(Enum->getName(), std::move(Value)));
+        DBuilder.createEnumerator(Enum->getName(), Enum->getInitVal()));
   }
 
   // Return a CompositeType for the enum itself.
diff --git a/test/CodeGen/enum2.c b/test/CodeGen/enum2.c
index f41d5a1..fcf6381 100644
--- a/test/CodeGen/enum2.c
+++ b/test/CodeGen/enum2.c
@@ -12,4 +12,4 @@
 // CHECK-SAME: elements: ![[ELTS:[0-9]+]]
 // CHECK: ![[LONG]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
 // CHECK: ![[ELTS]] = !{![[MAX:[0-9]+]]}
-// CHECK: ![[MAX]] = !DIEnumerator(name: "MAX", value: 0, isUnsigned: true)
+// CHECK: ![[MAX]] = !DIEnumerator(name: "MAX", value: 0)