Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>,
Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>,
Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/151...@github.com>


================
@@ -0,0 +1,86 @@
+//===- tools/plugins-shlib/ReferencePlugin.cpp 
----------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Instrumentor.h"
+
+#include "llvm/Passes/PassBuilder.h"
+#include "llvm/Passes/PassPlugin.h"
+
+#include <algorithm>
+#include <cstdlib>
+#include <optional>
+#include <string>
+
+using namespace llvm;
+
+static std::optional<std::string> getEnv(const std::string &Var) {
+  const char *Val = std::getenv(Var.c_str());
+  if (!Val)
+    return std::nullopt;
+  return std::string(Val);
+}
----------------
ashermancinelli wrote:

If we are already using command-line options elsewhere in the instrumentation 
pass, why not use them here instead of environment variables?

https://github.com/llvm/llvm-project/pull/151551
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to