Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: src/IceASanInstrumentation.h

Issue 2054943002: Implemented global redzones. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Finished reformatting Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Makefile.standalone ('k') | src/IceASanInstrumentation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceASanInstrumentation.h
diff --git a/src/IceASanInstrumentation.h b/src/IceASanInstrumentation.h
new file mode 100644
index 0000000000000000000000000000000000000000..ee20e7d027c04cda6dfadd64bf51eb491073cf73
--- /dev/null
+++ b/src/IceASanInstrumentation.h
@@ -0,0 +1,48 @@
+//===- subzero/src/IceASanInstrumentation.h - AddressSanitizer --*- C++ -*-===//
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Declares the AddressSanitizer instrumentation class.
+///
+/// This class is responsible for inserting redzones around global and stack
+/// variables, inserting code responsible for poisoning those redzones, and
+/// performing any other instrumentation necessary to implement
+/// AddressSanitizer.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef SUBZERO_SRC_ICEASANINSTRUMENTATION_H
+#define SUBZERO_SRC_ICEASANINSTRUMENTATION_H
+
+#include "IceGlobalInits.h"
+#include "IceInstrumentation.h"
+
+namespace Ice {
+
+class ASanInstrumentation : public Instrumentation {
+ ASanInstrumentation() = delete;
+ ASanInstrumentation(const ASanInstrumentation &) = delete;
+ ASanInstrumentation &operator=(const ASanInstrumentation &) = delete;
+
+public:
+ ASanInstrumentation(GlobalContext *Ctx) : Instrumentation(Ctx) {}
+ void instrumentGlobals(VariableDeclarationList &Globals) override;
+
+private:
+ std::string nextRzName();
+ VariableDeclaration *createRz(VariableDeclarationList *List,
+ VariableDeclaration *RzArray,
+ SizeT &RzArraySize,
+ VariableDeclaration *Global);
+ bool DidInsertRedZones = false;
+ uint32_t RzNum = 0;
+};
+} // end of namespace Ice
+
+#endif // SUBZERO_SRC_ICEASANINSTRUMENTATION_H
« no previous file with comments | « Makefile.standalone ('k') | src/IceASanInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698