[PATCH] D69416: [Examples] Add IRTransformations directory to examples.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 4 08:17:29 PST 2020


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/tools/opt/opt.cpp:543-545
+#ifdef BUILD_EXAMPLES
+  initializeExampleIRTransforms(Registry);
+#endif
----------------
fhahn wrote:
> svenvh wrote:
> > fhahn wrote:
> > > svenvh wrote:
> > > > fhahn wrote:
> > > > > Meinersbur wrote:
> > > > > > I'd prefer if the production code stays distinct from examples. In this case D61446 would allow a solution.
> > > > > I think we should move to the mechanism, once it lands. In the meantime, I think having that in opt should be low risk, as opt is mostly used for testing anyways and the example passes are completely separated from the transforms library.
> > > > This change seems to be causing a problem with the nightly packages from apt.llvm.org.  Installing the packages `llvm-10-tools llvm-10-dev clang-format-10 clang-tidy-10 libclang-10-dev lldb-10` without installing the examples makes the exported cmake files unusable:
> > > > 
> > > > ```
> > > > CMake Error at /usr/lib/llvm-10/lib/cmake/llvm/LLVMExports.cmake:1350 (message):
> > > >   The imported target "ExampleIRTransforms" references the file
> > > > 
> > > >      "/usr/lib/llvm-10/lib/libExampleIRTransforms.a"
> > > > 
> > > >   but this file does not exist.  Possible reasons include:
> > > > 
> > > >   * The file was deleted, renamed, or moved to another location.
> > > > 
> > > >   * An install or uninstall procedure did not complete successfully.
> > > > 
> > > >   * The installation package was faulty and contained
> > > > 
> > > >      "/usr/lib/llvm-10/lib/cmake/llvm/LLVMExports.cmake"
> > > > 
> > > >   but not all the files it references.
> > > > 
> > > > Call Stack (most recent call first):
> > > >   /usr/lib/llvm-10/cmake/LLVMConfig.cmake:256 (include)
> > > >   CMakeLists.txt:29 (find_package)
> > > > ```
> > > Thanks, I'll take a look!
> > After taking a closer look, installing the `llvm-10-examples` package actually does not solve the problem; cmake still fails with the same error.
> I think it should be fixed by D70590, which excludes libExampleIRTransforms.a from the ALL target.
@svenvh I've recommitted the change with a fix that should address the issue. Please let me know if the problem you are seeing re-surfaces.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69416/new/

https://reviews.llvm.org/D69416





More information about the llvm-commits mailing list