bool NamespecAction::activate(InputBuilder& pBuilder) const { sys::fs::Path* path = NULL; // find out the real path of the namespec. if (pBuilder.getConstraint().isSharedSystem()) { // In the system with shared object support, we can find both archive // and shared object. if (pBuilder.getAttributes().isStatic()) { // with --static, we must search an archive. path = m_SearchDirs.find(namespec(), Input::Archive); } else { // otherwise, with --Bdynamic, we can find either an archive or a // shared object. path = m_SearchDirs.find(namespec(), Input::DynObj); } } else { // In the system without shared object support, we only look for an archive path = m_SearchDirs.find(namespec(), Input::Archive); } if (NULL == path) { fatal(diag::err_cannot_find_namespec) << namespec(); return false; } pBuilder.createNode<InputTree::Positional>(namespec(), *path); return true; }
bool StartGroupAction::activate(InputBuilder& pBuilder) const { if (pBuilder.isInGroup()) { fatal(diag::fatal_forbid_nest_group); return false; } pBuilder.enterGroup(); return true; }
bool DefSymAction::activate(InputBuilder& pBuilder) const { pBuilder.createNode<InputTree::Positional>("defsym", sys::fs::Path("NAN")); Input* input = *pBuilder.getCurrentNode(); pBuilder.setContext(*input, false); m_Assignment.append(";"); pBuilder.setMemory(*input, &m_Assignment[0], m_Assignment.size()); return true; }
bool MemoryAreaAction::activate(InputBuilder& pBuilder) const { Input* input = *pBuilder.getCurrentNode(); if (input->hasMemArea()) return false; // already got type - for example, bitcode if (input->type() == Input::Script || input->type() == Input::Object || input->type() == Input::DynObj || input->type() == Input::Archive) return false; return pBuilder.setMemory(*input, m_Mode, m_Permission); }
bool ContextAction::activate(InputBuilder& pBuilder) const { Input* input = *pBuilder.getCurrentNode(); if (input->hasContext()) return false; // already got type - for example, bitcode if (input->type() == Input::Script || input->type() == Input::Object || input->type() == Input::DynObj || input->type() == Input::Archive) return false; return pBuilder.setContext(*input); }
bool BStaticAction::activate(InputBuilder& pBuilder) const { pBuilder.getAttributes().setStatic(); return true; }
bool NoAddNeededAction::activate(InputBuilder& pBuilder) const { pBuilder.getAttributes().unsetAddNeeded(); return true; }
bool NoWholeArchiveAction::activate(InputBuilder& pBuilder) const { pBuilder.getAttributes().unsetWholeArchive(); return true; }
bool EndGroupAction::activate(InputBuilder& pBuilder) const { pBuilder.exitGroup(); return true; }