[PATCH] D44140: Add missing header for InstructionCombining.cpp, in order to export LLVMInitializeInstCombine as extern "C"

Brenton Bostick via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 03:20:47 PST 2018


brenton created this revision.
brenton added reviewers: majnemer, Eugene.Zelenko.
Herald added a subscriber: llvm-commits.

Getting this error:
"Undefined symbols for architecture x86_64:

  \"_LLVMInitializeInstCombine\", referenced from:
      _LLVMLink_LLVMInitializeInstCombine_Wrapper in llvmc60.cpp.o
     (maybe you meant: _LLVMLink_LLVMInitializeInstCombine_Wrapper)

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see \
invocation)
make[2]: *** [LLVMLink.dylib] Error 1
make[1]: *** [CMakeFiles/LLVMLink.dir/all] Error 2
make: *** [all] Error 2
"

LLVMInitializeInstCombine is declared extern "C" in the LLVM-C header Initialization.h, but not declared extern "C" surrounding the definition for the function in lib/Transforms/InstCombine/InstructionCombining.cpp.

This fixes 35947
https://bugs.llvm.org/show_bug.cgi?id=35947


Repository:
  rL LLVM

https://reviews.llvm.org/D44140

Files:
  lib/Transforms/InstCombine/InstructionCombining.cpp


Index: lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- lib/Transforms/InstCombine/InstructionCombining.cpp
+++ lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -33,6 +33,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm-c/Initialization.h"
 #include "InstCombineInternal.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44140.137144.patch
Type: text/x-patch
Size: 476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/41e8008a/attachment.bin>


More information about the llvm-commits mailing list