Fix check for main function already declared
This commit is contained in:
parent
ab7d138d16
commit
7cd561efd6
@ -526,7 +526,7 @@ fn apply_target_cpu_attr(&self, _llfn: RValue<'gcc>) {
|
||||
|
||||
fn declare_c_main(&self, fn_type: Self::Type) -> Option<Self::Function> {
|
||||
let entry_name = self.sess().target.entry_name.as_ref();
|
||||
if self.get_declared_value(entry_name).is_none() {
|
||||
if !self.functions.borrow().contains_key(entry_name) {
|
||||
Some(self.declare_entry_fn(entry_name, fn_type, ()))
|
||||
} else {
|
||||
// If the symbol already exists, it is an error: for example, the user wrote
|
||||
|
Loading…
Reference in New Issue
Block a user