summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/OptParserEmitter.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-09-22 14:09:50 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-09-22 14:09:50 +0000
commit8817cca5ce782c187605ee08e1a7363aa5470534 (patch)
treea70f68125c16f17261abf4865bb60f46a053b51e /llvm/utils/TableGen/OptParserEmitter.cpp
parent402f807d9d0238cf7c7dd98bea52be221637d580 (diff)
downloadbcm5719-llvm-8817cca5ce782c187605ee08e1a7363aa5470534.tar.gz
bcm5719-llvm-8817cca5ce782c187605ee08e1a7363aa5470534.zip
Provide basic type safety for array_pod_sort comparators.
This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. llvm-svn: 191175
Diffstat (limited to 'llvm/utils/TableGen/OptParserEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/OptParserEmitter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index 7fb7d65a704..cff004f5694 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -41,9 +41,9 @@ static int StrCmpOptionName(const char *A, const char *B) {
return (a < b) ? -1 : 1;
}
-static int CompareOptionRecords(const void *Av, const void *Bv) {
- const Record *A = *(const Record*const*) Av;
- const Record *B = *(const Record*const*) Bv;
+static int CompareOptionRecords(Record *const *Av, Record *const *Bv) {
+ const Record *A = *Av;
+ const Record *B = *Bv;
// Sentinel options precede all others and are only ordered by precedence.
bool ASent = A->getValueAsDef("Kind")->getValueAsBit("Sentinel");
OpenPOWER on IntegriCloud