diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2024-01-09 17:31:41 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2024-04-28 15:37:17 +0100 |
commit | acfa562eaa440bf2bd5bd09035bd8bbde5d37d60 (patch) | |
tree | f24c2fb072dd311f90989edc190a73fb42d869bb /gcc/objc/objc-act.c | |
parent | 310b047f4b723e0dd21a212c8ba051c380030cf4 (diff) | |
download | gcc-acfa562eaa440bf2bd5bd09035bd8bbde5d37d60.zip gcc-acfa562eaa440bf2bd5bd09035bd8bbde5d37d60.tar.gz gcc-acfa562eaa440bf2bd5bd09035bd8bbde5d37d60.tar.bz2 |
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 <iain@sandoe.co.uk>
(cherry picked from commit 60f58d0630805e8dce79f5489658fd83e42fa8f1)
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 536ec02..cb1fcbb 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) |