aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LTO
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-28 23:57:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-28 23:57:18 +0000
commitb8a2042aa938069e862750553db0e4d82d25822c (patch)
tree8acb3313c9e21902b08a931a708ba405aa157b31 /lib/LTO
parentb2b7c066a48f61ec67332fb797a20bb04901c83d (diff)
downloadsrc-b8a2042aa938069e862750553db0e4d82d25822c.tar.gz
src-b8a2042aa938069e862750553db0e4d82d25822c.zip
Vendor import of llvm trunk r321545:vendor/llvm/llvm-trunk-r321545
Notes
Notes: svn path=/vendor/llvm/dist/; revision=327320 svn path=/vendor/llvm/llvm-trunk-r321545/; revision=327321; tag=vendor/llvm/llvm-trunk-r321545
Diffstat (limited to 'lib/LTO')
-rw-r--r--lib/LTO/LTOModule.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index 51b4f225939f..626d2f5dc813 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -388,24 +388,20 @@ void LTOModule::addDefinedDataSymbol(StringRef Name, const GlobalValue *v) {
// from the ObjC data structures generated by the front end.
// special case if this data blob is an ObjC class definition
- std::string Section = v->getSection();
- if (Section.compare(0, 15, "__OBJC,__class,") == 0) {
- if (const GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCClass(gv);
+ if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(v)) {
+ StringRef Section = GV->getSection();
+ if (Section.startswith("__OBJC,__class,")) {
+ addObjCClass(GV);
}
- }
- // special case if this data blob is an ObjC category definition
- else if (Section.compare(0, 18, "__OBJC,__category,") == 0) {
- if (const GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCCategory(gv);
+ // special case if this data blob is an ObjC category definition
+ else if (Section.startswith("__OBJC,__category,")) {
+ addObjCCategory(GV);
}
- }
- // special case if this data blob is the list of referenced classes
- else if (Section.compare(0, 18, "__OBJC,__cls_refs,") == 0) {
- if (const GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCClassRef(gv);
+ // special case if this data blob is the list of referenced classes
+ else if (Section.startswith("__OBJC,__cls_refs,")) {
+ addObjCClassRef(GV);
}
}
}