Skip to content
Commit 1b8cde9b authored by Kito Cheng's avatar Kito Cheng
Browse files

[RISCV][NFC] Move static global variables into static variable in function.

It's violate coding guideline in LLVM coding standard[1], because the  the initialization order is nondeterministic and that might increase the launch time of programs.

However these variables are only used to cache query result, so we can move these variables into the function,, that which resolve both issue: 1. initialized in deterministic order, 2. Initialized that when the first time used.

[1] https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D128726
parent 9a572164
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment