Closed Bug 584164 Opened 15 years ago Closed 15 years ago

dehydra: use finish_decl callback

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ehren.m, Assigned: ehren.m)

Details

Attachments

(1 file, 3 obsolete files)

Attached patch patch (obsolete) — Splinter Review
I looked into using bhackett's patch (https://bugzilla.mozilla.org/show_bug.cgi?id=559964#c70) to replace more of the core plugin eg remove the global_namespace processing... didn't have too much success. This patch will give us process_tree_decl with C though. (Uses --with-finish-decl configure option)
Attachment #462484 - Flags: review?(tglek)
Comment on attachment 462484 [details] [diff] [review] patch >+ elif o == "--with-finish-decl": >+ finishdecl = True I'd rather configure execute a program to check if PLUGIN_FINISH_DECL is defined.
Attachment #462484 - Flags: review?(tglek) → review-
Attached patch patch v2 (obsolete) — Splinter Review
with configure time compile
Attachment #462484 - Attachment is obsolete: true
Attachment #463229 - Flags: review?(tglek)
Comment on attachment 463229 [details] [diff] [review] patch v2 > >+def try_enable_finish_decl(config): >+ print("Checking for FINISH_DECL callback:") >+ cxx = config["CXX"] >+ cout, cin = popen2.popen2("mktemp --suffix=.c") >+ fname = cout.read() >+ popen2.popen2("echo '#include \"gcc-plugin.h\"\nenum plugin_event p = PLUGIN_FINISH_DECL;' > " + fname) I believe Python has a triple """ multiline quote for this :) >+ cmd = "cc -c -o /dev/null " + config["GCC_PLUGIN_HEADERS"] + " " + fname >+ cout, cin, cerr = popen2.popen3(cmd) >+ if len(cerr.read()) == 0: Check the exit code instead. >+ config['FINISH_DECL'] = "yes" >+ print("FINISH_DECL callback enabled"); >+ else: >+ print("FINISH_DECL callback disabled"); >+ popen2.popen2("rm -f " + fname) Use a python function for deleting.
Attachment #463229 - Flags: review?(tglek) → review-
Attached patch patch v3 (obsolete) — Splinter Review
might do it
Attachment #463229 - Attachment is obsolete: true
Attachment #463345 - Flags: review?(tglek)
Comment on attachment 463345 [details] [diff] [review] patch v3 >+def try_enable_finish_decl(config): >+ print("Checking for FINISH_DECL callback:") >+ cxx = config["CXX"] >+ cout, cin = popen2.popen2("mktemp --suffix=.c") >+ fname = cout.read().rstrip() >+ popen2.popen2("""echo '#include "gcc-plugin.h" >+ enum plugin_event p = PLUGIN_FINISH_DECL;' > """ + fname) Sorry, I didn't even notice the echo in there. Use python's tempfile api to generate file. Write to file from python. This isn't a shell program :) format the quoted stuff on own lines .write( """#include <> ...""" ) Almost there.
Attachment #463345 - Flags: review?(tglek) → review-
Attached patch patch v4Splinter Review
a bit more pythonic
Attachment #463345 - Attachment is obsolete: true
Attachment #463385 - Flags: review?(tglek)
Comment on attachment 463385 [details] [diff] [review] patch v4 Nice
Attachment #463385 - Flags: review?(tglek) → review+
Assignee: nobody → ehren.m
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: