| Index: src/globals.h
|
| diff --git a/src/globals.h b/src/globals.h
|
| index f01c10044e9815d02c861075058e399b5a4356a7..912f22117d984b557fc5a4d988c4e2528ca881e6 100644
|
| --- a/src/globals.h
|
| +++ b/src/globals.h
|
| @@ -253,6 +253,17 @@ enum LanguageMode {
|
| };
|
|
|
|
|
| +enum AsmMode {
|
| + ASM_FUNCTION_BIT = 1 << 0,
|
| + ASM_MODULE_BIT = 1 << 1,
|
| + ASM_END,
|
| +
|
| + ASM_NO = 0,
|
| + ASM_FUNCTION = ASM_FUNCTION_BIT,
|
| + ASM_MODULE = ASM_MODULE_BIT
|
| +};
|
| +
|
| +
|
| inline std::ostream& operator<<(std::ostream& os, const LanguageMode& mode) {
|
| switch (mode) {
|
| case SLOPPY:
|
| @@ -297,6 +308,21 @@ inline LanguageMode construct_language_mode(bool strict_bit, bool strong_bit) {
|
| }
|
|
|
|
|
| +inline bool is_valid_asm_mode(int asm_mode) {
|
| + return asm_mode == ASM_NO || asm_mode == ASM_FUNCTION ||
|
| + asm_mode == ASM_MODULE;
|
| +}
|
| +
|
| +
|
| +inline AsmMode construct_asm_mode(bool asm_function, bool asm_module) {
|
| + int asm_mode = 0;
|
| + if (asm_function) asm_mode |= ASM_FUNCTION_BIT;
|
| + if (asm_module) asm_mode |= ASM_MODULE_BIT;
|
| + DCHECK(is_valid_asm_mode(asm_mode));
|
| + return static_cast<AsmMode>(asm_mode);
|
| +}
|
| +
|
| +
|
| inline ObjectStrength strength(LanguageMode language_mode) {
|
| return is_strong(language_mode) ? FIRM : WEAK;
|
| }
|
|
|