From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 09CA13858D20; Sun, 28 Apr 2024 14:37:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09CA13858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714315070; bh=9VlXes8g7PPrXpdzQ1pkYzMb5mTQSd3x9VJYsO2VEIY=; h=From:To:Subject:Date:From; b=PyZzoZ7+RSVgygGwE0ABEMLgWE1jrq0zihPVTAI0mLTzwnzn3fPCM0WqpEvQvwP48 JCxFj4D9FcyyxuA4Rzgv0jeHXgDi0gmSNNZFfCEBVB5GOGHVRMHqh9cDaVQ3tyHzvX aFeJYIVSPoG+NyJssP9HjAyttRaO4oiNHnMLO/9k= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11387] Objective-C/C++: Ensure sufficient setup for the preprocessor. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 310b047f4b723e0dd21a212c8ba051c380030cf4 X-Git-Newrev: acfa562eaa440bf2bd5bd09035bd8bbde5d37d60 Message-Id: <20240428143750.09CA13858D20@sourceware.org> Date: Sun, 28 Apr 2024 14:37:49 +0000 (GMT) List-Id: https://gcc.gnu.org/g:acfa562eaa440bf2bd5bd09035bd8bbde5d37d60 commit r11-11387-gacfa562eaa440bf2bd5bd09035bd8bbde5d37d60 Author: Iain Sandoe Date: Tue Jan 9 17:31:41 2024 +0000 Objective-C/C++: Ensure sufficient setup for the preprocessor. The tokenizer makes use of functions that determine if identifiers are interface or class names, and those functions need a hash map to be set up. This ensures that these are initialized before pre-process-only jobs are run. gcc/objc/ChangeLog: * objc-act.c (objc_init): Initialize interface and class name hash maps before the preprocessor uses them. Signed-off-by: Iain Sandoe (cherry picked from commit 60f58d0630805e8dce79f5489658fd83e42fa8f1) Diff: --- gcc/objc/objc-act.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 536ec028dbd..cb1fcbb2086 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -347,6 +347,11 @@ bool objc_init (void) { bool ok; + + /* Set up stuff used by the preprocessor as well as FE parser. */ + interface_hash_init (); + hash_init (); + #ifdef OBJCPLUS if (cxx_init () == false) #else @@ -376,8 +381,6 @@ objc_init (void) /* Set up stuff used by FE parser and all runtimes. */ errbuf = XNEWVEC (char, 1024 * 10); - interface_hash_init (); - hash_init (); objc_encoding_init (); /* ... and then check flags and set-up for the selected runtime ... */ if (flag_next_runtime && flag_objc_abi >= 2)