[clangd] Disable msan instrumentation for generated Evaluate().
authorUtkarsh Saxena <usx@google.com>
Tue, 29 Sep 2020 15:06:13 +0000 (17:06 +0200)
committerUtkarsh Saxena <usx@google.com>
Tue, 29 Sep 2020 15:44:10 +0000 (17:44 +0200)
MSAN build times out for generated DecisionForest inference runtime.

A solution worth trying is splitting the function into 300 smaller
functions and then re-enable msan.

For now we are disabling instrumentation for the generated function.

Differential Revision: https://reviews.llvm.org/D88495

clang-tools-extra/clangd/quality/CompletionModelCodegen.py

index 20bfccd..423e5d1 100644 (file)
@@ -145,6 +145,7 @@ def gen_header_code(features_json, cpp_class, filename):
     return """#ifndef %s
 #define %s
 #include <cstdint>
+#include "llvm/Support/Compiler.h"
 
 %s
 class %s {
@@ -160,6 +161,9 @@ private:
   friend float Evaluate(const %s&);
 };
 
+// The function may have large number of lines of code. MSAN
+// build times out in such case.
+LLVM_NO_SANITIZE("memory")
 float Evaluate(const %s&);
 %s
 #endif // %s