1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/tools/llvm-exegesis/lib
Ella Ma 59b89a3124 [llvm][clang][mlir] Add checks for the return values from Target::createXXX to prevent protential null deref
All these potential null pointer dereferences are reported by my static analyzer for null smart pointer dereferences, which has a different implementation from `alpha.cplusplus.SmartPtr`.

The checked pointers in this patch are initialized by Target::createXXX functions. When the creator function pointer is not correctly set, a null pointer will be returned, or the creator function may originally return a null pointer.

Some of them may not make sense as they may be checked before entering the function, but I fixed them all in this patch. I submit this fix because 1) similar checks are found in some other places in the LLVM codebase for the same return value of the function; and, 2) some of the pointers are dereferenced before they are checked, which may definitely trigger a null pointer dereference if the return value is nullptr.

Reviewed By: tejohnson, MaskRay, jpienaar

Differential Revision: https://reviews.llvm.org/D91410
2020-11-21 21:04:12 -08:00
..
AArch64 llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Mips llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
PowerPC llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
X86 llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Analysis.cpp Use llvm::is_contained where appropriate (NFC) 2020-07-27 10:20:44 -07:00
Analysis.h [llvm-exegesis] Show noise cluster in analysis output. 2019-10-11 11:33:18 +00:00
Assembler.cpp Recommit: "[llvm-exegesis] Improve error reporting in Assembler.cpp" 2020-02-19 14:40:28 +01:00
Assembler.h Recommit: "[llvm-exegesis] Improve error reporting in Assembler.cpp" 2020-02-19 14:40:28 +01:00
BenchmarkCode.h [llvm-exegesis] Finish plumbing the Config field. 2019-10-08 09:06:48 +00:00
BenchmarkResult.cpp [llvm-exegesis][NFC] Remove extra llvm:: qualifications. 2019-10-09 11:58:42 +00:00
BenchmarkResult.h [llvm-exegesis] Let Counter returns up to 16 entries 2020-06-26 10:57:20 -04:00
BenchmarkRunner.cpp Re-land "[llvm-exegesis] Save target state before running the benchmark." 2020-11-04 09:46:55 +01:00
BenchmarkRunner.h [llvm-exegesis] Let Counter returns up to 16 entries 2020-06-26 10:57:20 -04:00
Clustering.cpp Avoid including FileSystem.h from MemoryBuffer.h 2020-02-29 12:30:23 -08:00
Clustering.h [llvm-exegesis][NFC] Remove extra llvm:: qualifications. 2019-10-09 11:58:42 +00:00
CMakeLists.txt [build] Fix dependencies of LLVMExegesis 2020-11-17 06:15:02 -05:00
CodeTemplate.cpp [llvm-exegesis][NFC] internal changes 2019-12-18 17:24:07 +01:00
CodeTemplate.h [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
Error.cpp [llvm-exegesis] Improve error reporting in BenchmarkRunner.cpp 2020-02-07 16:29:52 +01:00
Error.h [llvm-exegesis] Improve error reporting in BenchmarkRunner.cpp 2020-02-07 16:29:52 +01:00
LatencyBenchmarkRunner.cpp [llvm-exegesis] Let Counter returns up to 16 entries 2020-06-26 10:57:20 -04:00
LatencyBenchmarkRunner.h [llvm-exegesis] Let Counter returns up to 16 entries 2020-06-26 10:57:20 -04:00
LlvmState.cpp [llvm][clang][mlir] Add checks for the return values from Target::createXXX to prevent protential null deref 2020-11-21 21:04:12 -08:00
LlvmState.h [llvm-exegesis] Fix r374158 2019-10-09 12:37:56 +00:00
MCInstrDescView.cpp Fix "expression is redundant [misc-redundant-expression]" warning (PR44768) 2020-02-04 21:24:21 +00:00
MCInstrDescView.h [llvm-exegesis][NFC] internal changes 2019-12-18 17:24:07 +01:00
ParallelSnippetGenerator.cpp [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
ParallelSnippetGenerator.h [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
PerfHelper.cpp Reland [llvm-exegesis] Add benchmark latency option on X86 that uses LBR for more precise measurements. 2020-07-27 12:38:05 -04:00
PerfHelper.h Reland [llvm-exegesis] Add benchmark latency option on X86 that uses LBR for more precise measurements. 2020-07-27 12:38:05 -04:00
RegisterAliasing.cpp [llvm-exegesis] Allow the randomizer to fail nicely... 2020-01-23 11:08:44 +01:00
RegisterAliasing.h [llvm-exegesis] Allow the randomizer to fail nicely... 2020-01-23 11:08:44 +01:00
RegisterValue.cpp Move endian constant from Host.h to SwapByteOrder.h, prune include 2019-10-19 00:48:11 +00:00
RegisterValue.h [llvm-exegesis][NFC] Remove extra llvm:: qualifications. 2019-10-09 11:58:42 +00:00
SchedClassResolution.cpp [ARM][SchedModels] Convert IsPredicatedPred to MCSchedPredicate 2020-10-19 11:37:54 +03:00
SchedClassResolution.h [llvm-exegesis][NFC] Remove extra llvm:: qualifications. 2019-10-09 11:58:42 +00:00
SerialSnippetGenerator.cpp [llvm-exegesis] Do not try to assign random registers twice. 2020-10-29 13:27:35 +01:00
SerialSnippetGenerator.h [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
SnippetFile.cpp [MC] Make MCStreamer aware of AsmParser's StartTokLoc 2020-11-02 12:32:07 -08:00
SnippetFile.h [llvm-exegesis][NFC] Refactor snippet file reading out of tool main. 2019-09-30 12:50:25 +00:00
SnippetGenerator.cpp [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
SnippetGenerator.h Don't stash types that aren't copyable or moveable into a SmallVector 2020-05-02 19:13:06 +02:00
SnippetRepetitor.cpp [llvm-exegesis] 'Min' repetition mode 2020-04-02 09:28:35 +03:00
SnippetRepetitor.h [llvm-exegesis] Add loop mode for repeating the snippet. 2019-09-27 12:56:24 +00:00
Target.cpp Re-land "[llvm-exegesis] Save target state before running the benchmark." 2020-11-04 09:46:55 +01:00
Target.h Re-land "[llvm-exegesis] Save target state before running the benchmark." 2020-11-04 09:46:55 +01:00
TargetSelect.h [llvm-exegesis] Move native target initialization code to a separate file. 2019-05-22 13:50:16 +00:00
UopsBenchmarkRunner.cpp Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
UopsBenchmarkRunner.h [llvm-exegesis][NFC] Disassociate snippet generators from benchmark runners 2020-01-20 16:19:13 +01:00