diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp index 014d231a29c..46840f2e223 100644 --- a/tools/llvm-extract/llvm-extract.cpp +++ b/tools/llvm-extract/llvm-extract.cpp @@ -81,11 +81,11 @@ int main(int argc, char **argv) { } // Figure out which function we should extract - GlobalVariable *G = ExtractGlobal.size() ? + GlobalVariable *G = !ExtractGlobal.empty() ? M.get()->getNamedGlobal(ExtractGlobal) : 0; // Figure out which function we should extract - if (!ExtractFunc.size() && !ExtractGlobal.size()) ExtractFunc = "main"; + if (ExtractFunc.empty() && ExtractGlobal.empty()) ExtractFunc = "main"; Function *F = M.get()->getFunction(ExtractFunc); if (F == 0 && G == 0) {