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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 E = CompoundInit->op_end(); | 738 E = CompoundInit->op_end(); |
739 I != E; ++I) { | 739 I != E; ++I) { |
740 if (const auto Init = dyn_cast<Constant>(I)) { | 740 if (const auto Init = dyn_cast<Constant>(I)) { |
741 addGlobalInitializer(*VarDecl, Init); | 741 addGlobalInitializer(*VarDecl, Init); |
742 } | 742 } |
743 } | 743 } |
744 } else { | 744 } else { |
745 addGlobalInitializer(*VarDecl, Initializer); | 745 addGlobalInitializer(*VarDecl, Initializer); |
746 } | 746 } |
747 } | 747 } |
748 return std::move(VariableDeclarations); | 748 return VariableDeclarations; |
749 } | 749 } |
750 | 750 |
751 void LLVM2ICEGlobalsConverter::addGlobalInitializer( | 751 void LLVM2ICEGlobalsConverter::addGlobalInitializer( |
752 Ice::VariableDeclaration &Global, const Constant *Initializer, | 752 Ice::VariableDeclaration &Global, const Constant *Initializer, |
753 bool HasOffset, Ice::RelocOffsetT Offset) { | 753 bool HasOffset, Ice::RelocOffsetT Offset) { |
754 (void)HasOffset; | 754 (void)HasOffset; |
755 assert(HasOffset || Offset == 0); | 755 assert(HasOffset || Offset == 0); |
756 | 756 |
757 if (const auto CDA = dyn_cast<ConstantDataArray>(Initializer)) { | 757 if (const auto CDA = dyn_cast<ConstantDataArray>(Initializer)) { |
758 assert(!HasOffset && isa<IntegerType>(CDA->getElementType()) && | 758 assert(!HasOffset && isa<IntegerType>(CDA->getElementType()) && |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 Ctx->pushTimer(TimerID, StackID); | 905 Ctx->pushTimer(TimerID, StackID); |
906 } | 906 } |
907 LLVM2ICEFunctionConverter FunctionConverter(*this); | 907 LLVM2ICEFunctionConverter FunctionConverter(*this); |
908 FunctionConverter.convertFunction(&I); | 908 FunctionConverter.convertFunction(&I); |
909 if (TimeThisFunction) | 909 if (TimeThisFunction) |
910 Ctx->popTimer(TimerID, StackID); | 910 Ctx->popTimer(TimerID, StackID); |
911 } | 911 } |
912 } | 912 } |
913 | 913 |
914 } // end of namespace Ice | 914 } // end of namespace Ice |
OLD | NEW |