[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reach
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays. |
Date: |
Thu, 9 Mar 2023 10:58:38 -0500 (EST) |
branch: externals/beardbolt
commit 5deed3972ece757f9a32c2c66739fa4f00d21fc0
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
* beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays.
---
beardbolt.el | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/beardbolt.el b/beardbolt.el
index 40fd89bfa2..2c3a3ea719 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -394,25 +394,23 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN
CMD)."
(cl-defun bb--reachable-p (label globals graph synonyms weaks)
(let ((synonym (gethash label synonyms)))
- (cond ((and (not (buffer-local-value 'bb-preserve-library-functions
- bb--source-buffer))
- (gethash label weaks))
+ (cond ((and weaks (intern-soft label weaks))
nil)
- ((gethash label globals) t)
+ ((intern-soft label globals) t)
(t
(maphash (lambda (from to)
- (when (and (or (gethash label to)
- (and synonym (gethash synonym to)))
+ (when (and (or (intern-soft label to)
+ (and synonym (intern-soft synonym to)))
(bb--reachable-p from globals graph synonyms
weaks))
(cl-return-from bb--reachable-p
(progn
- (when synonym (puthash synonym t globals))
- (puthash label t globals)))))
+ (when synonym (intern synonym globals))
+ (intern label globals)))))
graph)))))
(defun bb--process-asm ()
- (let ((globals (make-hash-table :test #'equal))
- (weaks (make-hash-table :test #'equal))
+ (let ((globals (obarray-make))
+ (weaks (obarray-make))
(synonyms (make-hash-table :test #'equal))
(label-graph (make-hash-table :test #'equal))
(src-file-name "<stdin>")
@@ -422,7 +420,8 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN
CMD)."
reachable-label
demangle-ovs
(preserve-comments (buffer-local-value 'bb-preserve-comments
bb--source-buffer))
- (preserve-labels (buffer-local-value 'bb-preserve-labels
bb--source-buffer)))
+ (preserve-labels (buffer-local-value 'bb-preserve-labels
bb--source-buffer))
+ (preserve-library-functions (buffer-local-value
'bb-preserve-library-functions bb--source-buffer)))
(cl-flet ((schedule-demangling-maybe (from to)
(when (and (eq (char-after from) ?_)
(not (bb--demangle-quick from to)))
@@ -433,7 +432,7 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN
CMD)."
(bb--sweeping
((match bb-data-defn) :preserve)
((match bb-label-start)
- (when (gethash (match-string 1) globals)
+ (when (intern-soft (match-string 1) globals)
(setq global-label (match-string 1)))
:preserve)
((match bb-source-tag)
@@ -450,19 +449,18 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN
CMD)."
(list 'bb-src-line source-linum)))
(when global-label
(while (match bb-label-reference)
- (puthash (match-string 0)
- t
- (or (gethash global-label label-graph)
- (puthash global-label (make-hash-table :test #'equal)
- label-graph)))
+ (intern (match-string 0)
+ (or (gethash global-label label-graph)
+ (puthash global-label (obarray-make)
+ label-graph)))
(schedule-demangling-maybe (match-beginning 0) (match-end 0))
(update-lep)))
:preserve)
((and (not preserve-comments) (match bb-comment-only)) :kill)
((match bb-defines-global bb-defines-function-or-object)
- (puthash (match-string 1) t globals))
- ((match bb-defines-weak)
- (puthash (match-string 1) t weaks))
+ (intern (match-string 1) globals))
+ ((and (not preserve-library-functions) (match bb-defines-weak))
+ (intern (match-string 1) weaks))
((match bb-source-file-hint)
(puthash (string-to-number (match-string 1))
(or (match-string 3) (match-string 2))
@@ -482,7 +480,8 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN
CMD)."
:preserve)
((match bb-label-start)
(cond
- ((bb--reachable-p (match-string 1) globals label-graph synonyms
weaks)
+ ((bb--reachable-p (match-string 1) globals label-graph synonyms
+ (unless preserve-library-functions weaks))
(setq reachable-label (match-string 1))
(schedule-demangling-maybe (match-beginning 0) (match-end 0))
:preserve)
- [elpa] externals/beardbolt 9b1a5abbdf 208/323: Strip -flto flag from compile_commands.json by default, (continued)
- [elpa] externals/beardbolt 9b1a5abbdf 208/323: Strip -flto flag from compile_commands.json by default, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d257e51fce 244/323: starters/zig: Automatically export functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ebbdebc66f 239/323: Improve compilation buffer display UX, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f6b72fe0eb 248/323: First stab at rainbow overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3cace942b8 251/323: Fix buffer selection problems, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 041234b499 241/323: Improve auto-compilation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2421b29094 255/323: Remove .ert-runner, .gitlab-ci.yml and Cask, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 49e2500be1 259/323: Use shorthands so I can just type bb- instead of beardbolt-, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 58b07a215c 268/323: Simplify some code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9f6d1cf10c 269/323: Remove some rmsbolt remnants, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays.,
ELPA Syncer <=
- [elpa] externals/beardbolt 291f82a324 266/323: Continue rewriting, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a13f8fe7f4 287/323: Reset beardbolt-specific locals before hacking them in, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 85d24d69f1 286/323: Add bb-kill-symbol-re option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 10fe7307c3 291/323: Get a better C++ starter example, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5324775417 321/323: Add beardbolt-shuffle-rainbow option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 90b5cad9c1 016/323: Finish initial implementation of dissasembly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt de183bea12 010/323: Add support for c++ and c, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 627dd4c1c9 059/323: Allow for custom asm processing functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 978d8290a1 067/323: Add guide on adding new languages, ELPA Syncer, 2023/03/09