Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my %willbe_types = (
- PassRefPtrWillBeRawPtr => "RawPtr",
- RefCountedWillBeGarbageCollected => "GarbageCollected",
- RefCountedWillBeGarbageCollectedFinalized => "GarbageCollectedFinalized",
- RefCountedWillBeRefCountedGarbageCollected => "RefCountedGarbageCollected",
- RefCountedGarbageCollectedWillBeGarbageCollectedFinalized => "GarbageCollectedFinalized",
- RefCountedWillBeNoBase => "DummyBase",
- RefCountedGarbageCollectedWillBeNoBase => "DummyBase",
- ThreadSafeRefCountedWillBeGarbageCollected => "GarbageCollected",
- ThreadSafeRefCountedWillBeGarbageCollectedFinalized => "GarbageCollectedFinalized",
- PersistentWillBeMember => "Member",
- CrossThreadPersistentWillBeMember => "Member",
- RefPtrWillBePersistent => "Persistent",
- RefPtrWillBeRawPtr => "RawPtr",
- RefPtrWillBeMember => "Member",
- RefPtrWillBeWeakMember => "WeakMember",
- RefPtrWillBeWeakPersistent => "WeakPersistent",
- RefPtrWillBeCrossThreadPersistent => "CrossThreadPersistent",
- RawPtrWillBeMember => "Member",
- RawPtrWillBePersistent => "Persistent",
- RawPtrWillBeWeakMember => "WeakMember",
- RawPtrWillBeWeakPersistent => "WeakPersistent",
- RawPtrWillBeUntracedMember => "UntracedMember",
- OwnPtrWillBeCrossThreadPersistent => "CrossThreadPersistent",
- OwnPtrWillBeMember => "Member",
- OwnPtrWillBePersistent => "Persistent",
- OwnPtrWillBeRawPtr => "RawPtr",
- PassOwnPtrWillBeRawPtr => "RawPtr",
- WeakPtrWillBeCrossThreadWeakPersistent => "CrossThreadWeakPersistent",
- WeakPtrWillBeMember => "Member",
- WeakPtrWillBeRawPtr => "RawPtr",
- WeakPtrWillBeWeakMember => "WeakMember",
- WeakPtrWillBeWeakPersistent => "WeakPersistent",
- NoBaseWillBeGarbageCollected => "GarbageCollected",
- NoBaseWillBeGarbageCollectedFinalized => "GarbageCollectedFinalized",
- NoBaseWillBeRefCountedGarbageCollected => "RefCountedGarbageCollected",
- WillBeHeapHashMap => "HeapHashMap",
- WillBePersistentHeapHashMap => "PersistentHeapHashMap",
- WillBeHeapHashSet => "HeapHashSet",
- WillBePersistentHeapHashSet => "PersistentHeapHashSet",
- WillBeHeapLinkedHashSet => "HeapLinkedHashSet",
- WillBePersistentHeapLinkedHashSet => "PersistentHeapLinkedHashSet",
- WillBeHeapListHashSet => "HeapListHashSet",
- WillBePersistentHeapListHashSet => "PersistentHeapListHashSet",
- WillBeHeapVector => "HeapVector",
- WillBePersistentHeapVector => "PersistentHeapVector",
- WillBeHeapDeque => "HeapDeque",
- WillBePersistentHeapDeque => "PersistentHeapDeque",
- WillBeHeapHashCountedSet => "HeapHashCountedSet",
- WillBePersistentHeapHashCountedSet => "PersistentHeapHashCountedSet",
- WillBeGarbageCollectedMixin => "GarbageCollectedMixin",
- WillBeHeapSupplement => "HeapSupplement",
- WillBeHeapSupplementable => "HeapSupplementable",
- WillBeHeapTerminatedArray => "HeapTerminatedArray",
- WillBeHeapTerminatedArrayBuilder => "HeapTerminatedArrayBuilder",
- WillBeHeapLinkedStack => "HeapLinkedStack",
- PersistentHeapHashMapWillBeHeapHashMap => "HeapHashMap",
- PersistentHeapHashSetWillBeHeapHashSet => "HeapHashSet",
- PersistentHeapDequeWillBeHeapDeque => "HeapDeque",
- PersistentHeapVectorWillBeHeapVector => "HeapVector",
- WILL_BE_USING_GARBAGE_COLLECTED_MIXIN => "USING_GARBAGE_COLLECTED_MIXIN",
- );
- my @remove_lines = (
- "USING_FAST_MALLOC_WILL_BE_REMOVED",
- "USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED",
- "DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED",
- "DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED",
- "DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED",
- "EAGERLY_FINALIZE_WILL_BE_REMOVED",
- );
- for my $key (keys %willbe_types) {
- my $command = "grep -rl '" . $key . "' * | grep -v '.pl' | grep -v 'platform/heap/' | sed -i 's/" . $key . "/" . $willbe_types{$key} . "/g'";
- system $command;
- }
- for my $item (@remove_lines) {
- my $command = "grep -rl '" . $item . "' * | grep -v '.pl' | grep -v 'platform/heap/'";
- my @files = `$command`;
- for my $file (@files) {
- my $str = "";
- my $skipped = 0;
- chomp $file;
- open FH, "<", $file or die;
- while (my $line = <FH>) {
- if ($skipped && $line =~ /^[\s\t]*\n$/) {
- next;
- }
- $skipped = 0;
- if ($line =~ /${item}/) {
- if ($line =~ /^[\s\t]*${item}(\([^()]*\))?;?\s*\n$/) {
- $skipped = 1;
- next;
- } else {
- $line =~ s/[\s\t]*${item}(\([^()]*\))?;?//;
- # print $line;
- }
- }
- $str .= $line;
- }
- close FH;
- open FH, ">", $file or die;
- print FH $str;
- close FH;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement