41 Commits
Author SHA1 Message Date
Siegfried Pammer fddd62286b Beautify enum declarations by referencing previously declared members
Enum members whose value duplicates an earlier member now reference it
(Item2B = Item2A), [Flags] members combine earlier single-bit members
(All = Item1 | Item2 | Item3) or their complement (NotItem1 = ~Item1)
instead of showing a bare number.

Several guardrails keep the output faithful to how such enums are
written by hand: only previously declared members are referenced (field
row order); a multi-bit value lying entirely within a larger, earlier
member is a field encoding inside that mask, not a flag union, and
stays numeric, as do zero-valued members of [Flags] enums, which
routinely have several unrelated zero members. The ~X form is
suppressed in byte/ushort enum declarations, where the initializer
constant folds in int and would not compile. Enums with unusual
underlying types (bool, native int) keep the plain constant conversion.
With these rules, decompiling System.Private.CoreLib reproduces the
hand-written declarations of TypeAttributes, MethodAttributes,
AttributeTargets and FileAttributes almost verbatim.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-07-22 18:03:33 +02:00
Siegfried Pammer 07d5a01d2b Add license headers to source files that lacked them
Backfills the standard MIT X11 header on hand-written files that never
got one, attributing each to its first-commit author and year from git
history. Code vendored from dotnet/runtime and Humanizr/Humanizer gets
its origin's license lines and a provenance note instead. Generated
files (Resources.Designer.cs, the version-info template), tool-managed
suppression files, and BAML test-case fixtures intentionally stay
header-less.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-07-05 21:09:46 +02:00
Siegfried Pammer 77d9ee73e9 Fix IDE2000 globally 2025-12-29 19:24:31 +01:00
Peter Crabtree e1e16b64f5 dev: Strip BOM mark from text files 2025-08-28 20:56:19 -04:00
Siegfried Pammer 03aecf047d Add VariableScope and rework AssignVariableNames step to support renaming parameters of nested ILFunctions in the future. 2025-03-21 08:34:44 +01:00
Christoph Wille b1a4ab15c4 Fix NETCORE to NET8(or newer) directive 2024-04-09 21:31:18 +02:00
Siegfried Pammer eae54ddf24 Fix #3014: Missing type information in lambda expressions. 2023-11-01 08:29:03 +01:00
ElektroKill 760a6a653e Reduce allocations in TransformArrayInitializers
DecodeArrayInitializer - Instead of relying on the Add method of a list to expand the underlying array when necessary, the code now allocates a big enough array to fit all the elements removing the need for the Add method to expand the array several times.

BlockFromInitializer now reuses a single instance of List<ILInstruction> instead of reallocating a new one every time and clears it when necessary. The same pre-allocation approach mentioned above has been implemented here too.
2022-07-01 18:45:46 +02:00
Siegfried Pammer de5b72114e Fix nullable and other warnings. 2022-04-12 10:56:29 +02:00
Daniel Grunwald b9eee606af #nullable enable for most files in ICSharpCode.Decompiler/Util 2021-06-03 20:32:18 +02:00
Daniel Grunwald d13a8bb64d Support ldftn in the context of a function pointer. 2020-09-06 18:59:07 +02:00
dotnet format 0d9f871a4f #2128: Reformat the whole code base. 2020-08-28 01:05:38 +02:00
Daniel Grunwald bdea1950a8 Add #if !NETCORE around extension methods that are included with .NET Core 3 2020-07-25 15:54:34 +02:00
Daniel Grunwald f4613de2ba Don't match sub.ovf in SwitchAnalysis. 2018-10-07 15:38:44 +02:00
Chicken-Bones 7017d998d0 Improve switch decompilation in loops via early detection of continue blocks. 2018-08-14 11:21:17 +10:00
Siegfried Pammer b82f4dd773 Fix #1206: Could not decode attribute arguments. There was a bug in the calculation of public key tokens of assembly definitions. 2018-07-16 17:26:39 +02:00
Siegfried Pammer 5faead453c Fix build of BAML decompiler. 2018-07-15 08:54:33 +02:00
Siegfried Pammer 7ded12c5fb Reimplement search strategies. 2018-07-15 08:42:29 +02:00
Daniel Grunwald 621d90d006 Use MetadataAssembly (the new TS implementation) in DecompilerTypeSystem. 2018-06-28 00:28:09 +02:00
Daniel Grunwald 4e654cff38 Merge branch 'master' into srm 2018-06-02 10:58:23 +02:00
Daniel Grunwald d78d423d10 Add tuple types to type system and syntax tree. 2018-05-13 00:48:20 +02:00
Siegfried Pammer 61eead50c7 Fix TypeSystemLoaderTests 2018-03-29 20:43:59 +02:00
Siegfried Pammer b500b24548 SRM WIP basic implementation of DecompilerTypeSystem 2018-03-18 20:02:37 +01:00
Pent Ploompuu 48dc32163e Reduced allocations 2018-03-10 23:58:21 +02:00
Daniel Grunwald 4d00c65608 Use IReadOnlyList<T> instead of IList<T> in the resolved type system. 2018-03-09 00:04:20 +01:00
Siegfried Pammer 381bd42599 Fix bug mentioned in #909 2017-10-16 18:55:58 +02:00
Siegfried Pammer b94088fbc9 Add MaxBy, MaxOrDefault, MinBy extension methods 2017-10-13 17:12:34 +02:00
Siegfried Pammer 0226b5a832 Only transform params if it's the last parameter + Refactoring of variable names. 2017-09-20 21:01:18 +02:00
Siegfried Pammer 706419544f Implement support for unwrapping params arrays. 2017-09-20 13:10:43 +02:00
Daniel Grunwald 00564f5fcd Fix detection of do-while and for loops. 2017-08-20 20:19:22 +02:00
Daniel Grunwald 5621101436 Reconstruct try-finally blocks in yield return decompiler 2016-12-28 19:27:56 +01:00
Daniel Grunwald fe84ea9730 WIP: yield return decompiler 2016-12-20 21:55:28 +01:00
Christoph Wille 1ce8349dd9 Adjust namespaces 2016-11-26 11:12:53 +01:00
Siegfried Pammer e790646244 Detect simple array initializers as well 2016-07-09 09:42:27 +09:00
Siegfried Pammer ab357e00a6 WIP: DelegateConstruction: implemented basic transformations 2016-07-06 00:07:36 +09:00
Daniel Grunwald 2730133f5f Combine switch sections that branch to same label. 2016-06-25 16:01:11 +02:00
Daniel Grunwald d6b9d39f38 First attempt at loop extension. 2015-06-13 15:45:55 +02:00
Siegfried Pammer 7fdb7765c8 fix copy-paste error in PeekOrDefault extension 2015-05-30 17:43:50 +02:00
Daniel Grunwald fffa297b8f Use ResolveResults as annotations. 2014-11-15 15:53:27 +01:00
Daniel Grunwald 42bfff077d Finish the move to the new generated ILAst classes 2014-07-12 16:58:05 +02:00
Daniel Grunwald 27252656cf Upgrade to new ICSharpCode.Decompiler (work in progress)
- Switch AvalonEdit to NuGet package.
- Upgrade Mono.Cecil to new version
2014-06-15 19:24:13 +02:00