1 //===- SearchDirCmd.cpp ---------------------------------------------------===//
2 //
3 //                     The MCLinker Project
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include "mcld/Script/SearchDirCmd.h"
10 
11 #include "mcld/Support/raw_ostream.h"
12 #include "mcld/LinkerScript.h"
13 #include "mcld/Module.h"
14 
15 namespace mcld {
16 
17 //===----------------------------------------------------------------------===//
18 // SearchDirCmd
19 //===----------------------------------------------------------------------===//
SearchDirCmd(const std::string & pPath)20 SearchDirCmd::SearchDirCmd(const std::string& pPath)
21     : ScriptCommand(ScriptCommand::SEARCH_DIR), m_Path(pPath) {
22 }
23 
~SearchDirCmd()24 SearchDirCmd::~SearchDirCmd() {
25 }
26 
dump() const27 void SearchDirCmd::dump() const {
28   mcld::outs() << "SEARCH_DIR ( " << m_Path << " )\n";
29 }
30 
activate(Module & pModule)31 void SearchDirCmd::activate(Module& pModule) {
32   pModule.getScript().directories().insert(m_Path);
33 }
34 
35 }  // namespace mcld
36