blob: cbec6fa7d4d611544d15996c2f4effe6eeec9223 [file] [log] [blame]
Chris Lattner2c54a0d2002-07-23 17:56:53 +00001//===-- PluginLoader.cpp - Implement -load command line option ------------===//
John Criswell482202a2003-10-20 19:43:21 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
Chris Lattner2c54a0d2002-07-23 17:56:53 +00009//
Chris Lattner99dcad42004-07-11 01:04:33 +000010// This file implements the -load <plugin> command line option handler.
Chris Lattner2c54a0d2002-07-23 17:56:53 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner99dcad42004-07-11 01:04:33 +000014#define DONT_GET_PLUGIN_LOADER_OPTION
15#include "Support/PluginLoader.h"
Brian Gaeke0cf2da22003-10-10 17:01:49 +000016#include "Support/DynamicLinker.h"
Chris Lattner10073a92002-07-25 06:17:51 +000017#include <iostream>
Chris Lattnerc9499b62003-12-14 21:35:53 +000018using namespace llvm;
Brian Gaeke960707c2003-11-11 22:41:34 +000019
Chris Lattner99dcad42004-07-11 01:04:33 +000020void PluginLoader::operator=(const std::string &Filename) {
21 std::string ErrorMessage;
22 if (LinkDynamicObject(Filename.c_str(), &ErrorMessage))
23 std::cerr << "Error opening '" << Filename << "': " << ErrorMessage
24 << "\n -load request ignored.\n";
Chris Lattner2c54a0d2002-07-23 17:56:53 +000025}