summaryrefslogtreecommitdiff
path: root/include/nasm.h
diff options
context:
space:
mode:
authorChang S. Bae <chang.seok.bae@intel.com>2018-08-15 23:22:21 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-08-16 00:01:31 +0300
commita578634b61615a4a0d5e51b1d1b046efdbd9867d (patch)
tree407145147c4fde868383826d2c4b0599307dee33 /include/nasm.h
parentccd2d5c542c27c53f8dd547c817303845c7ca6dc (diff)
downloadnasm-a578634b61615a4a0d5e51b1d1b046efdbd9867d.tar.gz
optimization: Introduce new flag to turn-off selectively
While configuring optimization in a level is conventional, a certain optimization tends to conflict with some pragma. For example, jump match conflicts with Mach-O's "subsections-via-symbols" macro. This configurability will workaround such conflicts. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Diffstat (limited to 'include/nasm.h')
-rw-r--r--include/nasm.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/nasm.h b/include/nasm.h
index b9f730c8..020e363b 100644
--- a/include/nasm.h
+++ b/include/nasm.h
@@ -1248,11 +1248,25 @@ enum decorator_tokens {
* 2 = pass 2
*/
+/*
+ * flag to disable optimizations selectively
+ * this is useful to turn-off certain optimizations
+ */
+enum optimization_disable_flag {
+ OPTIM_ALL_ENABLED = 0,
+ OPTIM_DISABLE_JMP_MATCH = 1
+};
+
+struct optimization {
+ int level;
+ int flag;
+};
+
extern int pass0;
extern int64_t passn; /* Actual pass number */
extern bool tasm_compatible_mode;
-extern int optimizing;
+extern struct optimization optimizing;
extern int globalbits; /* 16, 32 or 64-bit mode */
extern int globalrel; /* default to relative addressing? */
extern int globalbnd; /* default to using bnd prefix? */