@@ -2953,14 +2953,14 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
2953
2953
case OptionKind::DumpModule:
2954
2954
{
2955
2955
CommandLineArg fileName;
2956
- SLANG_RETURN_ON_FAIL (m_reader.expectArg (fileName));
2956
+ SLANG_RETURN_ON_FAIL (m_reader.expectArg (fileName));
2957
2957
auto desc = slang::SessionDesc ();
2958
2958
ComPtr<slang::ISession> session;
2959
2959
m_session->createSession (desc, session.writeRef ());
2960
2960
ComPtr<slang::IBlob> diagnostics;
2961
2961
2962
2962
// Coerce Slang to load from the given file, without letting it automatically
2963
- // choose .slang-module files over .slang files.
2963
+ // choose .slang-module files over .slang files.
2964
2964
// First try to load as source string, and fall back to loading as an IR Blob.
2965
2965
// Avoid guessing based on filename or inspect the file contents.
2966
2966
FILE* file;
@@ -2973,7 +2973,7 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
2973
2973
fseek (file, 0 , SEEK_END);
2974
2974
size_t size = ftell (file);
2975
2975
fseek (file, 0 , SEEK_SET);
2976
- std::vector<char > buffer (size+ 1 );
2976
+ std::vector<char > buffer (size + 1 );
2977
2977
int result = fread (buffer.data (), 1 , size, file);
2978
2978
if (result != size)
2979
2979
{
@@ -2982,22 +2982,26 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
2982
2982
}
2983
2983
buffer[size] = 0 ;
2984
2984
fclose (file);
2985
-
2985
+
2986
2986
ComPtr<slang::IModule> module;
2987
- module = session->loadModuleFromSourceString (" module" , " path" , buffer.data (), diagnostics.writeRef ());
2987
+ module = session->loadModuleFromSourceString (
2988
+ " module" ,
2989
+ " path" ,
2990
+ buffer.data (),
2991
+ diagnostics.writeRef ());
2988
2992
if (!module)
2989
2993
{
2990
2994
// Load buffer as an IR blob
2991
2995
ComPtr<slang::IBlob> blob;
2992
2996
blob = RawBlob::create (buffer.data (), size);
2993
-
2997
+
2994
2998
module = session->loadModuleFromIRBlob (
2995
2999
" module" ,
2996
3000
" path" ,
2997
3001
blob,
2998
3002
diagnostics.writeRef ());
2999
3003
}
3000
-
3004
+
3001
3005
if (module)
3002
3006
{
3003
3007
ComPtr<slang::IBlob> disassemblyBlob;
@@ -3008,7 +3012,9 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
3008
3012
}
3009
3013
else
3010
3014
{
3011
- m_sink->diagnoseRaw (Severity::Note, (const char *)disassemblyBlob->getBufferPointer ());
3015
+ m_sink->diagnoseRaw (
3016
+ Severity::Note,
3017
+ (const char *)disassemblyBlob->getBufferPointer ());
3012
3018
}
3013
3019
}
3014
3020
else
@@ -3018,11 +3024,11 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
3018
3024
m_sink->diagnoseRaw (
3019
3025
Severity::Error,
3020
3026
(const char *)diagnostics->getBufferPointer ());
3021
- }
3027
+ }
3022
3028
return SLANG_FAIL;
3023
3029
}
3024
-
3025
-
3030
+
3031
+
3026
3032
break ;
3027
3033
}
3028
3034
default :
0 commit comments