summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-15 13:24:25 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-15 13:24:25 -0700
commit205187b561c3b31fa931e73e8f7263f0c4b1de41 (patch)
tree7bd2cd5ae3c14416b71ef8319ff02ace429d1132 /source/slang
parent517513645afb8eaf4841e7b7035f1ba3a9c7cd57 (diff)
Rename `CoreLib::*` to `Slang`
Getting rid of more namespace complexity and stripping things down to the basics. This also gets rid of some dead code in the "core" library.
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/compiler.cpp3
-rw-r--r--source/slang/compiler.h2
-rw-r--r--source/slang/diagnostics.cpp2
-rw-r--r--source/slang/diagnostics.h4
-rw-r--r--source/slang/emit.h2
-rw-r--r--source/slang/lexer.h2
-rw-r--r--source/slang/preprocessor.cpp10
-rw-r--r--source/slang/preprocessor.h14
-rw-r--r--source/slang/slang-stdlib.cpp2
-rw-r--r--source/slang/slang-stdlib.h6
-rw-r--r--source/slang/slang.cpp15
-rw-r--r--source/slang/source-loc.h2
-rw-r--r--source/slang/syntax.cpp6
-rw-r--r--source/slang/syntax.h5
-rw-r--r--source/slang/token.h2
15 files changed, 28 insertions, 49 deletions
diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp
index d8298c604..6db04b900 100644
--- a/source/slang/compiler.cpp
+++ b/source/slang/compiler.cpp
@@ -30,9 +30,6 @@
#undef CreateDirectory
#endif
-using namespace CoreLib::Basic;
-using namespace CoreLib::IO;
-
namespace Slang
{
//
diff --git a/source/slang/compiler.h b/source/slang/compiler.h
index fe69a7bf8..3b6696647 100644
--- a/source/slang/compiler.h
+++ b/source/slang/compiler.h
@@ -154,7 +154,7 @@ namespace Slang
#if 0
- class ShaderCompiler : public CoreLib::Basic::Object
+ class ShaderCompiler : public Slang::Object
{
public:
virtual void Compile(
diff --git a/source/slang/diagnostics.cpp b/source/slang/diagnostics.cpp
index 11f54e096..e9c7e965a 100644
--- a/source/slang/diagnostics.cpp
+++ b/source/slang/diagnostics.cpp
@@ -26,7 +26,7 @@ void printDiagnosticArg(StringBuilder& sb, int str)
sb << str;
}
-void printDiagnosticArg(StringBuilder& sb, CoreLib::Basic::String const& str)
+void printDiagnosticArg(StringBuilder& sb, Slang::String const& str)
{
sb << str;
}
diff --git a/source/slang/diagnostics.h b/source/slang/diagnostics.h
index c4a9532ce..4c698f95b 100644
--- a/source/slang/diagnostics.h
+++ b/source/slang/diagnostics.h
@@ -10,8 +10,6 @@
namespace Slang
{
- using namespace CoreLib::Basic;
-
enum class Severity
{
Note,
@@ -79,7 +77,7 @@ namespace Slang
void printDiagnosticArg(StringBuilder& sb, char const* str);
void printDiagnosticArg(StringBuilder& sb, int val);
- void printDiagnosticArg(StringBuilder& sb, CoreLib::Basic::String const& str);
+ void printDiagnosticArg(StringBuilder& sb, Slang::String const& str);
void printDiagnosticArg(StringBuilder& sb, Decl* decl);
void printDiagnosticArg(StringBuilder& sb, Type* type);
void printDiagnosticArg(StringBuilder& sb, ExpressionType* type);
diff --git a/source/slang/emit.h b/source/slang/emit.h
index 1cb8d2d81..4f3e98c8d 100644
--- a/source/slang/emit.h
+++ b/source/slang/emit.h
@@ -8,8 +8,6 @@
namespace Slang
{
- using namespace CoreLib::Basic;
-
class ProgramSyntaxNode;
class ProgramLayout;
diff --git a/source/slang/lexer.h b/source/slang/lexer.h
index d599b3b7f..5bcfc0f4a 100644
--- a/source/slang/lexer.h
+++ b/source/slang/lexer.h
@@ -6,8 +6,6 @@
namespace Slang
{
- using namespace CoreLib::Basic;
-
struct TokenList
{
Token* begin() const;
diff --git a/source/slang/preprocessor.cpp b/source/slang/preprocessor.cpp
index 3bba307db..b8a42d46d 100644
--- a/source/slang/preprocessor.cpp
+++ b/source/slang/preprocessor.cpp
@@ -10,8 +10,6 @@
#include <assert.h>
-using namespace CoreLib;
-
// This file provides an implementation of a simple C-style preprocessor.
// It does not aim for 100% compatibility with any particular preprocessor
// specification, but the goal is to have it accept the most common
@@ -207,7 +205,7 @@ static void DestroyInputStream(Preprocessor* /*preprocessor*/, PreprocessorInput
// Create an input stream to represent a pre-tokenized input file.
// TODO(tfoley): pre-tokenizing files isn't going to work in the long run.
-static PreprocessorInputStream* CreateInputStreamForSource(Preprocessor* preprocessor, CoreLib::String const& source, CoreLib::String const& fileName)
+static PreprocessorInputStream* CreateInputStreamForSource(Preprocessor* preprocessor, String const& source, String const& fileName)
{
SourceTextInputStream* inputStream = new SourceTextInputStream();
InitializeInputStream(preprocessor, inputStream);
@@ -2009,11 +2007,11 @@ static TokenList ReadAllTokens(
}
TokenList preprocessSource(
- CoreLib::String const& source,
- CoreLib::String const& fileName,
+ String const& source,
+ String const& fileName,
DiagnosticSink* sink,
IncludeHandler* includeHandler,
- CoreLib::Dictionary<CoreLib::String, CoreLib::String> defines,
+ Dictionary<String, String> defines,
ProgramSyntaxNode* syntax)
{
Preprocessor preprocessor;
diff --git a/source/slang/preprocessor.h b/source/slang/preprocessor.h
index cb5a8baae..a3c5336f5 100644
--- a/source/slang/preprocessor.h
+++ b/source/slang/preprocessor.h
@@ -15,19 +15,19 @@ class ProgramSyntaxNode;
struct IncludeHandler
{
virtual bool TryToFindIncludeFile(
- CoreLib::String const& pathToInclude,
- CoreLib::String const& pathIncludedFrom,
- CoreLib::String* outFoundPath,
- CoreLib::String* outFoundSource) = 0;
+ String const& pathToInclude,
+ String const& pathIncludedFrom,
+ String* outFoundPath,
+ String* outFoundSource) = 0;
};
// Take a string of source code and preprocess it into a list of tokens.
TokenList preprocessSource(
- CoreLib::String const& source,
- CoreLib::String const& fileName,
+ String const& source,
+ String const& fileName,
DiagnosticSink* sink,
IncludeHandler* includeHandler,
- CoreLib::Dictionary<CoreLib::String, CoreLib::String> defines,
+ Dictionary<String, String> defines,
ProgramSyntaxNode* syntax);
} // namespace Slang
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index 85c876105..9ff8a1078 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -947,8 +947,6 @@ typedef Texture2D texture2D;
)=" };
-using namespace CoreLib::Basic;
-
namespace Slang
{
static String stdlibPath;
diff --git a/source/slang/slang-stdlib.h b/source/slang/slang-stdlib.h
index fd41565d1..e4ee8cee3 100644
--- a/source/slang/slang-stdlib.h
+++ b/source/slang/slang-stdlib.h
@@ -8,13 +8,13 @@ namespace Slang
class SlangStdLib
{
private:
- static CoreLib::String code;
+ static String code;
public:
- static CoreLib::String GetCode();
+ static String GetCode();
static void Finalize();
};
- CoreLib::String getGLSLLibraryCode();
+ String getGLSLLibraryCode();
}
#endif \ No newline at end of file
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 9f64edc7f..ce48f9032 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -17,9 +17,6 @@
#undef NOMINMAX
#endif
-using namespace CoreLib::Basic;
-using namespace CoreLib::IO;
-
namespace Slang {
static void stdlibDiagnosticCallback(
@@ -37,7 +34,7 @@ class Session
{
public:
bool useCache = false;
- CoreLib::String cacheDir;
+ String cacheDir;
RefPtr<Scope> slangLanguageScope;
RefPtr<Scope> hlslLanguageScope;
@@ -46,7 +43,7 @@ public:
List<RefPtr<ProgramSyntaxNode>> loadedModuleCode;
- Session(bool /*pUseCache*/, CoreLib::String /*pCacheDir*/)
+ Session(bool /*pUseCache*/, String /*pCacheDir*/)
{
// Initialize global state
// TODO: move this into the session instead
@@ -136,10 +133,10 @@ struct CompileRequest
List<String> searchDirs;
virtual bool TryToFindIncludeFile(
- CoreLib::String const& pathToInclude,
- CoreLib::String const& pathIncludedFrom,
- CoreLib::String* outFoundPath,
- CoreLib::String* outFoundSource) override
+ String const& pathToInclude,
+ String const& pathIncludedFrom,
+ String* outFoundPath,
+ String* outFoundSource) override
{
String path = Path::Combine(Path::GetDirectoryName(pathIncludedFrom), pathToInclude);
if (File::Exists(path))
diff --git a/source/slang/source-loc.h b/source/slang/source-loc.h
index 123da8c16..59f2f10ea 100644
--- a/source/slang/source-loc.h
+++ b/source/slang/source-loc.h
@@ -6,8 +6,6 @@
namespace Slang {
-using namespace CoreLib::Basic;
-
class CodePosition
{
public:
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp
index 38323e2b3..19f3939ce 100644
--- a/source/slang/syntax.cpp
+++ b/source/slang/syntax.cpp
@@ -21,9 +21,9 @@ namespace Slang
return this;
}
- CoreLib::Basic::String BasicExpressionType::ToString()
+ Slang::String BasicExpressionType::ToString()
{
- CoreLib::Basic::StringBuilder res;
+ Slang::StringBuilder res;
switch (BaseType)
{
@@ -360,7 +360,7 @@ namespace Slang
else
return BaseType->GetHashCode();
}
- CoreLib::Basic::String ArrayExpressionType::ToString()
+ Slang::String ArrayExpressionType::ToString()
{
if (ArrayLength)
return BaseType->ToString() + "[" + ArrayLength->ToString() + "]";
diff --git a/source/slang/syntax.h b/source/slang/syntax.h
index 8d56cd28e..3cd46914f 100644
--- a/source/slang/syntax.h
+++ b/source/slang/syntax.h
@@ -11,7 +11,6 @@
namespace Slang
{
- using namespace CoreLib::Basic;
class SyntaxVisitor;
class FunctionSyntaxNode;
@@ -850,7 +849,7 @@ namespace Slang
{
BaseType = baseType;
}
- virtual CoreLib::Basic::String ToString() override;
+ virtual Slang::String ToString() override;
protected:
virtual BasicExpressionType* GetScalarType() override;
virtual bool EqualsImpl(ExpressionType * type) override;
@@ -1034,7 +1033,7 @@ namespace Slang
public:
RefPtr<ExpressionType> BaseType;
RefPtr<IntVal> ArrayLength;
- virtual CoreLib::Basic::String ToString() override;
+ virtual Slang::String ToString() override;
protected:
virtual bool EqualsImpl(ExpressionType * type) override;
virtual ExpressionType* CreateCanonicalType() override;
diff --git a/source/slang/token.h b/source/slang/token.h
index 08eafccae..f177eb512 100644
--- a/source/slang/token.h
+++ b/source/slang/token.h
@@ -8,8 +8,6 @@
namespace Slang {
-using namespace CoreLib::Basic;
-
enum class TokenType
{
#define TOKEN(NAME, DESC) NAME,