[llvm] r328765 - [Transforms] Make sure to include the c binding header when defining c binding functions

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 00:56:53 PDT 2018


Author: d0k
Date: Thu Mar 29 00:56:53 2018
New Revision: 328765

URL: http://llvm.org/viewvc/llvm-project?rev=328765&view=rev
Log:
[Transforms] Make sure to include the c binding header when defining c binding functions

Otherwise the definitions can't see the extern C declarations and get
name mangled, making it impossible for users to call them. This breaks
the Go bindings.

Modified:
    llvm/trunk/lib/Transforms/Utils/Utils.cpp

Modified: llvm/trunk/lib/Transforms/Utils/Utils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Utils.cpp?rev=328765&r1=328764&r2=328765&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Utils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Utils.cpp Thu Mar 29 00:56:53 2018
@@ -14,6 +14,7 @@
 
 #include "llvm/Transforms/Utils.h"
 #include "llvm-c/Initialization.h"
+#include "llvm-c/Transforms/Scalar.h"
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/PassRegistry.h"




More information about the llvm-commits mailing list