[PATCH] D83070: Improve documentation

David Siegel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 11:53:03 PDT 2020


agnat2 created this revision.
Herald added subscribers: llvm-commits, Jim, hiraditya, dylanmckay.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83070

Files:
  llvm/lib/Target/AVR/HarvardCheck/HarvardCheck.cpp


Index: llvm/lib/Target/AVR/HarvardCheck/HarvardCheck.cpp
===================================================================
--- llvm/lib/Target/AVR/HarvardCheck/HarvardCheck.cpp
+++ llvm/lib/Target/AVR/HarvardCheck/HarvardCheck.cpp
@@ -6,10 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 ///
-/// \file Function pass to verify all functions are in program memory
+/// \file
+/// Function pass to verify all functions are in program memory
 ///
 /// Visits all functions in a module and reports those that are not in the
-/// program memory address space.
+/// program memory address space as defined by the targets DataLayout. This
+/// helps to find transformations that accidentially place functions in data
+/// space because they assume a von Neumann architecture.
 ///
 /// Usage:
 /// \code
@@ -17,7 +20,7 @@
 /// \endcode
 ///
 /// \param --harvard-abort-on-error
-/// \param --harvard-program-address-space N
+/// \param --harvard-program-address-space NUMBER
 ///
 //===----------------------------------------------------------------------===//
 
@@ -41,7 +44,8 @@
 
 namespace {
 
-struct HarvardCheck : FunctionPass {
+class HarvardCheck : public FunctionPass {
+public:
   static char ID;
   HarvardCheck() : FunctionPass(ID), ProgramAddressSpace(), ErrorCount() {}
 
@@ -69,7 +73,7 @@
 
   bool doFinalization(Module &) override {
     if (ErrorCount != 0 && AbortOnErrorOption) {
-      errs() << "not all functions are in program memory. Aborting\n";
+      errs() << "error: not all functions are in program memory. Aborting\n";
       exit(1);
     }
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83070.275183.patch
Type: text/x-patch
Size: 1638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/342999c3/attachment.bin>


More information about the llvm-commits mailing list