[llvm] r278560 - [AArch64] Registering default MCInstrAnalysis
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 13:28:05 PDT 2016
Author: aizatsky
Date: Fri Aug 12 15:28:05 2016
New Revision: 278560
URL: http://llvm.org/viewvc/llvm-project?rev=278560&view=rev
Log:
[AArch64] Registering default MCInstrAnalysis
Even in this form it is useful: it can detect branch instructions.
https://github.com/google/sanitizers/issues/706
Subscribers: aemerson, rengolin
Differential Revision: https://reviews.llvm.org/D23426
Added:
llvm/trunk/test/tools/sancov/Inputs/test-linux_android_aarch64
Modified:
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
llvm/trunk/test/tools/sancov/print_coverage_pcs.test
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp?rev=278560&r1=278559&r2=278560&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp Fri Aug 12 15:28:05 2016
@@ -15,6 +15,7 @@
#include "AArch64ELFStreamer.h"
#include "AArch64MCAsmInfo.h"
#include "InstPrinter/AArch64InstPrinter.h"
+#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
@@ -116,6 +117,10 @@ static MCStreamer *createMachOStreamer(M
/*LabelSections*/ true);
}
+static MCInstrAnalysis *createAArch64InstrAnalysis(const MCInstrInfo *Info) {
+ return new MCInstrAnalysis(Info);
+}
+
// Force static initialization.
extern "C" void LLVMInitializeAArch64TargetMC() {
for (Target *T :
@@ -135,6 +140,9 @@ extern "C" void LLVMInitializeAArch64Tar
// Register the MC subtarget info.
TargetRegistry::RegisterMCSubtargetInfo(*T, createAArch64MCSubtargetInfo);
+ // Register the MC instruction analyzer.
+ TargetRegistry::RegisterMCInstrAnalysis(*T, createAArch64InstrAnalysis);
+
// Register the MC Code Emitter
TargetRegistry::RegisterMCCodeEmitter(*T, createAArch64MCCodeEmitter);
Added: llvm/trunk/test/tools/sancov/Inputs/test-linux_android_aarch64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/sancov/Inputs/test-linux_android_aarch64?rev=278560&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/sancov/Inputs/test-linux_android_aarch64 (added) and llvm/trunk/test/tools/sancov/Inputs/test-linux_android_aarch64 Fri Aug 12 15:28:05 2016 differ
Modified: llvm/trunk/test/tools/sancov/print_coverage_pcs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/sancov/print_coverage_pcs.test?rev=278560&r1=278559&r2=278560&view=diff
==============================================================================
--- llvm/trunk/test/tools/sancov/print_coverage_pcs.test (original)
+++ llvm/trunk/test/tools/sancov/print_coverage_pcs.test Fri Aug 12 15:28:05 2016
@@ -3,6 +3,7 @@ RUN: sancov -print-coverage-pcs %p/Input
RUN: llvm-objdump -d %p/Inputs/test-windows_x86_64 | FileCheck %s --check-prefix=DISAS_WIN
RUN: sancov -print-coverage-pcs %p/Inputs/test-windows_x86_64 | FileCheck %s --check-prefix=WINDOWS
RUN: sancov -print-coverage-pcs %p/Inputs/test-darwin_x86_64 | FileCheck %s --check-prefix=DARWIN
+RUN: not sancov -print-coverage-pcs %p/Inputs/test-linux_android_aarch64 2>&1 | FileCheck %s --check-prefix=AARCH64
LINUX: 0x4e132b
LINUX: 0x4e1472
@@ -57,3 +58,6 @@ DARWIN: 0x1000018e0
DARWIN: 0x100001906
DARWIN: 0x1000019dc
DARWIN: 0x100001a28
+
+AARCH64: Error: __sanitizer_cov* functions not found
+
More information about the llvm-commits
mailing list