Guest User

Untitled

a guest
Feb 15th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1.  
  2. // Preprocessor trick to convert enum to string
  3. const char *LookupInstructionText(Insn i)
  4. {
  5.   const char *result = "???";
  6.   switch (i)
  7.   {
  8. #define SINKCOMPILER_IR_DEFINITION(name) case name: result = #name; break;
  9. #define SINKCOMPILER_IR_EQUIVALENCE(name, is) /* empty */
  10. #include "sinkcompiler_IR_insn.h"
  11. #undef SINKCOMPILER_IR_EQIVALENCE
  12. #undef SINKCOMPILER_IR_DEFINITION
  13.   }
  14.   return result;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment