Skip to content

Commit

Permalink
create all ruby methods/blocks with private linkage except the main o…
Browse files Browse the repository at this point in the history
…ne (AOT compiler only)

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@2438 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
lrz committed Aug 30, 2009
1 parent a7bf7ac commit bbfc278
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,8 @@ RoxorCompiler::compile_node(NODE *node)
types.push_back(RubyObjTy);
}
FunctionType *ft = FunctionType::get(RubyObjTy, types, false);
Function *f = cast<Function>(module->getOrInsertFunction("", ft));
Function *f = Function::Create(ft, GlobalValue::PrivateLinkage,
"", module);

BasicBlock *old_rescue_bb = rescue_bb;
BasicBlock *old_entry_bb = entry_bb;
Expand Down Expand Up @@ -4985,6 +4986,7 @@ RoxorAOTCompiler::compile_main_function(NODE *node)
Value *val = compile_node(node);
assert(Function::classof(val));
Function *function = cast<Function>(val);
function->setLinkage(GlobalValue::ExternalLinkage);

BasicBlock::InstListType &list =
function->getEntryBlock().getInstList();
Expand Down

0 comments on commit bbfc278

Please sign in to comment.