Compare commits
10 commits
e84f76dc58
...
ebdf92b606
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ebdf92b606 | ||
![]() |
f96a54350a | ||
![]() |
e0b57c75e6 | ||
![]() |
d0b41f3d6d | ||
![]() |
e96cb35ceb | ||
![]() |
2e3c91786a | ||
![]() |
901d94e8b4 | ||
![]() |
73d72498f9 | ||
![]() |
9ed95c0697 | ||
![]() |
34c516efbb |
15 changed files with 72 additions and 37 deletions
10
gcc/calls.cc
10
gcc/calls.cc
|
@ -1273,11 +1273,6 @@ void
|
|||
maybe_complain_about_tail_call (tree call_expr, const char *reason)
|
||||
{
|
||||
gcc_assert (TREE_CODE (call_expr) == CALL_EXPR);
|
||||
if (CALL_EXPR_MUST_TAIL_CALL (call_expr))
|
||||
{
|
||||
error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
|
||||
CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0;
|
||||
}
|
||||
if (CALL_EXPR_TAILCALL (call_expr)
|
||||
&& dump_file
|
||||
&& (dump_flags & TDF_DETAILS))
|
||||
|
@ -1286,6 +1281,11 @@ maybe_complain_about_tail_call (tree call_expr, const char *reason)
|
|||
print_generic_expr (dump_file, call_expr, TDF_SLIM);
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
if (CALL_EXPR_MUST_TAIL_CALL (call_expr))
|
||||
{
|
||||
error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
|
||||
CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fill in ARGS_SIZE and ARGS array based on the parameters found in
|
||||
|
|
|
@ -385,10 +385,6 @@ cobol_langhook_handle_option (size_t scode,
|
|||
return true;
|
||||
}
|
||||
|
||||
case OPT_fmax_errors:
|
||||
flag_max_errors = atoi(arg);
|
||||
return true;
|
||||
|
||||
case OPT_ffixed_form:
|
||||
cobol_set_indicator_column(-7);
|
||||
return true;
|
||||
|
@ -413,8 +409,8 @@ cobol_langhook_handle_option (size_t scode,
|
|||
}
|
||||
return true;
|
||||
case OPT_include:
|
||||
if( ! include_file_add(cobol_include) ) {
|
||||
cbl_errx( "could not include %s", cobol_include);
|
||||
if( ! include_file_add(arg) ) {
|
||||
cbl_errx( "could not include %s", arg);
|
||||
}
|
||||
return true;
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ had appeared.
|
|||
Not all exception conditions are implemented. Any that are not
|
||||
produce a warning message.
|
||||
.
|
||||
.It Fl fmax-errors Ar nerror
|
||||
.It Fl fmax-errors Ns Li = Ns Ar nerror
|
||||
.Ar nerror
|
||||
represents the number of error messages produced. Without this option,
|
||||
.Nm
|
||||
|
|
|
@ -77,10 +77,6 @@ ffixed-form
|
|||
Cobol RejectNegative
|
||||
Assume that the source file is fixed form.
|
||||
|
||||
fsyntax-only
|
||||
Cobol RejectNegative
|
||||
; Documented in c.opt
|
||||
|
||||
ffree-form
|
||||
Cobol RejectNegative
|
||||
Assume that the source file is free form.
|
||||
|
@ -93,10 +89,6 @@ finternal-ebcdic
|
|||
Cobol Var(cobol_ebcdic, 1) Init(0)
|
||||
-finternal-ebcdic Internal processing is in EBCDIC Code Page 1140
|
||||
|
||||
fmax-errors
|
||||
Cobol Joined Separate
|
||||
; Documented in C
|
||||
|
||||
fstatic-call
|
||||
Cobol Var(cobol_static_call, 1) Init(1)
|
||||
Enable/disable static linkage for CALL literals
|
||||
|
@ -118,7 +110,7 @@ Cobol Joined Separate
|
|||
; Documented in C
|
||||
|
||||
include
|
||||
Cobol Joined Separate Var(cobol_include)
|
||||
Cobol Joined Separate
|
||||
; Documented in C
|
||||
|
||||
isysroot
|
||||
|
|
|
@ -13,15 +13,9 @@ UrlSuffix(gcc/Directory-Options.html#index-I) LangUrlSuffix_D(gdc/Directory-Opti
|
|||
ffixed-form
|
||||
LangUrlSuffix_Fortran(gfortran/Fortran-Dialect-Options.html#index-ffixed-form)
|
||||
|
||||
fsyntax-only
|
||||
UrlSuffix(gcc/Warning-Options.html#index-fsyntax-only) LangUrlSuffix_D(gdc/Warnings.html#index-fno-syntax-only) LangUrlSuffix_Fortran(gfortran/Error-and-Warning-Options.html#index-fsyntax-only)
|
||||
|
||||
ffree-form
|
||||
LangUrlSuffix_Fortran(gfortran/Fortran-Dialect-Options.html#index-ffree-form)
|
||||
|
||||
fmax-errors
|
||||
UrlSuffix(gcc/Warning-Options.html#index-fmax-errors) LangUrlSuffix_D(gdc/Warnings.html#index-fmax-errors)
|
||||
|
||||
iprefix
|
||||
UrlSuffix(gcc/Directory-Options.html#index-iprefix) LangUrlSuffix_D(gdc/Directory-Options.html#index-iprefix) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-iprefix)
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ init_expmed (void)
|
|||
for (speed = 0; speed < 2; speed++)
|
||||
{
|
||||
crtl->maybe_hot_insn_p = speed;
|
||||
set_zero_cost (speed, set_src_cost (const0_rtx, mode, speed));
|
||||
set_zero_cost (speed, set_src_cost (const0_rtx, QImode, speed));
|
||||
|
||||
for (mode = MIN_MODE_INT; mode <= MAX_MODE_INT;
|
||||
mode = (machine_mode)(mode + 1))
|
||||
|
|
|
@ -83,7 +83,6 @@ const BiMap<std::string, BuiltinMacro> MacroBuiltin::builtins = {{
|
|||
{"Ord", BuiltinMacro::Ord},
|
||||
{"PartialOrd", BuiltinMacro::PartialOrd},
|
||||
{"Hash", BuiltinMacro::Hash},
|
||||
|
||||
}};
|
||||
|
||||
AST::MacroTranscriberFunc
|
||||
|
|
|
@ -325,10 +325,9 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
|
|||
auto pm_def = mappings.lookup_derive_proc_macro_def (
|
||||
definition->get_node_id ());
|
||||
|
||||
rust_assert (pm_def.has_value ());
|
||||
|
||||
mappings.insert_derive_proc_macro_invocation (trait,
|
||||
pm_def.value ());
|
||||
if (pm_def.has_value ())
|
||||
mappings.insert_derive_proc_macro_invocation (trait,
|
||||
pm_def.value ());
|
||||
}
|
||||
}
|
||||
else if (Analysis::BuiltinAttributeMappings::get ()
|
||||
|
|
|
@ -40,12 +40,14 @@ public:
|
|||
static constexpr auto &NO_MANGLE = "no_mangle";
|
||||
static constexpr auto &REPR = "repr";
|
||||
static constexpr auto &RUSTC_BUILTIN_MACRO = "rustc_builtin_macro";
|
||||
static constexpr auto &RUSTC_MACRO_TRANSPARENCY = "rustc_macro_transparency";
|
||||
static constexpr auto &PATH = "path";
|
||||
static constexpr auto &MACRO_USE = "macro_use";
|
||||
static constexpr auto &MACRO_EXPORT = "macro_export";
|
||||
static constexpr auto &PROC_MACRO = "proc_macro";
|
||||
static constexpr auto &PROC_MACRO_DERIVE = "proc_macro_derive";
|
||||
static constexpr auto &PROC_MACRO_ATTRIBUTE = "proc_macro_attribute";
|
||||
|
||||
static constexpr auto &TARGET_FEATURE = "target_feature";
|
||||
// From now on, these are reserved by the compiler and gated through
|
||||
// #![feature(rustc_attrs)]
|
||||
|
@ -54,11 +56,35 @@ public:
|
|||
= "rustc_inherit_overflow_checks";
|
||||
static constexpr auto &STABLE = "stable";
|
||||
static constexpr auto &UNSTABLE = "unstable";
|
||||
|
||||
static constexpr auto &RUSTC_PROMOTABLE = "rustc_promotable";
|
||||
static constexpr auto &RUSTC_CONST_STABLE = "rustc_const_stable";
|
||||
static constexpr auto &RUSTC_CONST_UNSTABLE = "rustc_const_unstable";
|
||||
|
||||
static constexpr auto &RUSTC_SPECIALIZATION_TRAIT
|
||||
= "rustc_specialization_trait";
|
||||
static constexpr auto &RUSTC_UNSAFE_SPECIALIZATION_MARKER
|
||||
= "rustc_unsafe_specialization_marker";
|
||||
static constexpr auto &RUSTC_RESERVATION_IMPL = "rustc_reservation_impl";
|
||||
static constexpr auto &RUSTC_PAREN_SUGAR = "rustc_paren_sugar";
|
||||
static constexpr auto &RUSTC_NONNULL_OPTIMIZATION_GUARANTEED
|
||||
= "rustc_nonnull_optimization_guaranteed";
|
||||
|
||||
static constexpr auto &RUSTC_LAYOUT_SCALAR_VALID_RANGE_START
|
||||
= "rustc_layout_scalar_valid_range_start";
|
||||
|
||||
static constexpr auto &MAY_DANGLE = "may_dangle";
|
||||
static constexpr auto &PRELUDE_IMPORT = "prelude_import";
|
||||
static constexpr auto &TRACK_CALLER = "track_caller";
|
||||
|
||||
static constexpr auto &RUSTC_DIAGNOSTIC_ITEM = "rustc_diagnostic_item";
|
||||
static constexpr auto &RUSTC_ON_UNIMPLEMENTED = "rustc_on_unimplemented";
|
||||
|
||||
static constexpr auto &FUNDAMENTAL = "fundamental";
|
||||
|
||||
static constexpr auto &NON_EXHAUSTIVE = "non_exhaustive";
|
||||
|
||||
static constexpr auto &RUSTFMT = "rustfmt";
|
||||
};
|
||||
} // namespace Values
|
||||
} // namespace Rust
|
||||
|
|
|
@ -57,6 +57,7 @@ static const BuiltinAttrDefinition __definitions[]
|
|||
{Attrs::NO_MANGLE, CODE_GENERATION},
|
||||
{Attrs::REPR, CODE_GENERATION},
|
||||
{Attrs::RUSTC_BUILTIN_MACRO, EXPANSION},
|
||||
{Attrs::RUSTC_MACRO_TRANSPARENCY, EXPANSION},
|
||||
{Attrs::PATH, EXPANSION},
|
||||
{Attrs::MACRO_USE, NAME_RESOLUTION},
|
||||
{Attrs::MACRO_EXPORT, NAME_RESOLUTION},
|
||||
|
@ -72,11 +73,29 @@ static const BuiltinAttrDefinition __definitions[]
|
|||
{Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
|
||||
{Attrs::STABLE, STATIC_ANALYSIS},
|
||||
{Attrs::UNSTABLE, STATIC_ANALYSIS},
|
||||
|
||||
// assuming we keep these for static analysis
|
||||
{Attrs::RUSTC_PROMOTABLE, CODE_GENERATION},
|
||||
{Attrs::RUSTC_CONST_STABLE, STATIC_ANALYSIS},
|
||||
{Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS},
|
||||
{Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
|
||||
{Attrs::TRACK_CALLER, CODE_GENERATION}};
|
||||
{Attrs::TRACK_CALLER, CODE_GENERATION},
|
||||
{Attrs::RUSTC_SPECIALIZATION_TRAIT, TYPE_CHECK},
|
||||
{Attrs::RUSTC_UNSAFE_SPECIALIZATION_MARKER, TYPE_CHECK},
|
||||
{Attrs::RUSTC_RESERVATION_IMPL, TYPE_CHECK},
|
||||
{Attrs::RUSTC_PAREN_SUGAR, TYPE_CHECK},
|
||||
{Attrs::RUSTC_NONNULL_OPTIMIZATION_GUARANTEED, TYPE_CHECK},
|
||||
|
||||
{Attrs::RUSTC_LAYOUT_SCALAR_VALID_RANGE_START, CODE_GENERATION},
|
||||
|
||||
{Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
|
||||
|
||||
{Attrs::RUSTC_DIAGNOSTIC_ITEM, STATIC_ANALYSIS},
|
||||
{Attrs::RUSTC_ON_UNIMPLEMENTED, STATIC_ANALYSIS},
|
||||
|
||||
{Attrs::FUNDAMENTAL, TYPE_CHECK},
|
||||
{Attrs::NON_EXHAUSTIVE, TYPE_CHECK},
|
||||
{Attrs::RUSTFMT, EXTERNAL}};
|
||||
|
||||
BuiltinAttributeMappings *
|
||||
BuiltinAttributeMappings::get ()
|
||||
|
|
|
@ -40,7 +40,12 @@ enum CompilerPass
|
|||
HIR_LOWERING,
|
||||
TYPE_CHECK,
|
||||
STATIC_ANALYSIS,
|
||||
CODE_GENERATION
|
||||
CODE_GENERATION,
|
||||
|
||||
// External Rust tooling attributes, like #[rustfmt::skip]
|
||||
EXTERNAL,
|
||||
|
||||
// Do we need to add something here for const fns?
|
||||
};
|
||||
|
||||
struct BuiltinAttrDefinition
|
||||
|
|
|
@ -118,6 +118,7 @@ const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
|
|||
|
||||
{"discriminant_kind", Kind::DISCRIMINANT_KIND},
|
||||
{"discriminant_type", Kind::DISCRIMINANT_TYPE},
|
||||
{"manually_drop", Kind::MANUALLY_DROP},
|
||||
}};
|
||||
|
||||
tl::optional<LangItem::Kind>
|
||||
|
|
|
@ -150,6 +150,8 @@ public:
|
|||
|
||||
DISCRIMINANT_TYPE,
|
||||
DISCRIMINANT_KIND,
|
||||
|
||||
MANUALLY_DROP,
|
||||
};
|
||||
|
||||
static const BiMap<std::string, Kind> lang_items;
|
||||
|
|
|
@ -5,8 +5,8 @@ struct a {
|
|||
int b;
|
||||
};
|
||||
int c;
|
||||
char d;
|
||||
static int e(long f) { return f < 0; }
|
||||
signed char d;
|
||||
static int e(long long f) { return f < 0; }
|
||||
static void g(unsigned f) { c = e(~f); }
|
||||
int main() {
|
||||
int h;
|
||||
|
|
|
@ -3201,6 +3201,8 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
|
|||
pp_string (pp, " [return slot optimization]");
|
||||
if (CALL_EXPR_TAILCALL (node))
|
||||
pp_string (pp, " [tail call]");
|
||||
if (CALL_EXPR_MUST_TAIL_CALL (node))
|
||||
pp_string (pp, " [must tail call]");
|
||||
break;
|
||||
|
||||
case WITH_CLEANUP_EXPR:
|
||||
|
|
Loading…
Add table
Reference in a new issue