1f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//===- SearchDirCmd.cpp ---------------------------------------------------===//
2f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//
3f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//                     The MCLinker Project
4f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//
5f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines// This file is distributed under the University of Illinois Open Source
6f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines// License. See LICENSE.TXT for details.
7f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//
8f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//===----------------------------------------------------------------------===//
937b74a387bb3993387029859c2d9d051c41c724eStephen Hines#include "mcld/Script/SearchDirCmd.h"
10f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
1137b74a387bb3993387029859c2d9d051c41c724eStephen Hines#include "mcld/Support/raw_ostream.h"
1237b74a387bb3993387029859c2d9d051c41c724eStephen Hines#include "mcld/LinkerScript.h"
1337b74a387bb3993387029859c2d9d051c41c724eStephen Hines#include "mcld/Module.h"
1437b74a387bb3993387029859c2d9d051c41c724eStephen Hines
1537b74a387bb3993387029859c2d9d051c41c724eStephen Hinesnamespace mcld {
16f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
17f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//===----------------------------------------------------------------------===//
18f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines// SearchDirCmd
19f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines//===----------------------------------------------------------------------===//
20f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen HinesSearchDirCmd::SearchDirCmd(const std::string& pPath)
2137b74a387bb3993387029859c2d9d051c41c724eStephen Hines    : ScriptCommand(ScriptCommand::SEARCH_DIR), m_Path(pPath) {
22f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines}
23f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
2437b74a387bb3993387029859c2d9d051c41c724eStephen HinesSearchDirCmd::~SearchDirCmd() {
25f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines}
26f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
2737b74a387bb3993387029859c2d9d051c41c724eStephen Hinesvoid SearchDirCmd::dump() const {
28f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines  mcld::outs() << "SEARCH_DIR ( " << m_Path << " )\n";
29f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines}
30f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
3137b74a387bb3993387029859c2d9d051c41c724eStephen Hinesvoid SearchDirCmd::activate(Module& pModule) {
32f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines  pModule.getScript().directories().insert(m_Path);
33f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines}
34f33f6de54db174aa679a4b6d1e040d37e95541c0Stephen Hines
3537b74a387bb3993387029859c2d9d051c41c724eStephen Hines}  // namespace mcld
36