This is an archive of the discontinued LLVM Phabricator instance.

AVR Backend: Add harvard program address space checker pass
Needs RevisionPublic

Authored by agnat2 on Jun 26 2020, 1:21 PM.

Details

Reviewers
dylanmckay
Summary

Add a pass to verify that all functions ended up in the
program address space.

Diff Detail

Event Timeline

agnat2 created this revision.Jun 26 2020, 1:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2020, 1:21 PM
agnat2 updated this revision to Diff 275062.Jul 2 2020, 4:36 AM

Fix format.

Patch is looking really good, only suggestions are the adding a test and a couple formatting nitpicks.

llvm/lib/Target/AVR/HarvardCheck/CMakeLists.txt
1

Add the prefix AVR to the library name, i.e. libAVRHarvardCheck to make it clear this dylib is a part of the AVR backend.

llvm/lib/Target/AVR/HarvardCheck/HarvardCheck.cpp
73

Remove the m_ prefix from the member field names, as LLVM doesn't use this naming convention.

82

Add a test for the new pass, inside test/CodeGen/AVR for the new pass. The RUN: line can be ; RUN: opt -load libHarvardCheck.dylib --harvard-check -march=avr 2>&1 < %s | FileCheck %s, the test can contain functions in the wrong address space, and the CHECK lines can verify that the correct error messages are generated.

dylanmckay requested changes to this revision.Aug 11 2020, 5:10 AM
This revision now requires changes to proceed.Aug 11 2020, 5:10 AM