Summary: For Objective-C methods we match the mangled names (the field is name in the profiler samples). Reviewed By: skcho Differential Revision: D17952552 fbshipit-source-id: 308d415f6master
parent
43990ee60b
commit
0e116c5557
@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
int example_function1() { return 111; }
|
|
||||||
|
|
||||||
int example_function2() { return 2; }
|
|
||||||
|
|
||||||
namespace Shapes {
|
|
||||||
|
|
||||||
class Cube {
|
|
||||||
int size;
|
|
||||||
|
|
||||||
public:
|
|
||||||
void set_size(int);
|
|
||||||
int area() { return size * size * size; };
|
|
||||||
void sort(Cube*, unsigned);
|
|
||||||
};
|
|
||||||
|
|
||||||
void Cube::set_size(int s) { size = s; }
|
|
||||||
|
|
||||||
void Cube::sort(Cube* xs, unsigned n) {
|
|
||||||
std::sort(xs, xs + n, [](Cube a, Cube b) { return (a.area() > b.area()); });
|
|
||||||
}
|
|
||||||
} // namespace Shapes
|
|
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
int example_function1() { return 111; } // change here
|
||||||
|
|
||||||
|
int example_function2() { return 2; }
|
||||||
|
|
||||||
|
namespace Shapes {
|
||||||
|
|
||||||
|
class Cube {
|
||||||
|
int size;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void set_size(int);
|
||||||
|
int area() { return size * size * size; }; // change here
|
||||||
|
void sort(Cube*, unsigned);
|
||||||
|
};
|
||||||
|
|
||||||
|
void Cube::set_size(int s) { size = s; }
|
||||||
|
|
||||||
|
void Cube::sort(Cube* xs, unsigned n) {
|
||||||
|
std::sort(xs, xs + n, [](Cube a, Cube b) { return (a.area() < b.area()); });
|
||||||
|
}
|
||||||
|
} // namespace Shapes
|
||||||
|
|
||||||
|
@interface Person : NSObject
|
||||||
|
|
||||||
|
@property NSString* name;
|
||||||
|
|
||||||
|
- (BOOL)isEqual:(id)obj;
|
||||||
|
|
||||||
|
- (void)printName;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation Person
|
||||||
|
|
||||||
|
- (BOOL)isEqual:(id)other { // change here
|
||||||
|
BOOL result = NO;
|
||||||
|
if ([other isKindOfClass:[self class]]) {
|
||||||
|
Person* otherObject = other;
|
||||||
|
result = [self.name isEqualToString:[otherObject name]];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)printName {
|
||||||
|
NSLog(@"The person's name is %@", _name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@ -1 +1 @@
|
|||||||
["label1"]
|
["label1_objc_method","label1_c_function"]
|
@ -1 +1 @@
|
|||||||
["label2"]
|
["label2_objc_method","label2_c_function"]
|
Loading…
Reference in new issue