瀏覽代碼

AK+Userland: Remove NOESCAPE

See the next commit for an explanation
Matthew Olsson 1 年之前
父節點
當前提交
a5f4c9a632

+ 0 - 2
AK/Function.h

@@ -40,11 +40,9 @@ namespace AK {
 
 // These annotations are used to avoid capturing a variable with local storage in a lambda that outlives it
 #if defined(AK_COMPILER_CLANG)
-#    define NOESCAPE [[clang::annotate("serenity::noescape")]]
 // FIXME: When we get C++23, change this to be applied to the lambda directly instead of to the types of its captures
 #    define IGNORE_USE_IN_ESCAPING_LAMBDA [[clang::annotate("serenity::ignore_use_in_escaping_lambda")]]
 #else
-#    define NOESCAPE
 #    define IGNORE_USE_IN_ESCAPING_LAMBDA
 #endif
 

+ 1 - 1
Userland/DevTools/HackStudio/Project.h

@@ -29,7 +29,7 @@ public:
 
     NonnullRefPtr<ProjectFile> create_file(ByteString const& path) const;
 
-    void for_each_text_file(NOESCAPE Function<void(ProjectFile const&)>) const;
+    void for_each_text_file(Function<void(ProjectFile const&)>) const;
     ByteString to_absolute_path(ByteString const&) const;
     bool project_is_serenity() const;
 

+ 2 - 2
Userland/DevTools/HackStudio/ProjectBuilder.h

@@ -42,8 +42,8 @@ private:
         Vector<ByteString> dependencies {};
     };
     static HashMap<ByteString, NonnullOwnPtr<LibraryInfo>> get_defined_libraries();
-    static void for_each_library_definition(NOESCAPE Function<void(ByteString, ByteString)>);
-    static void for_each_library_dependencies(NOESCAPE Function<void(ByteString, Vector<StringView>)>);
+    static void for_each_library_definition(Function<void(ByteString, ByteString)>);
+    static void for_each_library_dependencies(Function<void(ByteString, Vector<StringView>)>);
     static ErrorOr<ByteString> component_name(StringView cmake_file_path);
     static ErrorOr<void> verify_cmake_is_installed();
     static ErrorOr<void> verify_make_is_installed();

+ 2 - 2
Userland/Libraries/LibGUI/Model.h

@@ -114,8 +114,8 @@ public:
 protected:
     Model();
 
-    void for_each_view(NOESCAPE Function<void(AbstractView&)>);
-    void for_each_client(NOESCAPE Function<void(ModelClient&)>);
+    void for_each_view(Function<void(AbstractView&)>);
+    void for_each_client(Function<void(ModelClient&)>);
     void did_update(unsigned flags = UpdateFlag::InvalidateAllIndices);
 
     static bool string_matches(StringView str, StringView needle, unsigned flags)

+ 4 - 4
Userland/Libraries/LibGfx/Font/FontDatabase.h

@@ -37,11 +37,11 @@ public:
     RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned width, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
     RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
     RefPtr<Gfx::Font> get_by_name(StringView);
-    void for_each_font(NOESCAPE Function<void(Gfx::Font const&)>);
-    void for_each_fixed_width_font(NOESCAPE Function<void(Gfx::Font const&)>);
+    void for_each_font(Function<void(Gfx::Font const&)>);
+    void for_each_fixed_width_font(Function<void(Gfx::Font const&)>);
 
-    void for_each_typeface(NOESCAPE Function<void(Typeface const&)>);
-    void for_each_typeface_with_family_name(FlyString const& family_name, NOESCAPE Function<void(Typeface const&)>);
+    void for_each_typeface(Function<void(Typeface const&)>);
+    void for_each_typeface_with_family_name(FlyString const& family_name, Function<void(Typeface const&)>);
 
     void load_all_fonts_from_uri(StringView);
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AbstractOperations.h

@@ -32,7 +32,7 @@ ThrowCompletionOr<Value> call_impl(VM&, Value function, Value this_value, Readon
 ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
 ThrowCompletionOr<NonnullGCPtr<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
 ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
-ThrowCompletionOr<MarkedVector<Value>> create_list_from_array_like(VM&, Value, NOESCAPE Function<ThrowCompletionOr<void>(Value)> = {});
+ThrowCompletionOr<MarkedVector<Value>> create_list_from_array_like(VM&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
 ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
 ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
 ThrowCompletionOr<void> initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*);

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Object.h

@@ -168,7 +168,7 @@ public:
 
     // 14.7.5 The for-in, for-of, and for-await-of Statements
 
-    Optional<Completion> enumerate_object_properties(NOESCAPE Function<Optional<Completion>(Value)>) const;
+    Optional<Completion> enumerate_object_properties(Function<Optional<Completion>(Value)>) const;
 
     // Implementation-specific storage abstractions
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Realm.h

@@ -32,7 +32,7 @@ public:
     };
 
     static ThrowCompletionOr<NonnullGCPtr<Realm>> create(VM&);
-    static ThrowCompletionOr<NonnullOwnPtr<ExecutionContext>> initialize_host_defined_realm(VM&, NOESCAPE Function<Object*(Realm&)> create_global_object, NOESCAPE Function<Object*(Realm&)> create_global_this_value);
+    static ThrowCompletionOr<NonnullOwnPtr<ExecutionContext>> initialize_host_defined_realm(VM&, Function<Object*(Realm&)> create_global_object, Function<Object*(Realm&)> create_global_this_value);
 
     void set_global_object(Object* global_object, Object* this_value);
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/VM.h

@@ -42,7 +42,7 @@ public:
     struct CustomData {
         virtual ~CustomData() = default;
 
-        virtual void spin_event_loop_until(NOESCAPE JS::SafeFunction<bool()> goal_condition) = 0;
+        virtual void spin_event_loop_until(JS::SafeFunction<bool()> goal_condition) = 0;
     };
 
     static ErrorOr<NonnullRefPtr<VM>> create(OwnPtr<CustomData> = {});

+ 1 - 1
Userland/Libraries/LibTest/Randomized/RandomnessSource.h

@@ -26,7 +26,7 @@ public:
     static RandomnessSource live() { return RandomnessSource(RandomRun(), true); }
     static RandomnessSource recorded(RandomRun const& run) { return RandomnessSource(run, false); }
     RandomRun& run() { return m_run; }
-    u64 draw_value(u64 max, NOESCAPE Function<u64()> random_generator)
+    u64 draw_value(u64 max, Function<u64()> random_generator)
     {
         // Live: use the random generator and remember the value.
         if (m_is_live) {

+ 1 - 1
Userland/Libraries/LibWeb/Bindings/MainThreadVM.h

@@ -84,7 +84,7 @@ ErrorOr<void> initialize_main_thread_vm();
 JS::VM& main_thread_vm();
 
 void queue_mutation_observer_microtask(DOM::Document const&);
-NonnullOwnPtr<JS::ExecutionContext> create_a_new_javascript_realm(JS::VM&, NOESCAPE Function<JS::Object*(JS::Realm&)> create_global_object, NOESCAPE Function<JS::Object*(JS::Realm&)> create_global_this_value);
+NonnullOwnPtr<JS::ExecutionContext> create_a_new_javascript_realm(JS::VM&, Function<JS::Object*(JS::Realm&)> create_global_object, Function<JS::Object*(JS::Realm&)> create_global_this_value);
 void invoke_custom_element_reactions(Vector<JS::Handle<DOM::Element>>& element_queue);
 
 }

+ 2 - 2
Userland/Libraries/LibWeb/DOM/Element.h

@@ -137,9 +137,9 @@ public:
     int client_height() const;
     [[nodiscard]] double current_css_zoom() const;
 
-    void for_each_attribute(NOESCAPE Function<void(Attr const&)>) const;
+    void for_each_attribute(Function<void(Attr const&)>) const;
 
-    void for_each_attribute(NOESCAPE Function<void(FlyString const&, String const&)>) const;
+    void for_each_attribute(Function<void(FlyString const&, String const&)>) const;
 
     bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
     Vector<FlyString> const& class_names() const { return m_classes; }

+ 2 - 2
Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.h

@@ -39,8 +39,8 @@ public:
     TaskQueue& microtask_queue() { return *m_microtask_queue; }
     TaskQueue const& microtask_queue() const { return *m_microtask_queue; }
 
-    void spin_until(NOESCAPE JS::SafeFunction<bool()> goal_condition);
-    void spin_processing_tasks_with_source_until(Task::Source, NOESCAPE JS::SafeFunction<bool()> goal_condition);
+    void spin_until(JS::SafeFunction<bool()> goal_condition);
+    void spin_processing_tasks_with_source_until(Task::Source, JS::SafeFunction<bool()> goal_condition);
     void process();
 
     // https://html.spec.whatwg.org/multipage/browsing-the-web.html#termination-nesting-level

+ 2 - 2
Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h

@@ -35,8 +35,8 @@ public:
         return m_tasks.take_first();
     }
 
-    void remove_tasks_matching(NOESCAPE Function<bool(HTML::Task const&)>);
-    JS::MarkedVector<JS::NonnullGCPtr<Task>> take_tasks_matching(NOESCAPE Function<bool(HTML::Task const&)>);
+    void remove_tasks_matching(Function<bool(HTML::Task const&)>);
+    JS::MarkedVector<JS::NonnullGCPtr<Task>> take_tasks_matching(Function<bool(HTML::Task const&)>);
 
     Task const* last_added_task() const;
 

+ 2 - 2
Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h

@@ -221,7 +221,7 @@ public:
         m_data.get<OwnPtr<Vector<Attribute>>>().clear();
     }
 
-    void for_each_attribute(NOESCAPE Function<IterationDecision(Attribute const&)> callback) const
+    void for_each_attribute(Function<IterationDecision(Attribute const&)> callback) const
     {
         VERIFY(is_start_tag() || is_end_tag());
         auto* ptr = tag_attributes();
@@ -233,7 +233,7 @@ public:
         }
     }
 
-    void for_each_attribute(NOESCAPE Function<IterationDecision(Attribute&)> callback)
+    void for_each_attribute(Function<IterationDecision(Attribute&)> callback)
     {
         VERIFY(is_start_tag() || is_end_tag());
         auto* ptr = tag_attributes();

+ 1 - 1
Userland/Libraries/LibWeb/Platform/EventLoopPlugin.h

@@ -19,7 +19,7 @@ public:
 
     virtual ~EventLoopPlugin();
 
-    virtual void spin_until(NOESCAPE JS::SafeFunction<bool()> goal_condition) = 0;
+    virtual void spin_until(JS::SafeFunction<bool()> goal_condition) = 0;
     virtual void deferred_invoke(JS::SafeFunction<void()>) = 0;
     virtual NonnullRefPtr<Timer> create_timer() = 0;
     virtual void quit() = 0;