[llvm-commits] PATCH: replace if-chain in AsmParser's directive parsing code

Eli Bendersky eliben at google.com
Mon Dec 17 16:45:06 PST 2012


AsmParser has a couple of if-chains when parsing directives. The
attached patch replaces the if-chains with enum+switch. No change in
functionality.

Unfortunately I didn't measure any significant speedups for the whole
llvm-mc (only 1-2%), so I'll do more fine-grained measurements once I
get the opportunity.

Also, I should add that in general AsmParser's parsing code can be
cleaned up even more (for example w.r.t. the extensions registersing
directive parsers, which can be unified with other directive parsing
code). So this patch should just be seen as a first step in a
(hopefully) right direction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asmparser_replace_ifchain.1.patch
Type: application/octet-stream
Size: 16079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121217/fc1af033/attachment.obj>


More information about the llvm-commits mailing list