瀏覽代碼

Add a RenderScript language type

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
Pirama Arumuga Nainar 9 年之前
父節點
當前提交
eb6a2acb17
共有 5 個文件被更改,包括 7 次插入2 次删除
  1. 1 0
      include/clang/Driver/Types.def
  2. 1 0
      lib/Driver/Types.cpp
  3. 1 1
      test/Driver/lit.local.cfg
  4. 3 0
      test/Driver/renderscript.rs
  5. 1 1
      test/lit.cfg

+ 1 - 0
include/clang/Driver/Types.def

@@ -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")

+ 1 - 0
lib/Driver/Types.cpp

@@ -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);
 }
 

+ 1 - 1
test/Driver/lit.local.cfg

@@ -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',

+ 3 - 0
test/Driver/renderscript.rs

@@ -0,0 +1,3 @@
+// RUN: %clang -### 2>&1 %s | FileCheck %s
+
+// CHECK: "-x" "renderscript"

+ 1 - 1
test/lit.cfg

@@ -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