summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Passes
Commit message (Collapse)AuthorAgeFilesLines
* Fix build warning compiling TestPlugin on Windows and disable Passes plugin ↵Nico Weber2018-05-192-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stuff on Windows since it fundamentally can't work Aaron Ballman reported that TestPlugin warned about it using exception handling without /EHsc flag, and that llvmGetPassInfo() had conflicting export attributes (dllimport in the header, dllexport in the source file). /EHsc is because TestPlugin didn't use the llvm_ cmake functions, so llvm_update_compile_flags didn't get called for the target (llvm_update_compile_flags explicitly passes /Ehs-c-, which fixes the warning). Use add_llvm_loadable_module instead of add_library(... MODULE) to fix this. This also has the side effect of not building the plugin on Windows. That's not a big problem, since before the plugin was built on Windows, but the test didn't attempt to load it, due to -DLLVM_ENABLE_PLUGIN not being passed to PluginsTests.cpp during compilation on Windows. This makes the plugin behavior consistent with e.g. lib/Transforms/Hello/CMakeLists.txt. (This also automatically sets LTDL_SHLIB_EXT correctly.) The dllimport/dllexport warning is more serious: Since LLVM doesn't generally use export annotations for its code, the only way the plugin could link was by linking in some LLVM libraries both into the test and the dll, so the plugin would call the llvm code in the dll instead of the copy in the main executable. This means globals weren't shared, and things generally can't work. (I think there's a build config where you can build a LLVM.dll which might work, but that wasn't how the test was configured. If that config is used, the dll should still be built, but I haven't checked). Now that add_llvm_loadable_module is used, LLVM_LINK_COMPONENTS got linked into both executable and plugin on posix too, so unset it after the executable so that the plugin doesn't end up with a 2nd copy of things on posix. https://reviews.llvm.org/D47082 llvm-svn: 332796
* use standard llvm cmake formatting for targets defined in plugin testsNico Weber2018-05-181-2/+6
| | | | llvm-svn: 332709
* Give shared modules in unittests the platform-native extension, make ↵Nico Weber2018-05-162-2/+3
| | | | | | | | | | | | | | | | | PipSqueak a MODULE As far as I can tell from revision history, there's no good reason to call these files .so instead of .dll in Windows, so use the normal extension. Also change PipSquak from SHARED to MODULE -- it's never passed to target_link_libraries() and only loaded via dlopen(), so MODULE is more appropriate. This makes it possible to delete a workaround for SHARED ldflags being not quite right as well. No intended behavior change. https://reviews.llvm.org/D46898 llvm-svn: 332487
* Rename three cxx files in unittests to cpp.Nico Weber2018-05-152-2/+5
| | | | | | | | | | | | LLVM uses cpp as its C++ file extension, these are the only three cxx file in the monorepo. These files apparently were called to escape a CMake check -- use the LLVM_OPTIONAL_SOURCES mechanism that's meant as an escape for this case instead. No intended behavior change. https://reviews.llvm.org/D46843 llvm-svn: 332368
* Move the TestPlugin project into the Tests folder in CMake.Aaron Ballman2018-05-021-0/+1
| | | | llvm-svn: 331387
* Fix PluginsTests failure on Windows buildbots by enabling it everywhereReid Kleckner2018-04-252-17/+26
| | | | | | | | | | | lit is picking up a stale executable in the unittests tree, which is failing on Windows. To simplify the CMake and avoid problems like this in the future, now we always compile the test, but the test exits successfully when plugins are not enabled. llvm-svn: 330867
* Avoid a warning on pointer casting, NFCGabor Buella2018-04-251-1/+3
| | | | | | | | | | Reviewers: philip.pfaffe Reviewed By: philip.pfaffe Differential Revision: https://reviews.llvm.org/D46012 llvm-svn: 330817
* [Unittests] Fix plugins testMikhail Maltsev2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Currently the PluginsTests.LoadPlugin unit test is failing in LLVM configurations that have LLVM_EXPORT_SYMBOLS_FOR_PLUGINS enabled because the EnableABIBreakingChecks symbol is missing. This patch fixes the issue by linking some additional libraries to the test plugin if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is enabled. Reviewers: philip.pfaffe Reviewed By: philip.pfaffe Subscribers: mgorny, llvm-commits, rogfer01 Differential Revision: https://reviews.llvm.org/D45811 llvm-svn: 330329
* Revert "Followup for r329293: Temporarily disable the breaking test on windows."Philip Pfaffe2018-04-071-2/+1
| | | | | | This reverts commit r329393 / b52ba35e7759cd4002221be1dbb63ec80fde21ec. llvm-svn: 329514
* Followup for r329293: Temporarily disable the breaking test on windows.Philip Pfaffe2018-04-061-1/+2
| | | | | | | This test is failing on windows bots. Disable it temporarily to unbreak the windows bots. llvm-svn: 329393
* Another fix for r329293: Unbreak the windows botsPhilip Pfaffe2018-04-051-13/+20
| | | | | | | Only build the unittest if plugins are enabled. Link components into the TestPlugin on windows and cygwin. llvm-svn: 329318
* Fix r329293: Add a missing CMake dependencyPhilip Pfaffe2018-04-051-0/+1
| | | | | | | The unittest plugin indirectly includes Attributes.gen, so make sure its target depends on the appropriate tablegen target. llvm-svn: 329308
* Re-land r329273: [Plugins] Add a slim plugin API to work together with the ↵Philip Pfaffe2018-04-054-0/+112
| | | | | | | | | new PM Fix unittest: Do not link LLVM into the test plugin. Additionally, remove an unrelated change that slipped in in r329273. llvm-svn: 329293
* Revert "[Plugins] Add a slim plugin API to work together with the new PM"Philip Pfaffe2018-04-054-115/+0
| | | | | | This reverts commit ecf3ba1ab45edb1b0fadce716a7facf50dca4fbb/r329273. llvm-svn: 329276
* [Plugins] Add a slim plugin API to work together with the new PMPhilip Pfaffe2018-04-054-0/+115
Summary: Add a new plugin API. This closes the gap between pass registration and out-of-tree passes for the new PassManager. Unlike with the existing API, interaction with a plugin is always initiated from the tools perspective. I.e., when a plugin is loaded, it resolves and calls a well-known symbol `llvmGetPassPluginInfo` to obtain details about the plugin. The fundamental motivation is to get rid of as many global constructors as possible. The API exposed by the plugin info is kept intentionally minimal. Reviewers: chandlerc Reviewed By: chandlerc Subscribers: bollu, grosser, lksbhm, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D35258 llvm-svn: 329273
OpenPOWER on IntegriCloud