summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c/Core.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2013-04-03 23:12:39 +0000
committerEvan Cheng <evan.cheng@apple.com>2013-04-03 23:12:39 +0000
commit51a7a9d712dce44179fa09d15d1cbda9f09fa227 (patch)
tree5249102f7f46c0ae6407d28084086b8d396de2ee /llvm/include/llvm-c/Core.h
parentc2d5bf5c53b0e4f29bfa75416d3b0a6fe54a9a44 (diff)
downloadbcm5719-llvm-51a7a9d712dce44179fa09d15d1cbda9f09fa227.tar.gz
bcm5719-llvm-51a7a9d712dce44179fa09d15d1cbda9f09fa227.zip
Make it possible to include llvm-c without including C++ headers. Patch by Filip Pizlo.
llvm-svn: 178713
Diffstat (limited to 'llvm/include/llvm-c/Core.h')
-rw-r--r--llvm/include/llvm-c/Core.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index e85fb975050..cc78b2e6fd2 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -17,14 +17,15 @@
#include "llvm/Support/DataTypes.h"
-#ifdef __cplusplus
-
+#if defined(__cplusplus) && !defined(LLVM_DO_NOT_INCLUDE_CPP_HEADERS)
/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap'
and 'unwrap' conversion functions. */
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/PassRegistry.h"
+#endif /* defined(__cplusplus) && !defined(LLVM_DO_NOT_INCLUDE_CPP_HEADERS) */
+#ifdef __cplusplus
extern "C" {
#endif
@@ -2669,7 +2670,9 @@ LLVMBool LLVMIsMultithreaded();
#ifdef __cplusplus
}
+#endif
+#if defined(__cplusplus) && !defined(LLVM_DO_NOT_INCLUDE_CPP_HEADERS)
namespace llvm {
class MemoryBuffer;
class PassManagerBase;
@@ -2763,6 +2766,6 @@ namespace llvm {
}
}
-#endif /* !defined(__cplusplus) */
+#endif /* defined(__cplusplus) && !defined(LLVM_DO_NOT_INCLUDE_CPP_HEADERS) */
-#endif /* !defined(LLVM_C_CORE_H) */
+#endif /* defined(LLVM_C_CORE_H) */
OpenPOWER on IntegriCloud