[Lldb-commits] [lldb] r121511 - /lldb/trunk/source/Symbol/ClangASTContext.cpp
Sean Callanan
scallanan at apple.com
Fri Dec 10 11:51:54 PST 2010
Author: spyffe
Date: Fri Dec 10 13:51:54 2010
New Revision: 121511
URL: http://llvm.org/viewvc/llvm-project?rev=121511&view=rev
Log:
Simplified the code that handles overloaded
operator names.
Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=121511&r1=121510&r2=121511&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Dec 10 13:51:54 2010
@@ -908,28 +908,24 @@
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))
+ 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 = name + sizeof(OPERATOR_NOSPACE_PREFIX) - 1;
- no_space = true;
+ post_op_name++;
+ no_space = false;
}
-#undef OPERATOR_SPACE_PREFIX
-#undef OPERATOR_NOSPACE_PREFIX
-
- if (!post_op_name)
- return false;
+#undef OPERATOR_PREFIX
// This is an operator, set the overloaded operator kind to invalid
// in case this is a conversion operator...
More information about the lldb-commits
mailing list