Simplified the code that handles overloaded
operator names.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121511 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 5717d33..c4cd159 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -908,29 +908,25 @@
if (name == NULL || name[0] == '\0')
return false;
-#define OPERATOR_SPACE_PREFIX "operator "
-#define OPERATOR_NOSPACE_PREFIX "operator"
+#define OPERATOR_PREFIX "operator"
const char *post_op_name = NULL;
- bool no_space = false;
+ bool no_space = true;
- if (!::strncmp(name, OPERATOR_SPACE_PREFIX, sizeof(OPERATOR_SPACE_PREFIX) - 1))
- {
- post_op_name = name + sizeof(OPERATOR_SPACE_PREFIX) - 1;
- }
- else if (!::strncmp(name, OPERATOR_NOSPACE_PREFIX, sizeof(OPERATOR_NOSPACE_PREFIX) - 1))
- {
- post_op_name = name + sizeof(OPERATOR_NOSPACE_PREFIX) - 1;
- no_space = true;
- }
-
-#undef OPERATOR_SPACE_PREFIX
-#undef OPERATOR_NOSPACE_PREFIX
-
- if (!post_op_name)
+ if (!::strncmp(name, OPERATOR_PREFIX, sizeof(OPERATOR_PREFIX) - 1))
+ post_op_name = name + sizeof(OPERATOR_PREFIX) - 1;
+ else
return false;
+ if (post_op_name[0] == ' ')
+ {
+ post_op_name++;
+ no_space = false;
+ }
+
+#undef OPERATOR_PREFIX
+
// This is an operator, set the overloaded operator kind to invalid
// in case this is a conversion operator...
op_kind = NUM_OVERLOADED_OPERATORS;