[PATCH] Extend C disassembler API to allow specifying target features

Bradley Smith bradley.smith at arm.com
Fri Sep 26 02:45:45 PDT 2014


================
Comment at: tools/llvm-c-test/disassemble.c:83
@@ -76,3 +82,3 @@
   }
-  do_disassemble(triple, disbuf, disbuflen);
+  do_disassemble(triple, features, disbuf, disbuflen);
 }
----------------
rengolin wrote:
> bsmith wrote:
> > rengolin wrote:
> > > will there be any string validation further on? If yes, why do you do the NULL validation above? If not, shouldn't we add it?
> > The feature string is passed straight through to createMCSubtargetInfo which I don't think accepts NULL as a value, there is certainty a lot of precedence in the codebase for using "" as an empty feature string instead of NULL.
> right, so who passes "NULL"? Shouldn't that be an error?
The test (test/Bindings/llvm-c/disassemble.test) uses the string "NULL" to represent an empty feature set, since you can't parse the empty string from the file. I've just used it as a way to represent "" in a parsable form.

http://reviews.llvm.org/D5468






More information about the llvm-commits mailing list