| OLD | NEW |
| 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// | 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 IceFunc->setName(Func.getName()); | 873 IceFunc->setName(Func.getName()); |
| 874 if (!IceFunc->verifyLinkageCorrect(Ctx)) { | 874 if (!IceFunc->verifyLinkageCorrect(Ctx)) { |
| 875 std::string Buffer; | 875 std::string Buffer; |
| 876 raw_string_ostream StrBuf(Buffer); | 876 raw_string_ostream StrBuf(Buffer); |
| 877 StrBuf << "Function " << IceFunc->getName() | 877 StrBuf << "Function " << IceFunc->getName() |
| 878 << " has incorrect linkage: " << IceFunc->getLinkageName(); | 878 << " has incorrect linkage: " << IceFunc->getLinkageName(); |
| 879 if (IceFunc->isExternal()) | 879 if (IceFunc->isExternal()) |
| 880 StrBuf << "\n Use flag -allow-externally-defined-symbols to override"; | 880 StrBuf << "\n Use flag -allow-externally-defined-symbols to override"; |
| 881 report_fatal_error(StrBuf.str()); | 881 report_fatal_error(StrBuf.str()); |
| 882 } | 882 } |
| 883 if (!IceFunc->validateTypeSignature(Ctx)) |
| 884 report_fatal_error(IceFunc->getTypeSignatureError(Ctx)); |
| 883 GlobalDeclarationMap[&Func] = IceFunc; | 885 GlobalDeclarationMap[&Func] = IceFunc; |
| 884 } | 886 } |
| 885 // Install global variable declarations. | 887 // Install global variable declarations. |
| 886 for (Module::const_global_iterator I = Mod->global_begin(), | 888 for (Module::const_global_iterator I = Mod->global_begin(), |
| 887 E = Mod->global_end(); | 889 E = Mod->global_end(); |
| 888 I != E; ++I) { | 890 I != E; ++I) { |
| 889 const GlobalVariable *GV = I; | 891 const GlobalVariable *GV = I; |
| 890 auto *Var = VariableDeclaration::create(Ctx); | 892 auto *Var = VariableDeclaration::create(Ctx); |
| 891 Var->setName(GV->getName()); | 893 Var->setName(GV->getName()); |
| 892 Var->setAlignment(GV->getAlignment()); | 894 Var->setAlignment(GV->getAlignment()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 922 Ctx->pushTimer(TimerID, StackID); | 924 Ctx->pushTimer(TimerID, StackID); |
| 923 } | 925 } |
| 924 LLVM2ICEFunctionConverter FunctionConverter(*this); | 926 LLVM2ICEFunctionConverter FunctionConverter(*this); |
| 925 FunctionConverter.convertFunction(&I); | 927 FunctionConverter.convertFunction(&I); |
| 926 if (TimeThisFunction) | 928 if (TimeThisFunction) |
| 927 Ctx->popTimer(TimerID, StackID); | 929 Ctx->popTimer(TimerID, StackID); |
| 928 } | 930 } |
| 929 } | 931 } |
| 930 | 932 |
| 931 } // end of namespace Ice | 933 } // end of namespace Ice |
| OLD | NEW |