llvm.org GIT mirror llvm / c16fc54
Use 'override/final' instead of 'virtual' for overridden methods The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8 Alexander Kornienko 4 years ago
165 changed file(s) with 391 addition(s) and 382 deletion(s). Raw diff Collapse all Expand all
15721572 std::runtime_error::operator=(toCopy)));
15731573 }
15741574
1575 virtual ~OurCppRunException (void) throw () {}
1575 ~OurCppRunException(void) throw() override {}
15761576 };
15771577 } // end anonymous namespace
15781578
9292 double Val;
9393 public:
9494 NumberExprAST(double val) : Val(val) {}
95 virtual Value *Codegen();
95 Value *Codegen() override;
9696 };
9797
9898 /// VariableExprAST - Expression class for referencing a variable, like "a".
100100 std::string Name;
101101 public:
102102 VariableExprAST(const std::string &name) : Name(name) {}
103 virtual Value *Codegen();
103 Value *Codegen() override;
104104 };
105105
106106 /// BinaryExprAST - Expression class for a binary operator.
110110 public:
111111 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
112112 : Op(op), LHS(lhs), RHS(rhs) {}
113 virtual Value *Codegen();
113 Value *Codegen() override;
114114 };
115115
116116 /// CallExprAST - Expression class for function calls.
120120 public:
121121 CallExprAST(const std::string &callee, std::vector &args)
122122 : Callee(callee), Args(args) {}
123 virtual Value *Codegen();
123 Value *Codegen() override;
124124 };
125125
126126 /// PrototypeAST - This class represents the "prototype" for a function,
106106
107107 public:
108108 NumberExprAST(double val) : Val(val) {}
109 virtual Value *Codegen();
109 Value *Codegen() override;
110110 };
111111
112112 /// VariableExprAST - Expression class for referencing a variable, like "a".
115115
116116 public:
117117 VariableExprAST(const std::string &name) : Name(name) {}
118 virtual Value *Codegen();
118 Value *Codegen() override;
119119 };
120120
121121 /// BinaryExprAST - Expression class for a binary operator.
126126 public:
127127 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
128128 : Op(op), LHS(lhs), RHS(rhs) {}
129 virtual Value *Codegen();
129 Value *Codegen() override;
130130 };
131131
132132 /// CallExprAST - Expression class for function calls.
137137 public:
138138 CallExprAST(const std::string &callee, std::vector &args)
139139 : Callee(callee), Args(args) {}
140 virtual Value *Codegen();
140 Value *Codegen() override;
141141 };
142142
143143 /// PrototypeAST - This class represents the "prototype" for a function,
451451
452452 public:
453453 HelpingMemoryManager(MCJITHelper *Helper) : MasterHelper(Helper) {}
454 virtual ~HelpingMemoryManager() {}
454 ~HelpingMemoryManager() override {}
455455
456456 /// This method returns the address of the specified symbol.
457457 /// Our implementation will attempt to find symbols in other
458458 /// modules associated with the MCJITHelper to cross link symbols
459459 /// from one generated module to another.
460 virtual uint64_t getSymbolAddress(const std::string &Name) override;
460 uint64_t getSymbolAddress(const std::string &Name) override;
461461
462462 private:
463463 MCJITHelper *MasterHelper;
124124
125125 public:
126126 NumberExprAST(double val) : Val(val) {}
127 virtual Value *Codegen();
127 Value *Codegen() override;
128128 };
129129
130130 /// VariableExprAST - Expression class for referencing a variable, like "a".
133133
134134 public:
135135 VariableExprAST(const std::string &name) : Name(name) {}
136 virtual Value *Codegen();
136 Value *Codegen() override;
137137 };
138138
139139 /// BinaryExprAST - Expression class for a binary operator.
144144 public:
145145 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
146146 : Op(op), LHS(lhs), RHS(rhs) {}
147 virtual Value *Codegen();
147 Value *Codegen() override;
148148 };
149149
150150 /// CallExprAST - Expression class for function calls.
155155 public:
156156 CallExprAST(const std::string &callee, std::vector &args)
157157 : Callee(callee), Args(args) {}
158 virtual Value *Codegen();
158 Value *Codegen() override;
159159 };
160160
161161 /// IfExprAST - Expression class for if/then/else.
165165 public:
166166 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
167167 : Cond(cond), Then(then), Else(_else) {}
168 virtual Value *Codegen();
168 Value *Codegen() override;
169169 };
170170
171171 /// ForExprAST - Expression class for for/in.
177177 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
178178 ExprAST *step, ExprAST *body)
179179 : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
180 virtual Value *Codegen();
180 Value *Codegen() override;
181181 };
182182
183183 /// PrototypeAST - This class represents the "prototype" for a function,
132132
133133 public:
134134 NumberExprAST(double val) : Val(val) {}
135 virtual Value *Codegen();
135 Value *Codegen() override;
136136 };
137137
138138 /// VariableExprAST - Expression class for referencing a variable, like "a".
141141
142142 public:
143143 VariableExprAST(const std::string &name) : Name(name) {}
144 virtual Value *Codegen();
144 Value *Codegen() override;
145145 };
146146
147147 /// UnaryExprAST - Expression class for a unary operator.
152152 public:
153153 UnaryExprAST(char opcode, ExprAST *operand)
154154 : Opcode(opcode), Operand(operand) {}
155 virtual Value *Codegen();
155 Value *Codegen() override;
156156 };
157157
158158 /// BinaryExprAST - Expression class for a binary operator.
163163 public:
164164 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
165165 : Op(op), LHS(lhs), RHS(rhs) {}
166 virtual Value *Codegen();
166 Value *Codegen() override;
167167 };
168168
169169 /// CallExprAST - Expression class for function calls.
174174 public:
175175 CallExprAST(const std::string &callee, std::vector &args)
176176 : Callee(callee), Args(args) {}
177 virtual Value *Codegen();
177 Value *Codegen() override;
178178 };
179179
180180 /// IfExprAST - Expression class for if/then/else.
184184 public:
185185 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
186186 : Cond(cond), Then(then), Else(_else) {}
187 virtual Value *Codegen();
187 Value *Codegen() override;
188188 };
189189
190190 /// ForExprAST - Expression class for for/in.
196196 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
197197 ExprAST *step, ExprAST *body)
198198 : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
199 virtual Value *Codegen();
199 Value *Codegen() override;
200200 };
201201
202202 /// PrototypeAST - This class represents the "prototype" for a function,
137137
138138 public:
139139 NumberExprAST(double val) : Val(val) {}
140 virtual Value *Codegen();
140 Value *Codegen() override;
141141 };
142142
143143 /// VariableExprAST - Expression class for referencing a variable, like "a".
147147 public:
148148 VariableExprAST(const std::string &name) : Name(name) {}
149149 const std::string &getName() const { return Name; }
150 virtual Value *Codegen();
150 Value *Codegen() override;
151151 };
152152
153153 /// UnaryExprAST - Expression class for a unary operator.
158158 public:
159159 UnaryExprAST(char opcode, ExprAST *operand)
160160 : Opcode(opcode), Operand(operand) {}
161 virtual Value *Codegen();
161 Value *Codegen() override;
162162 };
163163
164164 /// BinaryExprAST - Expression class for a binary operator.
169169 public:
170170 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
171171 : Op(op), LHS(lhs), RHS(rhs) {}
172 virtual Value *Codegen();
172 Value *Codegen() override;
173173 };
174174
175175 /// CallExprAST - Expression class for function calls.
180180 public:
181181 CallExprAST(const std::string &callee, std::vector &args)
182182 : Callee(callee), Args(args) {}
183 virtual Value *Codegen();
183 Value *Codegen() override;
184184 };
185185
186186 /// IfExprAST - Expression class for if/then/else.
190190 public:
191191 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
192192 : Cond(cond), Then(then), Else(_else) {}
193 virtual Value *Codegen();
193 Value *Codegen() override;
194194 };
195195
196196 /// ForExprAST - Expression class for for/in.
202202 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
203203 ExprAST *step, ExprAST *body)
204204 : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
205 virtual Value *Codegen();
205 Value *Codegen() override;
206206 };
207207
208208 /// VarExprAST - Expression class for var/in
215215 ExprAST *body)
216216 : VarNames(varnames), Body(body) {}
217217
218 virtual Value *Codegen();
218 Value *Codegen() override;
219219 };
220220
221221 /// PrototypeAST - This class represents the "prototype" for a function,
220220
221221 public:
222222 NumberExprAST(double val) : Val(val) {}
223 virtual std::ostream &dump(std::ostream &out, int ind) {
223 std::ostream &dump(std::ostream &out, int ind) override {
224224 return ExprAST::dump(out << Val, ind);
225225 }
226 virtual Value *Codegen();
226 Value *Codegen() override;
227227 };
228228
229229 /// VariableExprAST - Expression class for referencing a variable, like "a".
234234 VariableExprAST(SourceLocation Loc, const std::string &name)
235235 : ExprAST(Loc), Name(name) {}
236236 const std::string &getName() const { return Name; }
237 virtual std::ostream &dump(std::ostream &out, int ind) {
237 std::ostream &dump(std::ostream &out, int ind) override {
238238 return ExprAST::dump(out << Name, ind);
239239 }
240 virtual Value *Codegen();
240 Value *Codegen() override;
241241 };
242242
243243 /// UnaryExprAST - Expression class for a unary operator.
248248 public:
249249 UnaryExprAST(char opcode, ExprAST *operand)
250250 : Opcode(opcode), Operand(operand) {}
251 virtual std::ostream &dump(std::ostream &out, int ind) {
251 std::ostream &dump(std::ostream &out, int ind) override {
252252 ExprAST::dump(out << "unary" << Opcode, ind);
253253 Operand->dump(out, ind + 1);
254254 return out;
255255 }
256 virtual Value *Codegen();
256 Value *Codegen() override;
257257 };
258258
259259 /// BinaryExprAST - Expression class for a binary operator.
264264 public:
265265 BinaryExprAST(SourceLocation Loc, char op, ExprAST *lhs, ExprAST *rhs)
266266 : ExprAST(Loc), Op(op), LHS(lhs), RHS(rhs) {}
267 virtual std::ostream &dump(std::ostream &out, int ind) {
267 std::ostream &dump(std::ostream &out, int ind) override {
268268 ExprAST::dump(out << "binary" << Op, ind);
269269 LHS->dump(indent(out, ind) << "LHS:", ind + 1);
270270 RHS->dump(indent(out, ind) << "RHS:", ind + 1);
271271 return out;
272272 }
273 virtual Value *Codegen();
273 Value *Codegen() override;
274274 };
275275
276276 /// CallExprAST - Expression class for function calls.
282282 CallExprAST(SourceLocation Loc, const std::string &callee,
283283 std::vector &args)
284284 : ExprAST(Loc), Callee(callee), Args(args) {}
285 virtual std::ostream &dump(std::ostream &out, int ind) {
285 std::ostream &dump(std::ostream &out, int ind) override {
286286 ExprAST::dump(out << "call " << Callee, ind);
287287 for (ExprAST *Arg : Args)
288288 Arg->dump(indent(out, ind + 1), ind + 1);
289289 return out;
290290 }
291 virtual Value *Codegen();
291 Value *Codegen() override;
292292 };
293293
294294 /// IfExprAST - Expression class for if/then/else.
298298 public:
299299 IfExprAST(SourceLocation Loc, ExprAST *cond, ExprAST *then, ExprAST *_else)
300300 : ExprAST(Loc), Cond(cond), Then(then), Else(_else) {}
301 virtual std::ostream &dump(std::ostream &out, int ind) {
301 std::ostream &dump(std::ostream &out, int ind) override {
302302 ExprAST::dump(out << "if", ind);
303303 Cond->dump(indent(out, ind) << "Cond:", ind + 1);
304304 Then->dump(indent(out, ind) << "Then:", ind + 1);
305305 Else->dump(indent(out, ind) << "Else:", ind + 1);
306306 return out;
307307 }
308 virtual Value *Codegen();
308 Value *Codegen() override;
309309 };
310310
311311 /// ForExprAST - Expression class for for/in.
317317 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
318318 ExprAST *step, ExprAST *body)
319319 : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
320 virtual std::ostream &dump(std::ostream &out, int ind) {
320 std::ostream &dump(std::ostream &out, int ind) override {
321321 ExprAST::dump(out << "for", ind);
322322 Start->dump(indent(out, ind) << "Cond:", ind + 1);
323323 End->dump(indent(out, ind) << "End:", ind + 1);
325325 Body->dump(indent(out, ind) << "Body:", ind + 1);
326326 return out;
327327 }
328 virtual Value *Codegen();
328 Value *Codegen() override;
329329 };
330330
331331 /// VarExprAST - Expression class for var/in
338338 ExprAST *body)
339339 : VarNames(varnames), Body(body) {}
340340
341 virtual std::ostream &dump(std::ostream &out, int ind) {
341 std::ostream &dump(std::ostream &out, int ind) override {
342342 ExprAST::dump(out << "var", ind);
343343 for (const auto &NamedVar : VarNames)
344344 NamedVar.second->dump(indent(out, ind) << NamedVar.first << ':', ind + 1);
345345 Body->dump(indent(out, ind) << "Body:", ind + 1);
346346 return out;
347347 }
348 virtual Value *Codegen();
348 Value *Codegen() override;
349349 };
350350
351351 /// PrototypeAST - This class represents the "prototype" for a function,
164164 AssumptionCache &getAssumptionCache(Function &F);
165165
166166 AssumptionCacheTracker();
167 ~AssumptionCacheTracker();
167 ~AssumptionCacheTracker() override;
168168
169169 void releaseMemory() override { AssumptionCaches.shrink_and_clear(); }
170170
3333
3434 BlockFrequencyInfo();
3535
36 ~BlockFrequencyInfo();
36 ~BlockFrequencyInfo() override;
3737
3838 void getAnalysisUsage(AnalysisUsage &AU) const override;
3939
317317 static char ID; // Class identification, replacement for typeinfo
318318
319319 CallGraphWrapperPass();
320 virtual ~CallGraphWrapperPass();
320 ~CallGraphWrapperPass() override;
321321
322322 /// \brief The internal \c CallGraph around which the rest of this interface
323323 /// is wrapped.
218218 public:
219219 FullDependence(Instruction *Src, Instruction *Dst, bool LoopIndependent,
220220 unsigned Levels);
221 ~FullDependence() { delete[] DV; }
221 ~FullDependence() override { delete[] DV; }
222222
223223 /// isLoopIndependent - Returns true if this is a loop-independent
224224 /// dependence.
106106 static char ID;
107107
108108 InlineCostAnalysis();
109 ~InlineCostAnalysis();
109 ~InlineCostAnalysis() override;
110110
111111 // Pass interface implementation.
112112 void getAnalysisUsage(AnalysisUsage &AU) const override;
3838 /// The default byte alignment for jump tables is 16, which is large but
3939 /// usually safe.
4040 JumpInstrTableInfo(uint64_t ByteAlign = 16);
41 virtual ~JumpInstrTableInfo();
41 ~JumpInstrTableInfo() override;
4242 const char *getPassName() const override {
4343 return "Jump-Instruction Table Info";
4444 }
3838 LazyValueInfo() : FunctionPass(ID), PImpl(nullptr) {
3939 initializeLazyValueInfoPass(*PassRegistry::getPassRegistry());
4040 }
41 ~LazyValueInfo() { assert(!PImpl && "releaseMemory not called"); }
41 ~LazyValueInfo() override { assert(!PImpl && "releaseMemory not called"); }
4242
4343 /// This is used to return true/false/dunno results.
4444 enum Tristate {
3535 : FunctionPass(ID), LCI(LC) {
3636 initializeLibCallAliasAnalysisPass(*PassRegistry::getPassRegistry());
3737 }
38 ~LibCallAliasAnalysis();
39
38 ~LibCallAliasAnalysis() override;
39
4040 ModRefResult getModRefInfo(ImmutableCallSite CS,
4141 const Location &Loc) override;
4242
328328
329329 public:
330330 MemoryDependenceAnalysis();
331 ~MemoryDependenceAnalysis();
331 ~MemoryDependenceAnalysis() override;
332332 static char ID;
333333
334334 /// Pass Implementation stuff. This doesn't do any analysis eagerly.
2929 DT = new DominatorTreeBase(true);
3030 }
3131
32 ~PostDominatorTree();
32 ~PostDominatorTree() override;
3333
3434 bool runOnFunction(Function &F) override;
3535
841841 public:
842842 explicit RegionInfo();
843843
844 virtual ~RegionInfo();
844 ~RegionInfo() override;
845845
846846 // updateStatistics - Update statistic about created regions.
847847 void updateStatistics(Region *R) final;
857857 static char ID;
858858 explicit RegionInfoPass();
859859
860 ~RegionInfoPass();
860 ~RegionInfoPass() override;
861861
862862 RegionInfo &getRegionInfo() { return RI; }
863863
139139 explicit AsmPrinter(TargetMachine &TM, std::unique_ptr Streamer);
140140
141141 public:
142 virtual ~AsmPrinter();
142 ~AsmPrinter() override;
143143
144144 DwarfDebug *getDwarfDebug() { return DD; }
145145 DwarfDebug *getDwarfDebug() const { return DD; }
9999 public:
100100 static char ID; // Pass identification, replacement for typeid
101101 LiveIntervals();
102 virtual ~LiveIntervals();
102 ~LiveIntervals() override;
103103
104104 // Calculate the spill weight to assign to a single instruction.
105105 static float getSpillWeight(bool isDef, bool isUse,
121121 MRI.setDelegate(this);
122122 }
123123
124 ~LiveRangeEdit() { MRI.resetDelegate(this); }
124 ~LiveRangeEdit() override { MRI.resetDelegate(this); }
125125
126126 LiveInterval &getParent() const {
127127 assert(Parent && "No parent LiveInterval");
3434
3535 MachineBlockFrequencyInfo();
3636
37 ~MachineBlockFrequencyInfo();
37 ~MachineBlockFrequencyInfo() override;
3838
3939 void getAnalysisUsage(AnalysisUsage &AU) const override;
4040
7171
7272 MachineDominatorTree();
7373
74 ~MachineDominatorTree();
74 ~MachineDominatorTree() override;
7575
7676 DominatorTreeBase &getBase() {
7777 applySplitCriticalEdges();
3030 public:
3131 static char ID;
3232 explicit MachineFunctionAnalysis(const TargetMachine &tm);
33 ~MachineFunctionAnalysis();
33 ~MachineFunctionAnalysis() override;
3434
3535 MachineFunction &getMF() const { return *MF; }
3636
198198 // Real constructor.
199199 MachineModuleInfo(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
200200 const MCObjectFileInfo *MOFI);
201 ~MachineModuleInfo();
201 ~MachineModuleInfo() override;
202202
203203 // Initialization and Finalization
204204 bool doInitialization(Module &) override;
123123 public:
124124 RegisterPassParser(cl::Option &O)
125125 : cl::parser(O) {}
126 ~RegisterPassParser() { RegistryClass::setListener(nullptr); }
126 ~RegisterPassParser() override { RegistryClass::setListener(nullptr); }
127127
128128 void initialize() {
129129 cl::parser::initialize();
3232
3333 MachinePostDominatorTree();
3434
35 ~MachinePostDominatorTree();
35 ~MachinePostDominatorTree() override;
3636
3737 FunctionPass *createMachinePostDominatorTreePass();
3838
7979 public:
8080 explicit MachineRegionInfo();
8181
82 virtual ~MachineRegionInfo();
82 ~MachineRegionInfo() override;
8383
8484 // updateStatistics - Update statistic about created regions.
8585 void updateStatistics(MachineRegion *R) final;
9797 static char ID;
9898 explicit MachineRegionInfoPass();
9999
100 ~MachineRegionInfoPass();
100 ~MachineRegionInfoPass() override;
101101
102102 MachineRegionInfo &getRegionInfo() {
103103 return RI;
384384 ShouldTrackPressure(false), RPTracker(RegPressure),
385385 TopRPTracker(TopPressure), BotRPTracker(BotPressure) {}
386386
387 virtual ~ScheduleDAGMILive();
387 ~ScheduleDAGMILive() override;
388388
389389 /// Return true if this DAG supports VReg liveness and RegPressure.
390390 bool hasVRegLiveness() const override { return true; }
908908 PostGenericScheduler(const MachineSchedContext *C):
909909 GenericSchedulerBase(C), Top(SchedBoundary::TopQID, "TopQ") {}
910910
911 virtual ~PostGenericScheduler() {}
911 ~PostGenericScheduler() override {}
912912
913913 void initPolicy(MachineBasicBlock::iterator Begin,
914914 MachineBasicBlock::iterator End,
124124 // Dummy constructor.
125125 TargetPassConfig();
126126
127 virtual ~TargetPassConfig();
127 ~TargetPassConfig() override;
128128
129129 static char ID;
130130
157157 bool RemoveKillFlags = false,
158158 LiveIntervals *LIS = nullptr);
159159
160 virtual ~ScheduleDAGInstrs() {}
160 ~ScheduleDAGInstrs() override {}
161161
162162 bool isPostRA() const { return IsPostRA; }
163163
5757
5858 explicit SelectionDAGISel(TargetMachine &tm,
5959 CodeGenOpt::Level OL = CodeGenOpt::Default);
60 virtual ~SelectionDAGISel();
60 ~SelectionDAGISel() override;
6161
6262 const TargetLowering *getTargetLowering() const { return TLI; }
6363
3838 public:
3939 TargetLoweringObjectFileELF() : UseInitArray(false) {}
4040
41 virtual ~TargetLoweringObjectFileELF() {}
41 ~TargetLoweringObjectFileELF() override {}
4242
4343 void emitPersonalityValue(MCStreamer &Streamer, const TargetMachine &TM,
4444 const MCSymbol *Sym) const override;
8787
8888 class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
8989 public:
90 virtual ~TargetLoweringObjectFileMachO() {}
90 ~TargetLoweringObjectFileMachO() override {}
9191 TargetLoweringObjectFileMachO();
9292
9393 /// Extract the dependent library name from a linker option string. Returns
135135
136136 class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
137137 public:
138 virtual ~TargetLoweringObjectFileCOFF() {}
138 ~TargetLoweringObjectFileCOFF() override {}
139139
140140 const MCSection *
141141 getExplicitSectionGlobal(const GlobalValue *GV,
2121 ConcreteSymbolEnumerator(std::unique_ptr SymbolEnumerator)
2222 : Enumerator(std::move(SymbolEnumerator)) {}
2323
24 virtual ~ConcreteSymbolEnumerator() {}
24 ~ConcreteSymbolEnumerator() override {}
2525
2626 uint32_t getChildCount() const override {
2727 return Enumerator->getChildCount();
5555 void operator=(const RTDyldMemoryManager&) = delete;
5656 public:
5757 RTDyldMemoryManager() {}
58 virtual ~RTDyldMemoryManager();
58 ~RTDyldMemoryManager() override;
5959
6060 void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override;
6161 void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override;
3939
4040 public:
4141 SectionMemoryManager() { }
42 virtual ~SectionMemoryManager();
42 ~SectionMemoryManager() override;
4343
4444 /// \brief Allocates a memory block of (at least) the given size suitable for
4545 /// executable code.
104104 BasicBlock *InsertBefore = nullptr) {
105105 return new BasicBlock(Context, Name, Parent, InsertBefore);
106106 }
107 ~BasicBlock();
107 ~BasicBlock() override;
108108
109109 /// \brief Return the enclosing method, or null if none.
110110 const Function *getParent() const { return Parent; }
546546 protected:
547547 explicit ConstantDataSequential(Type *ty, ValueTy VT, const char *Data)
548548 : Constant(ty, VT, nullptr, 0), DataElements(Data), Next(nullptr) {}
549 ~ConstantDataSequential() { delete Next; }
549 ~ConstantDataSequential() override { delete Next; }
550550
551551 static Constant *getImpl(StringRef Bytes, Type *Ty);
552552
113113 return new(0) Function(Ty, Linkage, N, M);
114114 }
115115
116 ~Function();
116 ~Function() override;
117117
118118 Type *getReturnType() const; // Return the type of the ret val
119119 FunctionType *getFunctionType() const; // Return the FunctionType for me
103103 LocalExecTLSModel
104104 };
105105
106 ~GlobalValue() {
106 ~GlobalValue() override {
107107 removeDeadConstantUsers(); // remove any dead constants using this.
108108 }
109109
6565 ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0,
6666 bool isExternallyInitialized = false);
6767
68 ~GlobalVariable() {
68 ~GlobalVariable() override {
6969 NumOperands = 1; // FIXME: needed by operator delete
7070 }
7171
5050 InlineAsm(PointerType *Ty, const std::string &AsmString,
5151 const std::string &Constraints, bool hasSideEffects,
5252 bool isAlignStack, AsmDialect asmDialect);
53 virtual ~InlineAsm();
53 ~InlineAsm() override;
5454
5555 /// When the ConstantUniqueMap merges two types and makes two InlineAsms
5656 /// identical, it destroys one of them with this method.
4343 : Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {}
4444
4545 // Out of line virtual method, so the vtable, etc has a home.
46 ~TerminatorInst();
46 ~TerminatorInst() override;
4747
4848 /// Virtual methods - Terminators should overload these and provide inline
4949 /// overrides of non-V methods.
101101 }
102102
103103 // Out of line virtual method, so the vtable, etc has a home.
104 ~UnaryInstruction();
104 ~UnaryInstruction() override;
105105
106106 /// Transparently provide more efficient getOperand methods.
107107 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
6161 };
6262 public:
6363 // Out of line virtual method, so the vtable, etc has a home.
64 ~Instruction();
64 ~Instruction() override;
6565
6666 /// user_back - Specialize the methods defined in Value, as we know that an
6767 /// instruction can only be used by other instructions.
9090 const Twine &Name, BasicBlock *InsertAtEnd);
9191
9292 // Out of line virtual method, so the vtable, etc. has a home.
93 virtual ~AllocaInst();
93 ~AllocaInst() override;
9494
9595 /// isArrayAllocation - Return true if there is an allocation size parameter
9696 /// to the allocation instruction that is not 1.
13341334 static Instruction* CreateFree(Value* Source, Instruction *InsertBefore);
13351335 static Instruction* CreateFree(Value* Source, BasicBlock *InsertAtEnd);
13361336
1337 ~CallInst();
1337 ~CallInst() override;
13381338
13391339 // Note that 'musttail' implies 'tail'.
13401340 enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2 };
21742174 const Twine &NameStr, BasicBlock *InsertAtEnd) {
21752175 return new PHINode(Ty, NumReservedValues, NameStr, InsertAtEnd);
21762176 }
2177 ~PHINode();
2177 ~PHINode() override;
21782178
21792179 /// Provide fast operand accessors
21802180 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
23652365 static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
23662366 unsigned NumReservedClauses,
23672367 const Twine &NameStr, BasicBlock *InsertAtEnd);
2368 ~LandingPadInst();
2368 ~LandingPadInst() override;
23692369
23702370 /// Provide fast operand accessors
23712371 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
24672467 static ReturnInst* Create(LLVMContext &C, BasicBlock *InsertAtEnd) {
24682468 return new(0) ReturnInst(C, InsertAtEnd);
24692469 }
2470 virtual ~ReturnInst();
2470 ~ReturnInst() override;
24712471
24722472 /// Provide fast operand accessors
24732473 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
27642764 return new SwitchInst(Value, Default, NumCases, InsertAtEnd);
27652765 }
27662766
2767 ~SwitchInst();
2767 ~SwitchInst() override;
27682768
27692769 /// Provide fast operand accessors
27702770 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
29502950 BasicBlock *InsertAtEnd) {
29512951 return new IndirectBrInst(Address, NumDests, InsertAtEnd);
29522952 }
2953 ~IndirectBrInst();
2953 ~IndirectBrInst() override;
29542954
29552955 /// Provide fast operand accessors.
29562956 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
4949 public:
5050
5151 PassManager();
52 ~PassManager();
52 ~PassManager() override;
5353
5454 void add(Pass *P) override;
5555
6969 /// FunctionPassManager ctor - This initializes the pass manager. It needs,
7070 /// but does not take ownership of, the specified Module.
7171 explicit FunctionPassManager(Module *M);
72 ~FunctionPassManager();
72 ~FunctionPassManager() override;
7373
7474 void add(Pass *P) override;
7575
4242 public cl::parser {
4343 public:
4444 PassNameParser(cl::Option &O);
45 virtual ~PassNameParser();
45 ~PassNameParser() override;
4646
4747 void initialize() {
4848 cl::parser::initialize();
163163 Metadata *MD;
164164
165165 MetadataAsValue(Type *Ty, Metadata *MD);
166 ~MetadataAsValue();
166 ~MetadataAsValue() override;
167167
168168 /// \brief Drop use of metadata (during teardown).
169169 void dropUse() { MD = nullptr; }
4141 // NOTE: Cannot use = delete because it's not legal to delete
4242 // an overridden method that's not deleted in the base class. Cannot leave
4343 // this unimplemented because that leads to an ODR-violation.
44 ~Operator();
44 ~Operator() override;
4545
4646 public:
4747 /// Return the opcode for this Instruction or ConstantExpr.
5959 NumOperands = 0;
6060 }
6161 public:
62 ~User() {
63 Use::zap(OperandList, OperandList + NumOperands);
64 }
62 ~User() override { Use::zap(OperandList, OperandList + NumOperands); }
6563 /// \brief Free memory allocated for User and Use objects.
6664 void operator delete(void *Usr);
6765 /// \brief Placement delete - required by std, but never called.
118118 };
119119
120120 struct ListCompleterConcept : CompleterConcept {
121 ~ListCompleterConcept();
121 ~ListCompleterConcept() override;
122122 CompletionAction complete(StringRef Buffer, size_t Pos) const override;
123123 static std::string getCommonPrefix(const std::vector &Comps);
124124 virtual std::vector getCompletions(StringRef Buffer,
1414 namespace llvm {
1515 class MCAsmInfoELF : public MCAsmInfo {
1616 virtual void anchor();
17 const MCSection *
18 getNonexecutableStackSection(MCContext &Ctx) const override final;
17 const MCSection *getNonexecutableStackSection(MCContext &Ctx) const final;
1918
2019 protected:
2120 MCAsmInfoELF();
142142 : MCFragment(FType, SD), BundlePadding(0)
143143 {
144144 }
145 virtual ~MCEncodedFragment();
145 ~MCEncodedFragment() override;
146146
147147 virtual SmallVectorImpl &getContents() = 0;
148148 virtual const SmallVectorImpl &getContents() const = 0;
181181 {
182182 }
183183
184 virtual ~MCEncodedFragmentWithFixups();
184 ~MCEncodedFragmentWithFixups() override;
185185
186186 typedef SmallVectorImpl::const_iterator const_fixup_iterator;
187187 typedef SmallVectorImpl::iterator fixup_iterator;
3333 : MCObjectStreamer(Context, TAB, OS, Emitter),
3434 SeenIdent(false) {}
3535
36 virtual ~MCELFStreamer();
36 ~MCELFStreamer() override;
3737
3838 /// state management
3939 void reset() override {
140140
141141 public:
142142 raw_counting_ostream() : Count(0) {}
143 ~raw_counting_ostream() { flush(); }
143 ~raw_counting_ostream() override { flush(); }
144144 };
145145
146146 raw_counting_ostream OutStream;
5050 protected:
5151 MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS,
5252 MCCodeEmitter *Emitter);
53 ~MCObjectStreamer();
53 ~MCObjectStreamer() override;
5454
5555 public:
5656 /// state management
3939
4040 public:
4141 AsmLexer(const MCAsmInfo &MAI);
42 ~AsmLexer();
42 ~AsmLexer() override;
4343
4444 void setBuffer(StringRef Buf, const char *ptr = nullptr);
4545
5252 assert ((Characteristics & 0x00F00000) == 0 &&
5353 "alignment must not be set upon section creation");
5454 }
55 ~MCSectionCOFF();
55 ~MCSectionCOFF() override;
5656
5757 public:
5858 /// ShouldOmitSectionDirective - Decides whether a '.section' directive
5858 : MCSection(SV_ELF, K, Begin), SectionName(Section), Type(type),
5959 Flags(flags), UniqueID(UniqueID), EntrySize(entrySize), Group(group),
6060 Associated(Associated) {}
61 ~MCSectionELF();
61 ~MCSectionELF() override;
6262
6363 void setSectionName(StringRef Name) { SectionName = Name; }
6464
8989 class AArch64TargetStreamer : public MCTargetStreamer {
9090 public:
9191 AArch64TargetStreamer(MCStreamer &S);
92 ~AArch64TargetStreamer();
92 ~AArch64TargetStreamer() override;
9393
9494 void finish() override;
9595
114114 class ARMTargetStreamer : public MCTargetStreamer {
115115 public:
116116 ARMTargetStreamer(MCStreamer &S);
117 ~ARMTargetStreamer();
117 ~ARMTargetStreamer() override;
118118
119119 virtual void emitFnStart();
120120 virtual void emitFnEnd();
109109 MCTargetOptions MCOptions;
110110
111111 public:
112 virtual ~MCTargetAsmParser();
112 ~MCTargetAsmParser() override;
113113
114114 uint64_t getAvailableFeatures() const { return AvailableFeatures; }
115115 void setAvailableFeatures(uint64_t Value) { AvailableFeatures = Value; }
3030
3131 public:
3232 IRObjectFile(MemoryBufferRef Object, std::unique_ptr M);
33 ~IRObjectFile();
33 ~IRObjectFile() override;
3434 void moveSymbolNext(DataRefImpl &Symb) const override;
3535 std::error_code printSymbolName(raw_ostream &OS,
3636 DataRefImpl Symb) const override;
117117
118118 class SymbolicFile : public Binary {
119119 public:
120 virtual ~SymbolicFile();
120 ~SymbolicFile() override;
121121 SymbolicFile(unsigned int Type, MemoryBufferRef Source);
122122
123123 // virtual interface.
319319
320320 public:
321321 InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
322 ~InputArgList();
322 ~InputArgList() override;
323323
324324 const char *getArgString(unsigned Index) const override {
325325 return ArgStrings[Index];
354354 public:
355355 /// Construct a new derived arg list from \p BaseArgs.
356356 DerivedArgList(const InputArgList &BaseArgs);
357 ~DerivedArgList();
357 ~DerivedArgList() override;
358358
359359 const char *getArgString(unsigned Index) const override {
360360 return BaseArgs.getArgString(Index);
249249
250250 explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
251251 // Force out-of-line virtual method.
252 virtual ~ModulePass();
252 ~ModulePass() override;
253253 };
254254
255255
278278 : ModulePass(pid) {}
279279
280280 // Force out-of-line virtual method.
281 virtual ~ImmutablePass();
281 ~ImmutablePass() override;
282282 };
283283
284284 //===----------------------------------------------------------------------===//
9393 Scanned = nullptr;
9494 }
9595
96 ~formatted_raw_ostream() {
96 ~formatted_raw_ostream() override {
9797 flush();
9898 releaseStream();
9999 }
887887 void *Ctxt = nullptr,
888888 SourceMgr::DiagHandlerTy DiagHandler = nullptr,
889889 void *DiagHandlerCtxt = nullptr);
890 ~Input();
890 ~Input() override;
891891
892892 // Check if there was an syntax or semantic error during parsing.
893893 std::error_code error();
954954 };
955955
956956 class MapHNode : public HNode {
957 virtual void anchor();
957 void anchor() override;
958958
959959 public:
960960 MapHNode(Node *n) : HNode(n) { }
973973 };
974974
975975 class SequenceHNode : public HNode {
976 virtual void anchor();
976 void anchor() override;
977977
978978 public:
979979 SequenceHNode(Node *n) : HNode(n) { }
10191019 class Output : public IO {
10201020 public:
10211021 Output(llvm::raw_ostream &, void *Ctxt=nullptr);
1022 virtual ~Output();
1022 ~Output() override;
10231023
10241024 bool outputting() override;
10251025 bool mapTag(StringRef, bool) override;
116116 setStream(Stream, Owns);
117117 }
118118
119 ~circular_raw_ostream() {
119 ~circular_raw_ostream() override {
120120 flush();
121121 flushBufferWithBanner();
122122 releaseStream();
3333
3434 public:
3535 raw_os_ostream(std::ostream &O) : OS(O) {}
36 ~raw_os_ostream();
36 ~raw_os_ostream() override;
3737 };
3838
3939 } // end llvm namespace
365365 /// this closes the file when the stream is destroyed.
366366 raw_fd_ostream(int fd, bool shouldClose, bool unbuffered=false);
367367
368 ~raw_fd_ostream();
368 ~raw_fd_ostream() override;
369369
370370 /// Manually flush the stream and close the file. Note that this does not call
371371 /// fsync.
447447 uint64_t current_pos() const override { return OS.size(); }
448448 public:
449449 explicit raw_string_ostream(std::string &O) : OS(O) {}
450 ~raw_string_ostream();
450 ~raw_string_ostream() override;
451451
452452 /// Flushes the stream contents to the target string and returns the string's
453453 /// reference.
474474 /// \param O The vector to write to; this should generally have at least 128
475475 /// bytes free to avoid any extraneous memory overhead.
476476 explicit raw_svector_ostream(SmallVectorImpl &O);
477 ~raw_svector_ostream();
477 ~raw_svector_ostream() override;
478478
479479 /// This is called when the SmallVector we're appending to is changed outside
480480 /// of the raw_svector_ostream's control. It is only safe to do this if the
497497
498498 public:
499499 explicit raw_null_ostream() {}
500 ~raw_null_ostream();
500 ~raw_null_ostream() override;
501501 };
502502
503503 } // end llvm namespace
4343 errs() << " " << Val << " " << Desc << " responses ("
4444 << Val*100/Sum << "%)\n";
4545 }
46 ~AliasAnalysisCounter() {
46 ~AliasAnalysisCounter() override {
4747 unsigned AASum = No+May+Partial+Must;
4848 unsigned MRSum = NoMR+JustRef+JustMod+MR;
4949 if (AASum + MRSum) { // Print a report if any counted queries occurred...
160160 assert(CFLAA != nullptr);
161161 }
162162
163 virtual ~FunctionHandle() {}
163 ~FunctionHandle() override {}
164164
165165 void deleted() override { removeSelfFromCache(); }
166166 void allUsesReplacedWith(Value *) override { removeSelfFromCache(); }
188188 initializeCFLAliasAnalysisPass(*PassRegistry::getPassRegistry());
189189 }
190190
191 virtual ~CFLAliasAnalysis() {}
191 ~CFLAliasAnalysis() override {}
192192
193193 void getAnalysisUsage(AnalysisUsage &AU) const override {
194194 AliasAnalysis::getAnalysisUsage(AU);
229229 DiagnosticHandlerFunction DiagnosticHandler);
230230 explicit BitcodeReader(DataStreamer *streamer, LLVMContext &C,
231231 DiagnosticHandlerFunction DiagnosticHandler);
232 ~BitcodeReader() { FreeState(); }
232 ~BitcodeReader() override { FreeState(); }
233233
234234 std::error_code materializeForwardReferencedFunctions();
235235
126126 AggressiveAntiDepBreaker(MachineFunction& MFi,
127127 const RegisterClassInfo &RCI,
128128 TargetSubtargetInfo::RegClassVector& CriticalPathRCs);
129 ~AggressiveAntiDepBreaker();
129 ~AggressiveAntiDepBreaker() override;
130130
131131 /// Initialize anti-dep breaking for a new basic block.
132132 void StartBlock(MachineBasicBlock *BB) override;
4747 // Main entry points.
4848 //
4949 DwarfCFIException(AsmPrinter *A);
50 virtual ~DwarfCFIException();
50 ~DwarfCFIException() override;
5151
5252 /// Emit all exception information that should come after the content.
5353 void endModule() override;
6969 // Main entry points.
7070 //
7171 ARMException(AsmPrinter *A);
72 virtual ~ARMException();
72 ~ARMException() override;
7373
7474 /// Emit all exception information that should come after the content.
7575 void endModule() override;
124124
125125 public:
126126 EHStreamer(AsmPrinter *A);
127 virtual ~EHStreamer();
127 ~EHStreamer() override;
128128
129129 // Unused.
130130 void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {}
4242 // Main entry points.
4343 //
4444 Win64Exception(AsmPrinter *A);
45 virtual ~Win64Exception();
45 ~Win64Exception() override;
4646
4747 /// Emit all exception information that should come after the content.
4848 void endModule() override;
113113 public:
114114 WinCodeViewLineTables(AsmPrinter *Asm);
115115
116 ~WinCodeViewLineTables() {
116 ~WinCodeViewLineTables() override {
117117 for (DirAndFilenameToFilepathMapTy::iterator
118118 I = DirAndFilenameToFilepathMap.begin(),
119119 E = DirAndFilenameToFilepathMap.end();
19011901 Inst->removeFromParent();
19021902 }
19031903
1904 ~InstructionRemover() { delete Replacer; }
1904 ~InstructionRemover() override { delete Replacer; }
19051905
19061906 /// \brief Really remove the instruction.
19071907 void commit() override { delete Inst; }
6868
6969 public:
7070 CriticalAntiDepBreaker(MachineFunction& MFi, const RegisterClassInfo&);
71 ~CriticalAntiDepBreaker();
71 ~CriticalAntiDepBreaker() override;
7272
7373 /// Initialize anti-dep breaking for a new basic block.
7474 void StartBlock(MachineBasicBlock *BB) override;
134134 // Dead defs generated during spilling.
135135 SmallVector DeadDefs;
136136
137 ~InlineSpiller() {}
137 ~InlineSpiller() override {}
138138
139139 public:
140140 InlineSpiller(MachineFunctionPass &pass, MachineFunction &mf, VirtRegMap &vrm)
3737 static char ID; // Pass identification, replacement for typeid
3838
3939 LiveDebugVariables();
40 ~LiveDebugVariables();
40 ~LiveDebugVariables() override;
4141
4242 /// renameRegister - Move any user variables in OldReg to NewReg:SubIdx.
4343 /// @param OldReg Old virtual register that is going away.
140140 TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
141141 SmallVectorImpl &CriticalPathRCs);
142142
143 ~SchedulePostRATDList();
143 ~SchedulePostRATDList() override;
144144
145145 /// startBlock - Initialize register live-range state for scheduling in
146146 /// this block.
172172 HazardRec = STI.getInstrInfo()->CreateTargetHazardRecognizer(&STI, this);
173173 }
174174
175 ~ScheduleDAGRRList() {
175 ~ScheduleDAGRRList() override {
176176 delete HazardRec;
177177 delete AvailableQueue;
178178 }
4343
4444 explicit ScheduleDAGSDNodes(MachineFunction &mf);
4545
46 virtual ~ScheduleDAGSDNodes() {}
46 ~ScheduleDAGSDNodes() override {}
4747
4848 /// Run - perform scheduling.
4949 ///
7575 HazardRec = STI.getInstrInfo()->CreateTargetHazardRecognizer(&STI, this);
7676 }
7777
78 ~ScheduleDAGVLIW() {
78 ~ScheduleDAGVLIW() override {
7979 delete HazardRec;
8080 delete AvailableQueue;
8181 }
25592559 SelectionDAG::DAGUpdateListener(DAG),
25602560 RecordedNodes(RN), MatchScopes(MS) { }
25612561
2562 void NodeDeleted(SDNode *N, SDNode *E) {
2562 void NodeDeleted(SDNode *N, SDNode *E) override {
25632563 // Some early-returns here to avoid the search if we deleted the node or
25642564 // if the update comes from MorphNodeTo (MorphNodeTo is the last thing we
25652565 // do, so it's unnecessary to update matching state at that point).
6969 static char ID; // Pass identification, replacement for typeid.
7070
7171 SpillPlacement() : MachineFunctionPass(ID), nodes(nullptr) {}
72 ~SpillPlacement() { releaseMemory(); }
72 ~SpillPlacement() override { releaseMemory(); }
7373
7474 /// BorderConstraint - A basic block has separate constraints for entry and
7575 /// exit.
135135 public:
136136 WinEHFrameVariableMaterializer(Function *OutlinedFn,
137137 FrameVarInfoMap &FrameVarInfo);
138 ~WinEHFrameVariableMaterializer() {}
139
140 virtual Value *materializeValueFor(Value *V) override;
138 ~WinEHFrameVariableMaterializer() override {}
139
140 Value *materializeValueFor(Value *V) override;
141141
142142 void escapeCatchObject(Value *V);
143143
196196 DataAlignmentFactor(DataAlignmentFactor),
197197 ReturnAddressRegister(ReturnAddressRegister) {}
198198
199 ~CIE() {
200 }
199 ~CIE() override {}
201200
202201 uint64_t getCodeAlignmentFactor() const { return CodeAlignmentFactor; }
203202 int64_t getDataAlignmentFactor() const { return DataAlignmentFactor; }
244243 InitialLocation(InitialLocation), AddressRange(AddressRange),
245244 LinkedCIE(Cie) {}
246245
247 ~FDE() {
248 }
246 ~FDE() override {}
249247
250248 CIE *getLinkedCIE() const { return LinkedCIE; }
251249
4747 reset();
4848 }
4949
50 uint32_t getChildCount() const { return Args.size(); }
50 uint32_t getChildCount() const override { return Args.size(); }
5151
52 std::unique_ptr getChildAtIndex(uint32_t Index) const {
52 std::unique_ptr
53 getChildAtIndex(uint32_t Index) const override {
5354 if (Index >= Args.size())
5455 return nullptr;
5556
5758 Args[Index]->getSymIndexId());
5859 }
5960
60 std::unique_ptr getNext() {
61 std::unique_ptr getNext() override {
6162 if (CurIter == Args.end())
6263 return nullptr;
6364 const auto &Result = **CurIter;
6566 return Session.getConcreteSymbolById(Result.getSymIndexId());
6667 }
6768
68 void reset() { CurIter = Args.empty() ? Args.end() : Args.begin(); }
69 void reset() override { CurIter = Args.empty() ? Args.end() : Args.begin(); }
6970
70 FunctionArgEnumerator *clone() const {
71 FunctionArgEnumerator *clone() const override {
7172 return new FunctionArgEnumerator(Session, Func);
7273 }
7374
3333 std::unique_ptr ArgEnumerator)
3434 : Session(PDBSession), Enumerator(std::move(ArgEnumerator)) {}
3535
36 uint32_t getChildCount() const { return Enumerator->getChildCount(); }
36 uint32_t getChildCount() const override {
37 return Enumerator->getChildCount();
38 }
3739
38 std::unique_ptr getChildAtIndex(uint32_t Index) const {
40 std::unique_ptr getChildAtIndex(uint32_t Index) const override {
3941 auto FunctionArgSymbol = Enumerator->getChildAtIndex(Index);
4042 if (!FunctionArgSymbol)
4143 return nullptr;
4244 return Session.getSymbolById(FunctionArgSymbol->getTypeId());
4345 }
4446
45 std::unique_ptr getNext() {
47 std::unique_ptr getNext() override {
4648 auto FunctionArgSymbol = Enumerator->getNext();
4749 if (!FunctionArgSymbol)
4850 return nullptr;
4951 return Session.getSymbolById(FunctionArgSymbol->getTypeId());
5052 }
5153
52 void reset() { Enumerator->reset(); }
54 void reset() override { Enumerator->reset(); }
5355
54 MyType *clone() const {
56 MyType *clone() const override {
5557 std::unique_ptr Clone(Enumerator->clone());
5658 return new FunctionArgEnumerator(Session, std::move(Clone));
5759 }
350350 public:
351351 SimpleBindingMemoryManager(const SimpleBindingMMFunctions& Functions,
352352 void *Opaque);
353 virtual ~SimpleBindingMemoryManager();
353 ~SimpleBindingMemoryManager() override;
354354
355355 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
356356 unsigned SectionID,
102102
103103 /// Unregisters each object that was previously registered and releases all
104104 /// internal resources.
105 virtual ~GDBJITRegistrationListener();
105 ~GDBJITRegistrationListener() override;
106106
107107 /// Creates an entry in the JIT registry for the buffer @p Object,
108108 /// which must contain an object file in executable memory with any
107107
108108 public:
109109 explicit Interpreter(std::unique_ptr M);
110 ~Interpreter();
110 ~Interpreter() override;
111111
112112 /// runAtExitHandlers - Run any functions registered by the program's calls to
113113 /// atexit(3), which we intercept and store in AtExitHandlers.
204204 ModulePtrSet::iterator E);
205205
206206 public:
207 ~MCJIT();
207 ~MCJIT() override;
208208
209209 /// @name ExecutionEngine interface implementation
210210 /// @{
106106 public:
107107 LinkingResolver(OrcMCJITReplacement &M) : M(M) {}
108108
109 RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) {
109 RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) override {
110110 return M.findMangledSymbol(Name);
111111 }
112112
113 RuntimeDyld::SymbolInfo findSymbolInLogicalDylib(const std::string &Name) {
113 RuntimeDyld::SymbolInfo
114 findSymbolInLogicalDylib(const std::string &Name) override {
114115 return M.ClientResolver->findSymbolInLogicalDylib(Name);
115116 }
116117
9999 public:
100100 RuntimeDyldELF(RuntimeDyld::MemoryManager &MemMgr,
101101 RuntimeDyld::SymbolResolver &Resolver);
102 virtual ~RuntimeDyldELF();
102 ~RuntimeDyldELF() override;
103103
104104 std::unique_ptr
105105 loadObject(const object::ObjectFile &O) override;
292292 Pass(PT_PassManager, ID), PMDataManager() { }
293293
294294 // Delete on the fly managers.
295 virtual ~MPPassManager() {
295 ~MPPassManager() override {
296296 for (std::map::iterator
297297 I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end();
298298 I != E; ++I) {
197197 MCObjectWriter::reset();
198198 }
199199
200 virtual ~ELFObjectWriter();
200 ~ELFObjectWriter() override;
201201
202202 void WriteWord(uint64_t W) {
203203 if (is64Bit())
174174 public:
175175 AsmParser(SourceMgr &SM, MCContext &Ctx, MCStreamer &Out,
176176 const MCAsmInfo &MAI);
177 virtual ~AsmParser();
177 ~AsmParser() override;
178178
179179 bool Run(bool NoInitialTextSection, bool NoFinalize = false) override;
180180
783783 std::vector Dups;
784784
785785 public:
786 ~StrDupSaver() {
786 ~StrDupSaver() override {
787787 for (std::vector::iterator I = Dups.begin(), E = Dups.end(); I != E;
788788 ++I) {
789789 char *Dup = *I;
5353 int Fd;
5454 public:
5555 DataFileStreamer() : Fd(0) {}
56 virtual ~DataFileStreamer() {
57 close(Fd);
58 }
56 ~DataFileStreamer() override { close(Fd); }
5957 size_t GetBytes(unsigned char *buf, size_t len) override {
6058 NumStreamFetches++;
6159 return read(Fd, buf, len);
2525 public:
2626 AArch64ELFObjectWriter(uint8_t OSABI, bool IsLittleEndian);
2727
28 virtual ~AArch64ELFObjectWriter();
28 ~AArch64ELFObjectWriter() override;
2929
3030 protected:
3131 unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
9393 : MCELFStreamer(Context, TAB, OS, Emitter), MappingSymbolCounter(0),
9494 LastEMS(EMS_None) {}
9595
96 ~AArch64ELFStreamer() {}
96 ~AArch64ELFStreamer() override {}
9797
9898 void ChangeSection(const MCSection *Section,
9999 const MCExpr *Subsection) override {
3939 public:
4040 AArch64MCCodeEmitter(const MCInstrInfo &mcii, MCContext &ctx) : Ctx(ctx) {}
4141
42 ~AArch64MCCodeEmitter() {}
42 ~AArch64MCCodeEmitter() override {}
4343
4444 // getBinaryCodeForInstr - TableGen'erated function for getting the
4545 // binary encoding for an instruction.
8585 }
8686
8787 public:
88 virtual ~ARMConstantPoolValue();
88 ~ARMConstantPoolValue() override;
8989
9090 ARMCP::ARMCPModifier getModifier() const { return Modifier; }
9191 const char *getModifierText() const;
9090 MCDisassembler(STI, Ctx) {
9191 }
9292
93 ~ARMDisassembler() {}
93 ~ARMDisassembler() override {}
9494
9595 DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size,
9696 ArrayRef Bytes, uint64_t Address,
105105 MCDisassembler(STI, Ctx) {
106106 }
107107
108 ~ThumbDisassembler() {}
108 ~ThumbDisassembler() override {}
109109
110110 DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size,
111111 ArrayRef Bytes, uint64_t Address,
3131 public:
3232 ARMELFObjectWriter(uint8_t OSABI);
3333
34 virtual ~ARMELFObjectWriter();
34 ~ARMELFObjectWriter() override;
3535
3636 unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
3737 bool IsPCRel) const override;
4747 : MCII(mcii), CTX(ctx), IsLittleEndian(IsLittle) {
4848 }
4949
50 ~ARMMCCodeEmitter() {}
50 ~ARMMCCodeEmitter() override {}
5151
5252 bool isThumb(const MCSubtargetInfo &STI) const {
5353 return (STI.getFeatureBits() & ARM::ModeThumb) != 0;
2525 : MCWinCOFFObjectTargetWriter(COFF::IMAGE_FILE_MACHINE_ARMNT) {
2626 assert(!Is64Bit && "AArch64 support not yet implemented");
2727 }
28 virtual ~ARMWinCOFFObjectWriter() { }
28 ~ARMWinCOFFObjectWriter() override {}
2929
3030 unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
3131 bool IsCrossSection,
2626 public:
2727 HexagonELFObjectWriter(uint8_t OSABI, StringRef C);
2828
29 virtual unsigned GetRelocType(MCValue const &Target, MCFixup const &Fixup,
30 bool IsPCRel) const override;
29 unsigned GetRelocType(MCValue const &Target, MCFixup const &Fixup,
30 bool IsPCRel) const override;
3131 };
3232 }
3333
2626 MipsELFObjectWriter(bool _is64Bit, uint8_t OSABI,
2727 bool _isN64, bool IsLittleEndian);
2828
29 virtual ~MipsELFObjectWriter();
29 ~MipsELFObjectWriter() override;
3030
3131 unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
3232 bool IsPCRel) const override;
4242 MipsMCCodeEmitter(const MCInstrInfo &mcii, MCContext &Ctx_, bool IsLittle)
4343 : MCII(mcii), Ctx(Ctx_), IsLittleEndian(IsLittle) {}
4444
45 ~MipsMCCodeEmitter() {}
45 ~MipsMCCodeEmitter() override {}
4646
4747 void EmitByte(unsigned char C, raw_ostream &OS) const;
4848
3939 MCCodeEmitter *Emitter)
4040 : MipsELFStreamer(Context, TAB, OS, Emitter), PendingCall(false) {}
4141
42 ~MipsNaClELFStreamer() {}
42 ~MipsNaClELFStreamer() override {}
4343
4444 private:
4545 // Whether we started the sandboxing sequence for calls. Calls are bundled
5151 COP2RegClass = &(TRI->getRegClass(Mips::COP2RegClassID));
5252 COP3RegClass = &(TRI->getRegClass(Mips::COP3RegClassID));
5353 }
54 ~MipsRegInfoRecord() {}
54 ~MipsRegInfoRecord() override {}
5555
5656 void EmitMipsOptionRecord() override;
5757 void SetPhysRegUsed(unsigned Reg, const MCRegisterInfo *MCRegInfo);
2424 public:
2525 PPCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)
2626 : MCDisassembler(STI, Ctx) {}
27 virtual ~PPCDisassembler() {}
27 ~PPCDisassembler() override {}
2828
2929 DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size,
3030 ArrayRef Bytes, uint64_t Address,
4343 : MCII(mcii), CTX(ctx),
4444 IsLittleEndian(ctx.getAsmInfo()->isLittleEndian()) {}
4545
46 ~PPCMCCodeEmitter() {}
46 ~PPCMCCodeEmitter() override {}
4747
4848 unsigned getDirectBrEncoding(const MCInst &MI, unsigned OpNo,
4949 SmallVectorImpl &Fixups,
1515 class PPCTargetStreamer : public MCTargetStreamer {
1616 public:
1717 PPCTargetStreamer(MCStreamer &S);
18 virtual ~PPCTargetStreamer();
18 ~PPCTargetStreamer() override;
1919 virtual void emitTCEntry(const MCSymbol &S) = 0;
2020 virtual void emitMachine(StringRef CPU) = 0;
2121 virtual void emitAbiVersion(int AbiVersion) = 0;
4848 MCContext &ctx)
4949 : MCII(mcii), MRI(mri), Ctx(ctx) { }
5050
51 ~SIMCCodeEmitter() { }
51 ~SIMCCodeEmitter() override {}
5252
5353 /// \brief Encode the instruction and write it to the OS.
5454 void EncodeInstruction(const MCInst &MI, raw_ostream &OS,
2525 Is64Bit ? ELF::EM_SPARCV9 : ELF::EM_SPARC,
2626 /*HasRelocationAddend*/ true) {}
2727
28 virtual ~SparcELFObjectWriter() {}
28 ~SparcELFObjectWriter() override {}
29
2930 protected:
3031 unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
3132 bool IsPCRel) const override;
3737 public:
3838 SparcMCCodeEmitter(MCContext &ctx): Ctx(ctx) {}
3939
40 ~SparcMCCodeEmitter() {}
40 ~SparcMCCodeEmitter() override {}
4141
4242 void EncodeInstruction(const MCInst &MI, raw_ostream &OS,
4343 SmallVectorImpl &Fixups,
2222 class SparcSelectionDAGInfo : public TargetSelectionDAGInfo {
2323 public:
2424 explicit SparcSelectionDAGInfo(const DataLayout &DL);
25 ~SparcSelectionDAGInfo();
25 ~SparcSelectionDAGInfo() override;
2626 };
2727
2828 }
2424 public:
2525 SystemZDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)
2626 : MCDisassembler(STI, Ctx) {}
27 virtual ~SystemZDisassembler() {}
27 ~SystemZDisassembler() override {}
2828
2929 DecodeStatus getInstruction(MCInst &instr, uint64_t &Size,
3030 ArrayRef Bytes, uint64_t Address,
3131 : MCII(mcii), Ctx(ctx) {
3232 }
3333
34 ~SystemZMCCodeEmitter() {}
34 ~SystemZMCCodeEmitter() override {}
3535
3636 // OVerride MCCodeEmitter.
3737 void EncodeInstruction(const MCInst &MI, raw_ostream &OS,
1919 public:
2020 SystemZObjectWriter(uint8_t OSABI);
2121
22 virtual ~SystemZObjectWriter();
22 ~SystemZObjectWriter() override;
2323
2424 protected:
2525 // Override MCELFObjectTargetWriter.
2121 public:
2222 X86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine);
2323
24 virtual ~X86ELFObjectWriter();
24 ~X86ELFObjectWriter() override;
25
2526 protected:
2627 unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
2728 bool IsPCRel) const override;
3838 : MCII(mcii), Ctx(ctx) {
3939 }
4040
41 ~X86MCCodeEmitter() {}
41 ~X86MCCodeEmitter() override {}
4242
4343 bool is64BitMode(const MCSubtargetInfo &STI) const {
4444 return (STI.getFeatureBits() & X86::Mode64Bit) != 0;
2424 class X86WinCOFFObjectWriter : public MCWinCOFFObjectTargetWriter {
2525 public:
2626 X86WinCOFFObjectWriter(bool Is64Bit);
27 virtual ~X86WinCOFFObjectWriter();
27 ~X86WinCOFFObjectWriter() override;
2828
2929 unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
3030 bool IsCrossSection,
1515 class XCoreTargetStreamer : public MCTargetStreamer {
1616 public:
1717 XCoreTargetStreamer(MCStreamer &S);
18 virtual ~XCoreTargetStreamer();
18 ~XCoreTargetStreamer() override;
1919 virtual void emitCCTopData(StringRef Name) = 0;
2020 virtual void emitCCTopFunction(StringRef Name) = 0;
2121 virtual void emitCCBottomData(StringRef Name) = 0;
4949 initializeAlignmentFromAssumptionsPass(*PassRegistry::getPassRegistry());
5050 }
5151
52 bool runOnFunction(Function &F);
53
54 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
52 bool runOnFunction(Function &F) override;
53
54 void getAnalysisUsage(AnalysisUsage &AU) const override {
5555 AU.addRequired();
5656 AU.addRequired();
5757 AU.addRequired();
164164 ToolArgs.clear();
165165 if (Args) ToolArgs = *Args;
166166 }
167 ~LLC() { delete gcc; }
167 ~LLC() override { delete gcc; }
168168
169169 /// compileProgram - Compile the specified program from bitcode to executable
170170 /// code. This does not produce any output, it is only used when debugging
6363
6464 public:
6565 RemoteMemoryManager() : Target(nullptr) {}
66 virtual ~RemoteMemoryManager();
66 ~RemoteMemoryManager() override;
6767
6868 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
6969 unsigned SectionID,
105105 void stop() override;
106106
107107 RemoteTargetExternal(std::string &Name) : RemoteTarget(), ChildName(Name) {}
108 virtual ~RemoteTargetExternal() {}
108 ~RemoteTargetExternal() override {}
109109
110110 private:
111111 std::string ChildName;
270270 this->CacheDir[this->CacheDir.size() - 1] != '/')
271271 this->CacheDir += '/';
272272 }
273 virtual ~LLIObjectCache() {}
273 ~LLIObjectCache() override {}
274274
275275 void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) override {
276276 const std::string ModuleID = M->getModuleIdentifier();
2121 unsigned NumTests;
2222
2323 protected:
24 virtual bool ExecuteOneTest(const changeset_ty &Changes) {
24 bool ExecuteOneTest(const changeset_ty &Changes) override {
2525 ++NumTests;
2626 return std::includes(Changes.begin(), Changes.end(),
2727 FailingSet.begin(), FailingSet.end());
3636 unsigned NumTests;
3737
3838 protected:
39 virtual bool ExecuteOneTest(const changeset_ty &Changes) {
39 bool ExecuteOneTest(const changeset_ty &Changes) override {
4040 ++NumTests;
4141 return std::includes(Changes.begin(), Changes.end(),
4242 FailingSet.begin(), FailingSet.end());
155155
156156 class SmallVectorTestBase : public testing::Test {
157157 protected:
158
159 void SetUp() {
160 Constructable::reset();
161 }
158 void SetUp() override { Constructable::reset(); }
162159
163160 template
164161 void assertEmpty(VectorT & v) {
7777 return 0;
7878 }
7979
80 void getAnalysisUsage(AnalysisUsage &AU) const {
80 void getAnalysisUsage(AnalysisUsage &AU) const override {
8181 AU.setPreservesAll();
8282 AU.addRequired();
8383 AU.addRequired();
8484 }
8585
86 bool runOnFunction(Function &F) {
86 bool runOnFunction(Function &F) override {
8787 if (!F.hasName() || F.getName() != "test")
8888 return false;
8989
2424 class ScalarEvolutionsTest : public testing::Test {
2525 protected:
2626 ScalarEvolutionsTest() : M("", Context), SE(*new ScalarEvolution) {}
27 ~ScalarEvolutionsTest() {
27 ~ScalarEvolutionsTest() override {
2828 // Manually clean up, since we allocated new SCEV objects after the
2929 // pass was finished.
3030 SE.releaseMemory();
3232 Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create());
3333 }
3434
35 virtual void SetUp() {
35 void SetUp() override {
3636 ASSERT_TRUE(Engine.get() != nullptr) << "EngineBuilder returned error: '"
3737 << Error << "'";
3838 }
8484 ReservedCodeSize(0), UsedCodeSize(0), ReservedDataSizeRO(0),
8585 UsedDataSizeRO(0), ReservedDataSizeRW(0), UsedDataSizeRW(0) {
8686 }
87
88 virtual bool needsToReserveAllocationSpace() {
89 return true;
90 }
91
92 virtual void reserveAllocationSpace(
93 uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) {
87
88 bool needsToReserveAllocationSpace() override { return true; }
89
90 void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO,
91 uintptr_t DataSizeRW) override {
9492 ReservedCodeSize = CodeSize;
9593 ReservedDataSizeRO = DataSizeRO;
9694 ReservedDataSizeRW = DataSizeRW;
102100 *UsedSize = AlignedBegin + AlignedSize;
103101 }
104102
105 virtual uint8_t* allocateDataSection(uintptr_t Size, unsigned Alignment,
106 unsigned SectionID, StringRef SectionName, bool IsReadOnly) {
103 uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
104 unsigned SectionID, StringRef SectionName,
105 bool IsReadOnly) override {
107106 useSpace(IsReadOnly ? &UsedDataSizeRO : &UsedDataSizeRW, Size, Alignment);
108107 return SectionMemoryManager::allocateDataSection(Size, Alignment,
109108 SectionID, SectionName, IsReadOnly);
110109 }
111110
112 uint8_t* allocateCodeSection(uintptr_t Size, unsigned Alignment,
113 unsigned SectionID, StringRef SectionName) {
111 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
112 unsigned SectionID,
113 StringRef SectionName) override {
114114 useSpace(&UsedCodeSize, Size, Alignment);
115115 return SectionMemoryManager::allocateCodeSection(Size, Alignment,
116116 SectionID, SectionName);
140140 // that they will fail the MCJIT C API tests.
141141 UnsupportedEnvironments.push_back(Triple::Cygnus);
142142 }
143
144 virtual void SetUp() {
143
144 void SetUp() override {
145145 didCallAllocateCodeSection = false;
146146 didAllocateCompactUnwindSection = false;
147147 didCallYield = false;
150150 Engine = nullptr;
151151 Error = nullptr;
152152 }
153
154 virtual void TearDown() {
153
154 void TearDown() override {
155155 if (Engine)
156156 LLVMDisposeExecutionEngine(Engine);
157157 else if (Module)
3232 ObjMap[ModuleID] = copyBuffer(Obj);
3333 }
3434
35 virtual std::unique_ptr getObject(const Module* M) override {
35 std::unique_ptr getObject(const Module *M) override {
3636 const MemoryBuffer* BufferFound = getObjectInternal(M);
3737 ModulesLookedUp.insert(M->getModuleIdentifier());
3838 if (!BufferFound)
8383 ReplacementRC = 7
8484 };
8585
86 virtual void SetUp() {
86 void SetUp() override {
8787 M.reset(createEmptyModule("
"));
8888 Main = insertMainFunction(M.get(), OriginalRC);
8989 }
2121
2222 class MCJITTest : public testing::Test, public MCJITTestBase {
2323 protected:
24 virtual void SetUp() { M.reset(createEmptyModule("
")); }
24 void SetUp() override { M.reset(createEmptyModule("
")); }
2525 };
2626
2727 // FIXME: Ensure creating an execution engine does not crash when constructed
2424 namespace {
2525 struct DPass : public FunctionPass {
2626 static char ID;
27 virtual bool runOnFunction(Function &F) {
27 bool runOnFunction(Function &F) override {
2828 DominatorTree *DT =
2929 &getAnalysis().getDomTree();
3030 PostDominatorTree *PDT = &getAnalysis();
175175
176176 return false;
177177 }
178 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
178 void getAnalysisUsage(AnalysisUsage &AU) const override {
179179 AU.addRequired();
180180 AU.addRequired();
181181 }
2525
2626 class IRBuilderTest : public testing::Test {
2727 protected:
28 virtual void SetUp() {
28 void SetUp() override {
2929 M.reset(new Module("MyModule", Ctx));
3030 FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),
3131 /*isVarArg=*/false);
3535 GlobalValue::ExternalLinkage, nullptr);
3636 }
3737
38 virtual void TearDown() {
38 void TearDown() override {
3939 BB = nullptr;
4040 M.reset();
4141 }
243243 RecordingVH(Value *V) : CallbackVH(V), DeletedCalls(0), AURWCalls(0) {}
244244
245245 private:
246 virtual void deleted() { DeletedCalls++; CallbackVH::deleted(); }
247 virtual void allUsesReplacedWith(Value *) { AURWCalls++; }
246 void deleted() override {
247 DeletedCalls++;
248 CallbackVH::deleted();
249 }
250 void allUsesReplacedWith(Value *) override { AURWCalls++; }
248251 };
249252
250253 RecordingVH RVH;
267270 : CallbackVH(V), DeletedCalls(0), AURWArgument(nullptr) {}
268271
269272 private:
270 virtual void deleted() { DeletedCalls++; CallbackVH::deleted(); }
271 virtual void allUsesReplacedWith(Value *new_value) {
273 void deleted() override {
274 DeletedCalls++;
275 CallbackVH::deleted();
276 }
277 void allUsesReplacedWith(Value *new_value) override {
272278 EXPECT_EQ(nullptr, AURWArgument);
273279 AURWArgument = new_value;
274280 }
297303 Context(&getGlobalContext()) {}
298304
299305 private:
300 virtual void deleted() {
306 void deleted() override {
301307 getValPtr()->replaceAllUsesWith(Constant::getNullValue(Type::getInt32Ty(getGlobalContext())));
302308 setValPtr(nullptr);
303309 }
304 virtual void allUsesReplacedWith(Value *new_value) {
310 void allUsesReplacedWith(Value *new_value) override {
305311 ASSERT_TRUE(nullptr != getValPtr());
306312 EXPECT_EQ(1U, getValPtr()->getNumUses());
307313 EXPECT_EQ(nullptr, AURWArgument);
340346 setValPtr(V);
341347 ToClear[1].reset(new WeakVH(V));
342348 }
343 virtual void deleted() {
349 void deleted() override {
344350 ToClear[0].reset();
345351 ToClear[1].reset();
346352 CallbackVH::deleted();
347353 }
348 virtual void allUsesReplacedWith(Value *) {
354 void allUsesReplacedWith(Value *) override {
349355 ToClear[0].reset();
350356 ToClear[1].reset();
351357 }
387393 ToClear[1] = &A1;
388394 }
389395
390 virtual void deleted() {
396 void deleted() override {
391397 *ToClear[0] = nullptr;
392398 *ToClear[1] = nullptr;
393399 CallbackVH::deleted();
2828 LE = new LineEditor("test", HistPath);
2929 }
3030
31 ~LineEditorTest() {
31 ~LineEditorTest() override {
3232 delete LE;
3333 sys::fs::remove(HistPath.str());
3434 }
2222
2323 class LinkModuleTest : public testing::Test {
2424 protected:
25 virtual void SetUp() {
25 void SetUp() override {
2626 M.reset(new Module("MyModule", Ctx));
2727 FunctionType *FTy = FunctionType::get(
2828 Type::getInt8PtrTy(Ctx), Type::getInt32Ty(Ctx), false /*=isVarArg*/);
5555 GV->setInitializer(ConstantArray::get(AT, Init));
5656 }
5757
58 virtual void TearDown() { M.reset(); }
58 void TearDown() override { M.reset(); }
5959
6060 LLVMContext Ctx;
6161 std::unique_ptr M;
6060 struct D9 : S1, D1 { S1 s1; };
6161 struct V1 { virtual ~V1(); };
6262 struct V2 { int x; virtual ~V2(); };
63 struct V3 : V1 { virtual ~V3(); };
64 struct V4 : virtual V2 { int y; virtual ~V4(); };
65 struct V5 : V4, V3 { double z; virtual ~V5(); };
63 struct V3 : V1 {
64 ~V3() override;
65 };
66 struct V4 : virtual V2 { int y;
67 ~V4() override;
68 };
69 struct V5 : V4, V3 { double z;
70 ~V5() override;
71 };
6672 struct V6 : S1 { virtual ~V6(); };
67 struct V7 : virtual V2, virtual V6 { virtual ~V7(); };
68 struct V8 : V5, virtual V6, V7 { double zz; virtual ~V8(); };
73 struct V7 : virtual V2, virtual V6 {
74 ~V7() override;
75 };
76 struct V8 : V5, virtual V6, V7 { double zz;
77 ~V8() override;
78 };
6979
7080 double S6::f() { return 0.0; }
7181 float D2::g() { return 0.0f; }
6464 StackOption(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3)
6565 : Base(M0, M1, M2, M3) {}
6666
67 ~StackOption() {
68 this->removeArgument();
69 }
67 ~StackOption() override { this->removeArgument(); }
7068 };
7169
7270
2525 : data("this is some data")
2626 { }
2727
28 virtual void SetUp() { }
28 void SetUp() override {}
2929
3030 /// Common testing for different modes of getOpenFileSlice.
3131 /// Creates a temporary file with known contents, and uses
307307 /// be placed. It is removed at the end of each test (must be empty).
308308 SmallString<128> TestDirectory;
309309
310 virtual void SetUp() {
310 void SetUp() override {
311311 ASSERT_NO_ERROR(
312312 fs::createUniqueDirectory("file-system-test", TestDirectory));
313313 // We don't care about this specific file.
315315 errs().flush();
316316 }
317317
318 virtual void TearDown() {
319 ASSERT_NO_ERROR(fs::remove(TestDirectory.str()));
320 }
318 void TearDown() override { ASSERT_NO_ERROR(fs::remove(TestDirectory.str())); }
321319 };
322320
323321 TEST_F(FileSystemTest, Unique) {
3030
3131 class CloneInstruction : public ::testing::Test {
3232 protected:
33 virtual void SetUp() {
34 V = nullptr;
35 }
33 void SetUp() override { V = nullptr; }
3634
3735 template
3836 T *clone(T *V1) {
4644 DeleteContainerPointers(Clones);
4745 }
4846
49 virtual void TearDown() {
47 void TearDown() override {
5048 eraseClones();
5149 DeleteContainerPointers(Orig);
5250 delete V;
205203
206204 class CloneFunc : public ::testing::Test {
207205 protected:
208 virtual void SetUp() {
206 void SetUp() override {
209207 SetupModule();
210208 CreateOldFunc();
211209 CreateNewFunc();
212210 SetupFinder();
213211 }
214212
215 virtual void TearDown() {
216 delete Finder;
217 }
213 void TearDown() override { delete Finder; }
218214
219215 void SetupModule() {
220216 M = new Module("", C);
193193 ScopeMatcher(ArrayRef children)
194194 : Matcher(Scope), Children(children.begin(), children.end()) {
195195 }
196 virtual ~ScopeMatcher();
196 ~ScopeMatcher() override;
197197
198198 unsigned getNumChildren() const { return Children.size(); }
199199
506506 public:
507507 SwitchOpcodeMatcher(ArrayRef > cases)
508508 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {}
509 virtual ~SwitchOpcodeMatcher();
509 ~SwitchOpcodeMatcher() override;
510510
511511 static inline bool classof(const Matcher *N) {
512512 return N->getKind() == SwitchOpcode;
560560 public:
561561 SwitchTypeMatcher(ArrayRef > cases)
562562 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {}
563 virtual ~SwitchTypeMatcher();
563 ~SwitchTypeMatcher() override;
564564
565565 static inline bool classof(const Matcher *N) {
566566 return N->getKind() == SwitchType;
6767 TestPartResultArray* result);
6868
6969 // The d'tor restores the previous test part result reporter.
70 virtual ~ScopedFakeTestPartResultReporter();
70 ~ScopedFakeTestPartResultReporter() override;
7171
7272 // Appends the TestPartResult object to the TestPartResultArray
7373 // received in the constructor.
7474 //
7575 // This method is from the TestPartResultReporterInterface
7676 // interface.
77 virtual void ReportTestPartResult(const TestPartResult& result);
77 void ReportTestPartResult(const TestPartResult &result) override;
78
7879 private:
7980 void Init();
8081
158158 : public TestPartResultReporterInterface {
159159 public:
160160 HasNewFatalFailureHelper();
161 virtual ~HasNewFatalFailureHelper();
162 virtual void ReportTestPartResult(const TestPartResult& result);
161 ~HasNewFatalFailureHelper() override;
162 void ReportTestPartResult(const TestPartResult &result) override;
163163 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
164164 private:
165165 bool has_new_fatal_failure_;
981981 class EmptyTestEventListener : public TestEventListener {
982982 virtual void anchor();
983983 public:
984 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
985 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
986 int /*iteration*/) {}
987 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
988 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
989 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
990 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
991 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
992 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
993 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
994 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
995 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
996 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
997 int /*iteration*/) {}
998 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
984 void OnTestProgramStart(const UnitTest & /*unit_test*/) override {}
985 void OnTestIterationStart(const UnitTest & /*unit_test*/,
986 int /*iteration*/) override {}
987 void OnEnvironmentsSetUpStart(const UnitTest & /*unit_test*/) override {}
988 void OnEnvironmentsSetUpEnd(const UnitTest & /*unit_test*/) override {}
989 void OnTestCaseStart(const TestCase & /*test_case*/) override {}
990 void OnTestStart(const TestInfo & /*test_info*/) override {}
991 void OnTestPartResult(const TestPartResult & /*test_part_result*/) override {
992 }
993 void OnTestEnd(const TestInfo & /*test_info*/) override {}
994 void OnTestCaseEnd(const TestCase & /*test_case*/) override {}
995 void OnEnvironmentsTearDownStart(const UnitTest & /*unit_test*/) override {}
996 void OnEnvironmentsTearDownEnd(const UnitTest & /*unit_test*/) override {}
997 void OnTestIterationEnd(const UnitTest & /*unit_test*/,
998 int /*iteration*/) override {}
999 void OnTestProgramEnd(const UnitTest & /*unit_test*/) override {}
9991000 };
10001001
10011002 // TestEventListeners lets users add listeners to track events in Google Test.
146146 // A concrete DeathTestFactory implementation for normal use.
147147 class DefaultDeathTestFactory : public DeathTestFactory {
148148 public:
149 virtual bool Create(const char* statement, const RE* regex,
150 const char* file, int line, DeathTest** test);
149 bool Create(const char *statement, const RE *regex, const char *file,
150 int line, DeathTest **test) override;
151151 };
152152
153153 // Returns true if exit_status describes a process that was terminated
554554 template
555555 class TestFactoryImpl : public TestFactoryBase {
556556 public:
557 virtual Test* CreateTest() { return new TestClass; }
557 Test *CreateTest() override { return new TestClass; }
558558 };
559559
560560 #if GTEST_OS_WINDOWS
269269 template
270270 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
271271 : container_(begin, end) {}
272 virtual ~ValuesInIteratorRangeGenerator() {}
273
274 virtual ParamIteratorInterface* Begin() const {
272 ~ValuesInIteratorRangeGenerator() override {}
273
274 ParamIteratorInterface *Begin() const override {
275275 return new Iterator(this, container_.begin());
276276 }
277 virtual ParamIteratorInterface* End() const {
277 ParamIteratorInterface *End() const override {
278278 return new Iterator(this, container_.end());
279279 }
280280
286286 Iterator(const ParamGeneratorInterface* base,
287287 typename ContainerType::const_iterator iterator)
288288 : base_(base), iterator_(iterator) {}
289 virtual ~Iterator() {}
290
291 virtual const ParamGeneratorInterface* BaseGenerator() const {
289 ~Iterator() override {}
290
291 const ParamGeneratorInterface *BaseGenerator() const override {
292292 return base_;
293293 }
294 virtual void Advance() {
294 void Advance() override {
295295 ++iterator_;
296296 value_.reset();
297297 }
298 virtual ParamIteratorInterface* Clone() const {
298 ParamIteratorInterface *Clone() const override {
299299 return new Iterator(*this);
300300 }
301301 // We need to use cached value referenced by iterator_ because *iterator_
305305 // can advance iterator_ beyond the end of the range, and we cannot
306306 // detect that fact. The client code, on the other hand, is
307307 // responsible for not calling Current() on an out-of-range iterator.
308 virtual const T* Current() const {
308 const T *Current() const override {
309309 if (value_.get() == NULL)
310310 value_.reset(new T(*iterator_));
311311 return value_.get();
312312 }
313 virtual bool Equals(const ParamIteratorInterface& other) const {
313 bool Equals(const ParamIteratorInterface &other) const override {
314314 // Having the same base generator guarantees that the other
315315 // iterator is of the same type and we can downcast.
316316 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
354354 typedef typename TestClass::ParamType ParamType;
355355 explicit ParameterizedTestFactory(ParamType parameter) :
356356 parameter_(parameter) {}
357 virtual Test* CreateTest() {
357 Test *CreateTest() override {
358358 TestClass::SetParam(¶meter_);
359359 return new TestClass();
360360 }
393393
394394 TestMetaFactory() {}
395395
396 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
396 TestFactoryBase *CreateTestFactory(ParamType parameter) override {
397397 return new ParameterizedTestFactory(parameter);
398398 }
399399
453453 : test_case_name_(name) {}
454454
455455 // Test case base name for display purposes.
456 virtual const string& GetTestCaseName() const { return test_case_name_; }
456 const string &GetTestCaseName() const override { return test_case_name_; }
457457 // Test case id to verify identity.
458 virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); }
458 TypeId GetTestCaseTypeId() const override { return GetTypeId(); }
459459 // TEST_P macro uses AddTestPattern() to record information
460460 // about a single test in a LocalTestInfo structure.
461461 // test_case_name is the base name of the test case (without invocation
483483 // This method should not be called more then once on any single
484484 // instance of a ParameterizedTestCaseInfoBase derived class.
485485 // UnitTest has a guard to prevent from calling this method more then once.
486 virtual void RegisterTests() {
486 void RegisterTests() override {
487487 for (typename TestInfoContainer::iterator test_it = tests_.begin();
488488 test_it != tests_.end(); ++test_it) {
489489 linked_ptr test_info = *test_it;
11641164 GTEST_CHECK_POSIX_SUCCESS_(
11651165 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
11661166 }
1167 ~ThreadWithParam() { Join(); }
1167 ~ThreadWithParam() override { Join(); }
11681168
11691169 void Join() {
11701170 if (!finished_) {
11731173 }
11741174 }
11751175
1176 virtual void Run() {
1176 void Run() override {
11771177 if (thread_can_start_ != NULL)
11781178 thread_can_start_->WaitForNotification();
11791179 func_(param_);
333333 write_fd_(-1) {}
334334
335335 // read_fd_ is expected to be closed and cleared by a derived class.
336 ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
337
338 void Abort(AbortReason reason);
339 virtual bool Passed(bool status_ok);
336 ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
337
338 void Abort(AbortReason reason) override;
339 bool Passed(bool status_ok) override;
340340
341341 const char* statement() const { return statement_; }
342342 const RE* regex() const { return regex_; }
743743 ForkingDeathTest(const char* statement, const RE* regex);
744744
745745 // All of these virtual functions are inherited from DeathTest.
746 virtual int Wait();
746 int Wait() override;
747747
748748 protected:
749749 void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
779779 public:
780780 NoExecDeathTest(const char* a_statement, const RE* a_regex) :
781781 ForkingDeathTest(a_statement, a_regex) { }
782 virtual TestRole AssumeRole();
782 TestRole AssumeRole() override;
783783 };
784784
785785 // The AssumeRole process for a fork-and-run death test. It implements a
834834 ExecDeathTest(const char* a_statement, const RE* a_regex,
835835 const char* file, int line) :
836836 ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
837 virtual TestRole AssumeRole();
837 TestRole AssumeRole() override;
838
838839 private:
839840 // The name of the file in which the death test is located.
840841 const char* const file_;
430430 class OsStackTraceGetter : public OsStackTraceGetterInterface {
431431 public:
432432 OsStackTraceGetter() : caller_frame_(NULL) {}
433 virtual String CurrentStackTrace(int max_depth, int skip_count);
434 virtual void UponLeavingGTest();
433 String CurrentStackTrace(int max_depth, int skip_count) override;
434 void UponLeavingGTest() override;
435435
436436 // This string is inserted in place of stack frames that are part of
437437 // Google Test's implementation.
464464 explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
465465 // Implements the TestPartResultReporterInterface. Reports the test part
466466 // result in the current test.
467 virtual void ReportTestPartResult(const TestPartResult& result);
467 void ReportTestPartResult(const TestPartResult &result) override;
468468
469469 private:
470470 UnitTestImpl* const unit_test_;
480480 explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
481481 // Implements the TestPartResultReporterInterface. The implementation just
482482 // delegates to the current global test part result reporter of *unit_test_.
483 virtual void ReportTestPartResult(const TestPartResult& result);
483 void ReportTestPartResult(const TestPartResult &result) override;
484484
485485 private:
486486 UnitTestImpl* const unit_test_;
26622662 }
26632663
26642664 // The following methods override what's in the TestEventListener class.
2665 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
2666 virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
2667 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
2668 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
2669 virtual void OnTestCaseStart(const TestCase& test_case);
2670 virtual void OnTestStart(const TestInfo& test_info);
2671 virtual void OnTestPartResult(const TestPartResult& result);
2672 virtual void OnTestEnd(const TestInfo& test_info);
2673 virtual void OnTestCaseEnd(const TestCase& test_case);
2674 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
2675 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
2676 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
2677 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
2665 void OnTestProgramStart(const UnitTest & /*unit_test*/) override {}
2666 void OnTestIterationStart(const UnitTest &unit_test, int iteration) override;
2667 void OnEnvironmentsSetUpStart(const UnitTest &unit_test) override;
2668 void OnEnvironmentsSetUpEnd(const UnitTest & /*unit_test*/) override {}
2669 void OnTestCaseStart(const TestCase &test_case) override;
2670 void OnTestStart(const TestInfo &test_info) override;
2671 void OnTestPartResult(const TestPartResult &result) override;
2672 void OnTestEnd(const TestInfo &test_info) override;
2673 void OnTestCaseEnd(const TestCase &test_case) override;
2674 void OnEnvironmentsTearDownStart(const UnitTest &unit_test) override;
2675 void OnEnvironmentsTearDownEnd(const UnitTest & /*unit_test*/) override {}
2676 void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override;
2677 void OnTestProgramEnd(const UnitTest & /*unit_test*/) override {}
26782678
26792679 private:
26802680 static void PrintFailedTests(const UnitTest& unit_test);
28682868 class TestEventRepeater : public TestEventListener {
28692869 public:
28702870 TestEventRepeater() : forwarding_enabled_(true) {}
2871 virtual ~TestEventRepeater();
2871 ~TestEventRepeater() override;
28722872 void Append(TestEventListener *listener);
28732873 TestEventListener* Release(TestEventListener* listener);
28742874
28772877 bool forwarding_enabled() const { return forwarding_enabled_; }
28782878 void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
28792879
2880 virtual void OnTestProgramStart(const UnitTest& unit_test);
2881 virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
2882 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
2883 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
2884 virtual void OnTestCaseStart(const TestCase& test_case);
2885 virtual void OnTestStart(const TestInfo& test_info);
2886 virtual void OnTestPartResult(const TestPartResult& result);
2887 virtual void OnTestEnd(const TestInfo& test_info);
2888 virtual void OnTestCaseEnd(const TestCase& test_case);
2889 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
2890 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
2891 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
2892 virtual void OnTestProgramEnd(const UnitTest& unit_test);
2880 void OnTestProgramStart(const UnitTest &unit_test) override;
2881 void OnTestIterationStart(const UnitTest &unit_test, int iteration) override;
2882 void OnEnvironmentsSetUpStart(const UnitTest &unit_test) override;
2883 void OnEnvironmentsSetUpEnd(const UnitTest &unit_test) override;
2884 void OnTestCaseStart(const TestCase &test_case) override;
2885 void OnTestStart(const TestInfo &test_info) override;
2886 void OnTestPartResult(const TestPartResult &result) override;
2887 void OnTestEnd(const TestInfo &test_info) override;
2888 void OnTestCaseEnd(const TestCase &test_case) override;
2889 void OnEnvironmentsTearDownStart(const UnitTest &unit_test) override;
2890 void OnEnvironmentsTearDownEnd(const UnitTest &unit_test) override;
2891 void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override;
2892 void OnTestProgramEnd(const UnitTest &unit_test) override;
28932893
28942894 private:
28952895 // Controls whether events will be forwarded to listeners_. Set to false
29822982 public:
29832983 explicit XmlUnitTestResultPrinter(const char* output_file);
29842984
2985 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
2985 void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override;
29862986
29872987 private:
29882988 // Is c a whitespace character that is normalized to a space character
33093309 Send("gtest_streaming_protocol_version=1.0\n");
33103310 }
33113311
3312 virtual ~StreamingListener() {
3312 ~StreamingListener() override {
33133313 if (sockfd_ != -1)
33143314 CloseConnection();
33153315 }
33163316
3317 void OnTestProgramStart(const UnitTest& /* unit_test */) {
3317 void OnTestProgramStart(const UnitTest & /* unit_test */) override {
33183318 Send("event=TestProgramStart\n");
33193319 }
33203320
3321 void OnTestProgramEnd(const UnitTest& unit_test) {
3321 void OnTestProgramEnd(const UnitTest &unit_test) override {
33223322 // Note that Google Test current only report elapsed time for each
33233323 // test iteration, not for the entire test program.
33243324 Send(String::Format("event=TestProgramEnd&passed=%d\n",
33283328 CloseConnection();
33293329 }
33303330
3331 void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
3331 void OnTestIterationStart(const UnitTest & /* unit_test */,
3332 int iteration) override {
33323333 Send(String::Format("event=TestIterationStart&iteration=%d\n",
33333334 iteration));
33343335 }
33353336
3336 void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
3337 void OnTestIterationEnd(const UnitTest &unit_test,
3338 int /* iteration */) override {
33373339 Send(String::Format("event=TestIterationEnd&passed=%d&elapsed_time=%sms\n",
33383340 unit_test.Passed(),
33393341 StreamableToString(unit_test.elapsed_time()).c_str()));
33403342 }
33413343
3342 void OnTestCaseStart(const TestCase& test_case) {
3344 void OnTestCaseStart(const TestCase &test_case) override {
33433345 Send(String::Format("event=TestCaseStart&name=%s\n", test_case.name()));
33443346 }
33453347
3346 void OnTestCaseEnd(const TestCase& test_case) {
3348 void OnTestCaseEnd(const TestCase &test_case) override {
33473349 Send(String::Format("event=TestCaseEnd&passed=%d&elapsed_time=%sms\n",
33483350 test_case.Passed(),
33493351 StreamableToString(test_case.elapsed_time()).c_str()));
33503352 }
33513353
3352 void OnTestStart(const TestInfo& test_info) {
3354 void OnTestStart(const TestInfo &test_info) override {
33533355 Send(String::Format("event=TestStart&name=%s\n", test_info.name()));
33543356 }
33553357
3356 void OnTestEnd(const TestInfo& test_info) {
3358 void OnTestEnd(const TestInfo &test_info) override {
33573359 Send(String::Format(
33583360 "event=TestEnd&passed=%d&elapsed_time=%sms\n",
33593361 (test_info.result())->Passed(),
33603362 StreamableToString((test_info.result())->elapsed_time()).c_str()));
33613363 }
33623364
3363 void OnTestPartResult(const TestPartResult& test_part_result) {
3365 void OnTestPartResult(const TestPartResult &test_part_result) override {
33643366 const char* file_name = test_part_result.file_name();
33653367 if (file_name == NULL)
33663368 file_name = "";