diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-28 18:31:19 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-28 18:31:19 +0000 |
| commit | 3afb1736f26c2c6d674b54cc3e86c79a14118710 (patch) | |
| tree | f869007f1cf00ff2088e5e8722cec92ffcf46a60 /llvm | |
| parent | 24cb28bb54349cb2494ae20c674873ceef8ede9d (diff) | |
| download | bcm5719-llvm-3afb1736f26c2c6d674b54cc3e86c79a14118710.tar.gz bcm5719-llvm-3afb1736f26c2c6d674b54cc3e86c79a14118710.zip | |
[LTO] Simplify code. No functionality change intended.
llvm-svn: 321531
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/LTO/LTOModule.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp index 51b4f225939..626d2f5dc81 100644 --- a/llvm/lib/LTO/LTOModule.cpp +++ b/llvm/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); } } } |

