[PATCH] Additional features for the C API

Nick Lewycky nlewycky at google.com
Sun Oct 20 16:06:18 PDT 2013



================
Comment at: include/llvm-c/Core.h:1197
@@ -1196,1 +1196,3 @@
 /**
+ * Dump a representation of a file to a file descriptor.
+ * 
----------------
of a *value

================
Comment at: include/llvm-c/IRReader.h:1
@@ +1,2 @@
+/*===-- llvm-c/IRReader.h - IR Reader C Interface ---------------*- C++ -*-===*\
+|*                                                                            *|
----------------
Do we really put C++ emacs mode markers on C headers?

================
Comment at: include/llvm-c/Support.h:34
@@ +33,3 @@
+LLVMBool LLVMLoadLibraryPermanently(const char* Filename) {
+  return sys::DynamicLibrary::LoadLibraryPermanently(Filename);
+}
----------------
No, a C compiler can't parse this. It'll have to go into a .cpp file.

For include/IR C files, there's a matching lib/IR/Core.cpp. There doesn't seem to be something like that for Support yet, you'll have to add one in lib/Supprt.

================
Comment at: include/llvm-c/TargetMachine.h:73
@@ +72,3 @@
+/** Returns the target corresponding to the given tripple. */
+LLVMTargetRef	LLVMGetTargetFromTriple(LLVMTripleRef Triple,
+                                      char **ErrorMessage);
----------------
Two spaces after LLVMTargetRef?

================
Comment at: include/llvm-c/TargetMachine.h:136-138
@@ +135,5 @@
+
+/*===-- Tripple -----------------------------------------------------------===*/
+/** Create a new tripple object from a string. */
+LLVMTripleRef LLVMCreateTripple(char* String);
+
----------------
s/Tripple/Triple/

================
Comment at: include/llvm-c/TargetMachine.h:141
@@ +140,3 @@
+/** Get a tripple object for the host machine. */
+LLVMTripleRef	LLVMGetDefaultTargetTriple(void);
+
----------------
Two spaces again?

================
Comment at: include/llvm-c/TargetMachine.h:65
@@ -63,1 +64,3 @@
 
+/** Returns a string of features built from an arg array. */
+char *LLVMBuildFeaturesString(char** attrs, int num_attrs);
----------------
Please document ownership of the returned pointer.


http://llvm-reviews.chandlerc.com/D1960



More information about the llvm-commits mailing list