Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 1 | //===-- driver.cpp - Clang GCC-Compatible Driver --------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Daniel Dunbar | 1eb4e64 | 2009-03-03 05:55:11 +0000 | [diff] [blame] | 10 | // This is the entry point to the clang driver; it is a thin wrapper |
| 11 | // for functionality in the Driver clang library. |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "clang/Driver/Compilation.h" |
| 16 | #include "clang/Driver/Driver.h" |
Daniel Dunbar | 2c6f6f3 | 2009-03-04 08:33:23 +0000 | [diff] [blame] | 17 | #include "clang/Driver/Option.h" |
Daniel Dunbar | 2c6f6f3 | 2009-03-04 08:33:23 +0000 | [diff] [blame] | 18 | |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/SmallString.h" |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 20 | #include "llvm/ADT/OwningPtr.h" |
Daniel Dunbar | dd98e2c | 2009-03-10 23:41:59 +0000 | [diff] [blame] | 21 | #include "llvm/Config/config.h" |
Daniel Dunbar | 8f25c79 | 2009-03-18 01:38:48 +0000 | [diff] [blame] | 22 | #include "llvm/Support/ManagedStatic.h" |
| 23 | #include "llvm/Support/PrettyStackTrace.h" |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 24 | #include "llvm/Support/Regex.h" |
Daniel Dunbar | 4ad4b3e | 2009-03-12 08:55:43 +0000 | [diff] [blame] | 25 | #include "llvm/Support/raw_ostream.h" |
Daniel Dunbar | af07f93 | 2009-03-31 17:35:15 +0000 | [diff] [blame] | 26 | #include "llvm/System/Host.h" |
Daniel Dunbar | 365c02f | 2009-03-10 20:52:46 +0000 | [diff] [blame] | 27 | #include "llvm/System/Path.h" |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 28 | #include "llvm/System/Signals.h" |
Daniel Dunbar | 4ad4b3e | 2009-03-12 08:55:43 +0000 | [diff] [blame] | 29 | using namespace clang; |
Daniel Dunbar | 1b3bb6e | 2009-03-04 20:49:20 +0000 | [diff] [blame] | 30 | using namespace clang::driver; |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 31 | |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 32 | class DriverDiagnosticPrinter : public DiagnosticClient { |
| 33 | std::string ProgName; |
| 34 | llvm::raw_ostream &OS; |
| 35 | |
| 36 | public: |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 37 | DriverDiagnosticPrinter(const std::string _ProgName, |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 38 | llvm::raw_ostream &_OS) |
| 39 | : ProgName(_ProgName), |
| 40 | OS(_OS) {} |
| 41 | |
| 42 | virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, |
| 43 | const DiagnosticInfo &Info); |
| 44 | }; |
| 45 | |
| 46 | void DriverDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, |
| 47 | const DiagnosticInfo &Info) { |
| 48 | OS << ProgName << ": "; |
| 49 | |
| 50 | switch (Level) { |
| 51 | case Diagnostic::Ignored: assert(0 && "Invalid diagnostic type"); |
| 52 | case Diagnostic::Note: OS << "note: "; break; |
| 53 | case Diagnostic::Warning: OS << "warning: "; break; |
| 54 | case Diagnostic::Error: OS << "error: "; break; |
| 55 | case Diagnostic::Fatal: OS << "fatal error: "; break; |
| 56 | } |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 57 | |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 58 | llvm::SmallString<100> OutStr; |
| 59 | Info.FormatDiagnostic(OutStr); |
| 60 | OS.write(OutStr.begin(), OutStr.size()); |
| 61 | OS << '\n'; |
| 62 | } |
| 63 | |
Rafael Espindola | 0f4c59c | 2009-12-04 19:31:58 +0000 | [diff] [blame] | 64 | llvm::sys::Path GetExecutablePath(const char *Argv0, bool CanonicalPrefixes) { |
| 65 | if (!CanonicalPrefixes) |
| 66 | return llvm::sys::Path(Argv0); |
| 67 | |
Daniel Dunbar | 734932c | 2009-03-18 20:25:53 +0000 | [diff] [blame] | 68 | // This just needs to be some symbol in the binary; C++ doesn't |
| 69 | // allow taking the address of ::main however. |
| 70 | void *P = (void*) (intptr_t) GetExecutablePath; |
| 71 | return llvm::sys::Path::GetMainExecutable(Argv0, P); |
| 72 | } |
| 73 | |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 74 | static const char *SaveStringInSet(std::set<std::string> &SavedStrings, |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 75 | llvm::StringRef S) { |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 76 | return SavedStrings.insert(S).first->c_str(); |
| 77 | } |
| 78 | |
| 79 | /// ApplyQAOverride - Apply a list of edits to the input argument lists. |
| 80 | /// |
| 81 | /// The input string is a space separate list of edits to perform, |
| 82 | /// they are applied in order to the input argument lists. Edits |
| 83 | /// should be one of the following forms: |
| 84 | /// |
Daniel Dunbar | e3d6023 | 2009-07-16 21:32:51 +0000 | [diff] [blame] | 85 | /// '#': Silence information about the changes to the command line arguments. |
| 86 | /// |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 87 | /// '^': Add FOO as a new argument at the beginning of the command line. |
| 88 | /// |
| 89 | /// '+': Add FOO as a new argument at the end of the command line. |
| 90 | /// |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 91 | /// 's/XXX/YYY/': Substitute the regular expression XXX with YYY in the command |
| 92 | /// line. |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 93 | /// |
| 94 | /// 'xOPTION': Removes all instances of the literal argument OPTION. |
| 95 | /// |
| 96 | /// 'XOPTION': Removes all instances of the literal argument OPTION, |
| 97 | /// and the following argument. |
| 98 | /// |
| 99 | /// 'Ox': Removes all flags matching 'O' or 'O[sz0-9]' and adds 'Ox' |
| 100 | /// at the end of the command line. |
Daniel Dunbar | e3d6023 | 2009-07-16 21:32:51 +0000 | [diff] [blame] | 101 | /// |
| 102 | /// \param OS - The stream to write edit information to. |
| 103 | /// \param Args - The vector of command line arguments. |
| 104 | /// \param Edit - The override command to perform. |
| 105 | /// \param SavedStrings - Set to use for storing string representations. |
| 106 | void ApplyOneQAOverride(llvm::raw_ostream &OS, |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 107 | std::vector<const char*> &Args, |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 108 | llvm::StringRef Edit, |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 109 | std::set<std::string> &SavedStrings) { |
| 110 | // This does not need to be efficient. |
| 111 | |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 112 | if (Edit[0] == '^') { |
| 113 | const char *Str = |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 114 | SaveStringInSet(SavedStrings, Edit.substr(1)); |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 115 | OS << "### Adding argument " << Str << " at beginning\n"; |
| 116 | Args.insert(Args.begin() + 1, Str); |
| 117 | } else if (Edit[0] == '+') { |
| 118 | const char *Str = |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 119 | SaveStringInSet(SavedStrings, Edit.substr(1)); |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 120 | OS << "### Adding argument " << Str << " at end\n"; |
| 121 | Args.push_back(Str); |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 122 | } else if (Edit[0] == 's' && Edit[1] == '/' && Edit.endswith("/") && |
| 123 | Edit.slice(2, Edit.size()-1).find('/') != llvm::StringRef::npos) { |
| 124 | llvm::StringRef MatchPattern = Edit.substr(2).split('/').first; |
| 125 | llvm::StringRef ReplPattern = Edit.substr(2).split('/').second; |
| 126 | ReplPattern = ReplPattern.slice(0, ReplPattern.size()-1); |
| 127 | |
| 128 | for (unsigned i = 1, e = Args.size(); i != e; ++i) { |
| 129 | std::string Repl = llvm::Regex(MatchPattern).sub(ReplPattern, Args[i]); |
| 130 | |
| 131 | if (Repl != Args[i]) { |
| 132 | OS << "### Replacing '" << Args[i] << "' with '" << Repl << "'\n"; |
| 133 | Args[i] = SaveStringInSet(SavedStrings, Repl); |
| 134 | } |
| 135 | } |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 136 | } else if (Edit[0] == 'x' || Edit[0] == 'X') { |
| 137 | std::string Option = Edit.substr(1, std::string::npos); |
| 138 | for (unsigned i = 1; i < Args.size();) { |
| 139 | if (Option == Args[i]) { |
| 140 | OS << "### Deleting argument " << Args[i] << '\n'; |
| 141 | Args.erase(Args.begin() + i); |
| 142 | if (Edit[0] == 'X') { |
| 143 | if (i < Args.size()) { |
| 144 | OS << "### Deleting argument " << Args[i] << '\n'; |
| 145 | Args.erase(Args.begin() + i); |
| 146 | } else |
| 147 | OS << "### Invalid X edit, end of command line!\n"; |
| 148 | } |
| 149 | } else |
| 150 | ++i; |
| 151 | } |
| 152 | } else if (Edit[0] == 'O') { |
| 153 | for (unsigned i = 1; i < Args.size();) { |
| 154 | const char *A = Args[i]; |
| 155 | if (A[0] == '-' && A[1] == 'O' && |
| 156 | (A[2] == '\0' || |
| 157 | (A[3] == '\0' && (A[2] == 's' || A[2] == 'z' || |
| 158 | ('0' <= A[2] && A[2] <= '9'))))) { |
| 159 | OS << "### Deleting argument " << Args[i] << '\n'; |
| 160 | Args.erase(Args.begin() + i); |
| 161 | } else |
| 162 | ++i; |
| 163 | } |
| 164 | OS << "### Adding argument " << Edit << " at end\n"; |
Daniel Dunbar | 0de9a7b | 2010-02-17 21:00:34 +0000 | [diff] [blame^] | 165 | Args.push_back(SaveStringInSet(SavedStrings, '-' + Edit.str())); |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 166 | } else { |
| 167 | OS << "### Unrecognized edit: " << Edit << "\n"; |
| 168 | } |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | /// ApplyQAOverride - Apply a comma separate list of edits to the |
| 172 | /// input argument lists. See ApplyOneQAOverride. |
| 173 | void ApplyQAOverride(std::vector<const char*> &Args, const char *OverrideStr, |
| 174 | std::set<std::string> &SavedStrings) { |
Daniel Dunbar | e3d6023 | 2009-07-16 21:32:51 +0000 | [diff] [blame] | 175 | llvm::raw_ostream *OS = &llvm::errs(); |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 176 | |
Daniel Dunbar | e3d6023 | 2009-07-16 21:32:51 +0000 | [diff] [blame] | 177 | if (OverrideStr[0] == '#') { |
| 178 | ++OverrideStr; |
| 179 | OS = &llvm::nulls(); |
| 180 | } |
| 181 | |
| 182 | *OS << "### QA_OVERRIDE_GCC3_OPTIONS: " << OverrideStr << "\n"; |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 183 | |
| 184 | // This does not need to be efficient. |
| 185 | |
| 186 | const char *S = OverrideStr; |
| 187 | while (*S) { |
| 188 | const char *End = ::strchr(S, ' '); |
| 189 | if (!End) |
| 190 | End = S + strlen(S); |
| 191 | if (End != S) |
Daniel Dunbar | e3d6023 | 2009-07-16 21:32:51 +0000 | [diff] [blame] | 192 | ApplyOneQAOverride(*OS, Args, std::string(S, End), SavedStrings); |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 193 | S = End; |
| 194 | if (*S != '\0') |
| 195 | ++S; |
| 196 | } |
| 197 | } |
| 198 | |
Daniel Dunbar | c88aa79 | 2009-11-30 07:18:13 +0000 | [diff] [blame] | 199 | extern int cc1_main(const char **ArgBegin, const char **ArgEnd, |
Daniel Dunbar | 545c281 | 2009-11-29 20:58:32 +0000 | [diff] [blame] | 200 | const char *Argv0, void *MainAddr); |
Daniel Dunbar | 217acbf | 2009-11-19 07:37:51 +0000 | [diff] [blame] | 201 | |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 202 | int main(int argc, const char **argv) { |
| 203 | llvm::sys::PrintStackTraceOnErrorSignal(); |
Daniel Dunbar | 8f25c79 | 2009-03-18 01:38:48 +0000 | [diff] [blame] | 204 | llvm::PrettyStackTraceProgram X(argc, argv); |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 205 | |
Daniel Dunbar | c88aa79 | 2009-11-30 07:18:13 +0000 | [diff] [blame] | 206 | // Dispatch to cc1_main if appropriate. |
| 207 | if (argc > 1 && llvm::StringRef(argv[1]) == "-cc1") |
| 208 | return cc1_main(argv+2, argv+argc, argv[0], |
| 209 | (void*) (intptr_t) GetExecutablePath); |
| 210 | |
Rafael Espindola | 0f4c59c | 2009-12-04 19:31:58 +0000 | [diff] [blame] | 211 | bool CanonicalPrefixes = true; |
| 212 | for (int i = 1; i < argc; ++i) { |
| 213 | if (llvm::StringRef(argv[i]) == "-no-canonical-prefixes") { |
| 214 | CanonicalPrefixes = false; |
| 215 | break; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | llvm::sys::Path Path = GetExecutablePath(argv[0], CanonicalPrefixes); |
| 220 | |
Daniel Dunbar | 8e6e709 | 2009-05-26 16:15:44 +0000 | [diff] [blame] | 221 | DriverDiagnosticPrinter DiagClient(Path.getBasename(), llvm::errs()); |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 222 | |
Daniel Dunbar | 8e6e709 | 2009-05-26 16:15:44 +0000 | [diff] [blame] | 223 | Diagnostic Diags(&DiagClient); |
Daniel Dunbar | 510d732 | 2009-03-18 02:11:26 +0000 | [diff] [blame] | 224 | |
Daniel Dunbar | f44c585 | 2009-09-22 22:31:13 +0000 | [diff] [blame] | 225 | #ifdef CLANG_IS_PRODUCTION |
| 226 | bool IsProduction = true; |
| 227 | #else |
| 228 | bool IsProduction = false; |
| 229 | #endif |
Jeffrey Yasskin | e3fdca2 | 2009-12-08 01:46:24 +0000 | [diff] [blame] | 230 | Driver TheDriver(Path.getBasename(), Path.getDirname(), |
| 231 | llvm::sys::getHostTriple(), |
Daniel Dunbar | f44c585 | 2009-09-22 22:31:13 +0000 | [diff] [blame] | 232 | "a.out", IsProduction, Diags); |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 233 | |
Daniel Dunbar | 8fa01c8 | 2009-11-10 18:47:41 +0000 | [diff] [blame] | 234 | // Check for ".*++" or ".*++-[^-]*" to determine if we are a C++ |
| 235 | // compiler. This matches things like "c++", "clang++", and "clang++-1.1". |
| 236 | // |
| 237 | // Note that we intentionally want to use argv[0] here, to support "clang++" |
| 238 | // being a symlink. |
Benjamin Kramer | d5dc9f3 | 2009-11-20 11:49:06 +0000 | [diff] [blame] | 239 | // |
| 240 | // We use *argv instead of argv[0] to work around a bogus g++ warning. |
| 241 | std::string ProgName(llvm::sys::Path(*argv).getBasename()); |
Daniel Dunbar | e26bd90 | 2009-11-11 10:10:25 +0000 | [diff] [blame] | 242 | if (llvm::StringRef(ProgName).endswith("++") || |
Daniel Dunbar | 0dea4be | 2009-12-25 20:21:23 +0000 | [diff] [blame] | 243 | llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) { |
Daniel Dunbar | 8fa01c8 | 2009-11-10 18:47:41 +0000 | [diff] [blame] | 244 | TheDriver.CCCIsCXX = true; |
Daniel Dunbar | 0dea4be | 2009-12-25 20:21:23 +0000 | [diff] [blame] | 245 | TheDriver.CCCGenericGCCName = "g++"; |
| 246 | } |
Daniel Dunbar | 8fa01c8 | 2009-11-10 18:47:41 +0000 | [diff] [blame] | 247 | |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 248 | llvm::OwningPtr<Compilation> C; |
| 249 | |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 250 | // Handle QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS, used for editing a |
| 251 | // command line behind the scenes. |
Daniel Dunbar | a1e2fd9 | 2009-04-10 18:32:59 +0000 | [diff] [blame] | 252 | std::set<std::string> SavedStrings; |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 253 | if (const char *OverrideStr = ::getenv("QA_OVERRIDE_GCC3_OPTIONS")) { |
| 254 | // FIXME: Driver shouldn't take extra initial argument. |
| 255 | std::vector<const char*> StringPointers(argv, argv + argc); |
| 256 | |
| 257 | ApplyQAOverride(StringPointers, OverrideStr, SavedStrings); |
| 258 | |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 259 | C.reset(TheDriver.BuildCompilation(StringPointers.size(), |
Daniel Dunbar | 0311d47 | 2009-05-26 18:00:25 +0000 | [diff] [blame] | 260 | &StringPointers[0])); |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 261 | } else if (const char *Cur = ::getenv("CCC_ADD_ARGS")) { |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 262 | std::vector<const char*> StringPointers; |
| 263 | |
| 264 | // FIXME: Driver shouldn't take extra initial argument. |
| 265 | StringPointers.push_back(argv[0]); |
| 266 | |
| 267 | for (;;) { |
| 268 | const char *Next = strchr(Cur, ','); |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 269 | |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 270 | if (Next) { |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 271 | StringPointers.push_back(SaveStringInSet(SavedStrings, |
| 272 | std::string(Cur, Next))); |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 273 | Cur = Next + 1; |
| 274 | } else { |
Daniel Dunbar | ec9587d | 2009-04-17 01:54:00 +0000 | [diff] [blame] | 275 | if (*Cur != '\0') |
| 276 | StringPointers.push_back(SaveStringInSet(SavedStrings, Cur)); |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 277 | break; |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | StringPointers.insert(StringPointers.end(), argv + 1, argv + argc); |
| 282 | |
Daniel Dunbar | 237a31b | 2009-07-17 18:10:27 +0000 | [diff] [blame] | 283 | C.reset(TheDriver.BuildCompilation(StringPointers.size(), |
Daniel Dunbar | 0311d47 | 2009-05-26 18:00:25 +0000 | [diff] [blame] | 284 | &StringPointers[0])); |
Daniel Dunbar | e5be6da | 2009-04-01 19:08:46 +0000 | [diff] [blame] | 285 | } else |
Daniel Dunbar | 8e6e709 | 2009-05-26 16:15:44 +0000 | [diff] [blame] | 286 | C.reset(TheDriver.BuildCompilation(argc, argv)); |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 287 | |
Daniel Dunbar | af96def | 2009-03-21 00:40:53 +0000 | [diff] [blame] | 288 | int Res = 0; |
| 289 | if (C.get()) |
Daniel Dunbar | c88a88f | 2009-07-01 20:03:04 +0000 | [diff] [blame] | 290 | Res = TheDriver.ExecuteCompilation(*C); |
Daniel Dunbar | 8f25c79 | 2009-03-18 01:38:48 +0000 | [diff] [blame] | 291 | |
| 292 | llvm::llvm_shutdown(); |
| 293 | |
Daniel Dunbar | af96def | 2009-03-21 00:40:53 +0000 | [diff] [blame] | 294 | return Res; |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 295 | } |