]> granicus.if.org Git - clang/commitdiff
Add a RenderScript language type
authorPirama Arumuga Nainar <pirama@google.com>
Thu, 9 Jun 2016 21:57:40 +0000 (21:57 +0000)
committerPirama Arumuga Nainar <pirama@google.com>
Thu, 9 Jun 2016 21:57:40 +0000 (21:57 +0000)
Summary:
Add RenderScript language type and associate it with ".rs" extensions.
Test that the driver passes "-x renderscript" to the frontend for ".rs"
files.

(Also add '.rs' to the list of suffixes tested by lit).

Reviewers: rsmith

Subscribers: cfe-commits, srhines

Differential Revision: http://reviews.llvm.org/D21199

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272317 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Types.def
lib/Driver/Types.cpp
test/Driver/lit.local.cfg
test/Driver/renderscript.rs [new file with mode: 0644]
test/lit.cfg

index baaa4116cad283711490520f5f91c3be7e882441..f2ff194ee646b831f88f5ab5625cb463bacd51bf 100644 (file)
@@ -53,6 +53,7 @@ TYPE("c++",                      CXX,          PP_CXX,          "cpp",   "u")
 TYPE("objective-c++-cpp-output", PP_ObjCXX,    INVALID,         "mii",   "u")
 TYPE("objc++-cpp-output",        PP_ObjCXX_Alias, INVALID,      "mii",   "u")
 TYPE("objective-c++",            ObjCXX,       PP_ObjCXX,       "mm",    "u")
+TYPE("renderscript",             RenderScript, PP_C,            "rs",    "u")
 
 // C family input files to precompile.
 TYPE("c-header-cpp-output",      PP_CHeader,   INVALID,         "i",     "p")
index ecad59e0ca6e70782551806013c272bd8cd72e82..f8e1e40dc6bfbbf91d8226c3c1f2cf21978b11d9 100644 (file)
@@ -204,6 +204,7 @@ types::ID types::lookupTypeForExtension(const char *Ext) {
            .Case("pcm", TY_ModuleFile)
            .Case("pch", TY_PCH)
            .Case("gch", TY_PCH)
+           .Case("rs", TY_RenderScript)
            .Default(TY_INVALID);
 }
 
index 6c2373bd21789e78a5256b77b19cd6b4fd66dda2..a5078b58da84f7a6737e51ac079c2f5379d19c26 100644 (file)
@@ -1,5 +1,5 @@
 config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95',
-                   '.cu']
+                   '.cu', '.rs']
 config.substitutions = list(config.substitutions)
 config.substitutions.insert(0,
     ('%clang_cc1',
diff --git a/test/Driver/renderscript.rs b/test/Driver/renderscript.rs
new file mode 100644 (file)
index 0000000..84f5dc4
--- /dev/null
@@ -0,0 +1,3 @@
+// RUN: %clang -### 2>&1 %s | FileCheck %s
+
+// CHECK: "-x" "renderscript"
index 064271d153101870db90e8ab314ecf0f13899d4e..6f06757c2d615103a33bb4ac7996be94fd06318f 100644 (file)
@@ -44,7 +44,7 @@ else:
 config.test_format = lit.formats.ShTest(execute_external)
 
 # suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test']
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test', '.rs']
 
 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
 # subdirectories contain auxiliary inputs for various tests in their parent