1 //
2 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 #ifndef COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REWRITEOUTARGS_H_
8 #define COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REWRITEOUTARGS_H_
9 
10 #include "compiler/translator/Compiler.h"
11 #include "compiler/translator/TranslatorMetalDirect/ProgramPrelude.h"
12 #include "compiler/translator/TranslatorMetalDirect/SymbolEnv.h"
13 
14 namespace sh
15 {
16 
17 // e.g.:
18 //    /*void foo(out int x, inout int y)*/
19 //    foo(z, w);
20 // becomes
21 //    foo(Out(z), InOut(w));
22 // unless `z` and `w` are detected to never alias.
23 // The translated example effectively behaves the same as:
24 //    int _1;
25 //    int _2 = w;
26 //    foo(_1, _2);
27 //    z = _1;
28 //    w = _2;
29 ANGLE_NO_DISCARD bool RewriteOutArgs(TCompiler &compiler, TIntermBlock &root, SymbolEnv &symbolEnv);
30 
31 }  // namespace sh
32 
33 #endif  // COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REWRITEOUTARGS_H_
34