OLD | NEW |
1 -- Copyright 2011 the V8 project authors. All rights reserved. | 1 -- Copyright 2011 the V8 project authors. All rights reserved. |
2 -- Redistribution and use in source and binary forms, with or without | 2 -- Redistribution and use in source and binary forms, with or without |
3 -- modification, are permitted provided that the following conditions are | 3 -- modification, are permitted provided that the following conditions are |
4 -- met: | 4 -- met: |
5 -- | 5 -- |
6 -- * Redistributions of source code must retain the above copyright | 6 -- * Redistributions of source code must retain the above copyright |
7 -- notice, this list of conditions and the following disclaimer. | 7 -- notice, this list of conditions and the following disclaimer. |
8 -- * Redistributions in binary form must reproduce the above | 8 -- * Redistributions in binary form must reproduce the above |
9 -- copyright notice, this list of conditions and the following | 9 -- copyright notice, this list of conditions and the following |
10 -- disclaimer in the documentation and/or other materials provided | 10 -- disclaimer in the documentation and/or other materials provided |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 function log(...) | 74 function log(...) |
75 io.stderr:write(string.format(...)) | 75 io.stderr:write(string.format(...)) |
76 io.stderr:write "\n" | 76 io.stderr:write "\n" |
77 end | 77 end |
78 | 78 |
79 ------------------------------------------------------------------------------- | 79 ------------------------------------------------------------------------------- |
80 -- Clang invocation | 80 -- Clang invocation |
81 | 81 |
82 local CLANG_BIN = os.getenv "CLANG_BIN" | 82 local CLANG_BIN = os.getenv "CLANG_BIN" |
| 83 local CLANG_PLUGINS = os.getenv "CLANG_PLUGINS" |
83 | 84 |
84 if not CLANG_BIN or CLANG_BIN == "" then | 85 if not CLANG_BIN or CLANG_BIN == "" then |
85 error "CLANG_BIN not set" | 86 error "CLANG_BIN not set" |
86 end | 87 end |
87 | 88 |
| 89 if not CLANG_PLUGINS or CLANG_PLUGINS == "" then |
| 90 CLANG_PLUGINS = DIR |
| 91 end |
| 92 |
88 local function MakeClangCommandLine(plugin, plugin_args, triple, arch_define) | 93 local function MakeClangCommandLine(plugin, plugin_args, triple, arch_define) |
89 if plugin_args then | 94 if plugin_args then |
90 for i = 1, #plugin_args do | 95 for i = 1, #plugin_args do |
91 plugin_args[i] = "-plugin-arg-" .. plugin .. " " .. plugin_args[i] | 96 plugin_args[i] = "-plugin-arg-" .. plugin .. " " .. plugin_args[i] |
92 end | 97 end |
93 plugin_args = " " .. table.concat(plugin_args, " ") | 98 plugin_args = " " .. table.concat(plugin_args, " ") |
94 end | 99 end |
95 return CLANG_BIN .. "/clang -cc1 -load " .. DIR .. "/libgcmole.so" | 100 return CLANG_BIN .. "/clang -cc1 -load " .. CLANG_PLUGINS .. "/libgcmole.so" |
96 .. " -plugin " .. plugin | 101 .. " -plugin " .. plugin |
97 .. (plugin_args or "") | 102 .. (plugin_args or "") |
98 .. " -triple " .. triple | 103 .. " -triple " .. triple |
99 .. " -D" .. arch_define | 104 .. " -D" .. arch_define |
100 .. " -DENABLE_DEBUGGER_SUPPORT" | 105 .. " -DENABLE_DEBUGGER_SUPPORT" |
101 .. " -Isrc" | 106 .. " -Isrc" |
102 end | 107 end |
103 | 108 |
104 function InvokeClangPluginForEachFile(filenames, cfg, func) | 109 function InvokeClangPluginForEachFile(filenames, cfg, func) |
105 local cmd_line = MakeClangCommandLine(cfg.plugin, | 110 local cmd_line = MakeClangCommandLine(cfg.plugin, |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 371 |
367 for _, arch in ipairs(ARCHS) do | 372 for _, arch in ipairs(ARCHS) do |
368 if not ARCHITECTURES[arch] then | 373 if not ARCHITECTURES[arch] then |
369 error ("Unknown arch: " .. arch) | 374 error ("Unknown arch: " .. arch) |
370 end | 375 end |
371 | 376 |
372 errors = SafeCheckCorrectnessForArch(arch, report) or errors | 377 errors = SafeCheckCorrectnessForArch(arch, report) or errors |
373 end | 378 end |
374 | 379 |
375 os.exit(errors and 1 or 0) | 380 os.exit(errors and 1 or 0) |
OLD | NEW |