diff options
author | Stephen Hines <srhines@google.com> | 2012-02-24 15:08:36 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2012-02-24 15:08:36 -0800 |
commit | e67239de8d94975e7e2216ee6860ae2e6cb8b15a (patch) | |
tree | 4f69b46e8271cd1410922d4e10d39b172338311d | |
parent | c17e198ffcd37bfc57e3add1f6eee952ae2a2eab (diff) | |
download | android_frameworks_compile_slang-e67239de8d94975e7e2216ee6860ae2e6cb8b15a.tar.gz android_frameworks_compile_slang-e67239de8d94975e7e2216ee6860ae2e6cb8b15a.tar.bz2 android_frameworks_compile_slang-e67239de8d94975e7e2216ee6860ae2e6cb8b15a.zip |
Style violation cleanup.
Change-Id: Idb127f2fd6e637039454f47299360aec5a4edfe8
-rw-r--r-- | slang.cpp | 4 | ||||
-rw-r--r-- | slang.h | 2 | ||||
-rw-r--r-- | slang_diagnostic_buffer.cpp | 5 | ||||
-rw-r--r-- | slang_diagnostic_buffer.h | 4 | ||||
-rw-r--r-- | slang_pragma_recorder.h | 2 | ||||
-rw-r--r-- | slang_rs.h | 2 | ||||
-rw-r--r-- | slang_rs_backend.h | 2 | ||||
-rw-r--r-- | slang_rs_export_type.cpp | 11 | ||||
-rw-r--r-- | slang_rs_export_var.cpp | 2 | ||||
-rw-r--r-- | slang_rs_exportable.h | 2 | ||||
-rw-r--r-- | slang_rs_metadata_spec_encoder.cpp | 3 | ||||
-rw-r--r-- | slang_rs_pragma_handler.cpp | 3 | ||||
-rw-r--r-- | slang_rs_reflect_utils.cpp | 2 | ||||
-rw-r--r-- | slang_rs_reflect_utils.h | 2 | ||||
-rw-r--r-- | slang_rs_reflection.cpp | 49 | ||||
-rw-r--r-- | slang_utils.h | 2 |
16 files changed, 51 insertions, 46 deletions
@@ -117,8 +117,7 @@ static inline llvm::tool_output_file * OpenOutputFile(const char *OutputFile, unsigned Flags, std::string* Error, - clang::DiagnosticsEngine *DiagEngine) -{ + clang::DiagnosticsEngine *DiagEngine) { slangAssert((OutputFile != NULL) && (Error != NULL) && (DiagEngine != NULL) && "Invalid parameter!"); @@ -279,7 +278,6 @@ clang::Module *Slang::loadModule(clang::SourceLocation ImportLoc, clang::ModuleIdPath Path, clang::Module::NameVisibilityKind Visibility, bool IsInclusionDirective) { - //FIXME: Don't we have to implement this? slangAssert(0 && "Not implemented"); return NULL; } @@ -49,7 +49,7 @@ namespace clang { class SourceManager; class TargetInfo; class TargetOptions; -} +} // namespace clang namespace slang { diff --git a/slang_diagnostic_buffer.cpp b/slang_diagnostic_buffer.cpp index f9849bf..5b7adaf 100644 --- a/slang_diagnostic_buffer.cpp +++ b/slang_diagnostic_buffer.cpp @@ -39,9 +39,8 @@ DiagnosticBuffer::~DiagnosticBuffer() { } void DiagnosticBuffer::HandleDiagnostic( - clang::DiagnosticsEngine::Level DiagLevel, - clang::Diagnostic const &Info) { - + clang::DiagnosticsEngine::Level DiagLevel, + clang::Diagnostic const &Info) { clang::SourceLocation const &SrcLoc = Info.getLocation(); // 100 is enough for storing general diagnosis message diff --git a/slang_diagnostic_buffer.h b/slang_diagnostic_buffer.h index e4eeaab..e065927 100644 --- a/slang_diagnostic_buffer.h +++ b/slang_diagnostic_buffer.h @@ -38,7 +38,7 @@ class DiagnosticBuffer : public clang::DiagnosticConsumer { public: DiagnosticBuffer(); - DiagnosticBuffer(DiagnosticBuffer const &src); + explicit DiagnosticBuffer(DiagnosticBuffer const &src); virtual ~DiagnosticBuffer(); @@ -58,6 +58,6 @@ class DiagnosticBuffer : public clang::DiagnosticConsumer { } }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_DIAGNOSTIC_BUFFER_H_ NOLINT diff --git a/slang_pragma_recorder.h b/slang_pragma_recorder.h index 5b9cdda..3b3f447 100644 --- a/slang_pragma_recorder.h +++ b/slang_pragma_recorder.h @@ -49,6 +49,6 @@ class PragmaRecorder : public clang::PragmaHandler { clang::PragmaIntroducerKind Introducer, clang::Token &FirstToken); }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_PRAGMA_RECORDER_H_ NOLINT @@ -138,6 +138,6 @@ class SlangRS : public Slang { virtual ~SlangRS(); }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_RS_H_ NOLINT diff --git a/slang_rs_backend.h b/slang_rs_backend.h index 95d493b..0dc70e6 100644 --- a/slang_rs_backend.h +++ b/slang_rs_backend.h @@ -83,6 +83,6 @@ class RSBackend : public Backend { virtual ~RSBackend(); }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_RS_BACKEND_H_ NOLINT diff --git a/slang_rs_export_type.cpp b/slang_rs_export_type.cpp index 0c28e30..753e6de 100644 --- a/slang_rs_export_type.cpp +++ b/slang_rs_export_type.cpp @@ -116,12 +116,11 @@ static const clang::Type *ConstantArrayTypeExportableHelper( } static const clang::Type *TypeExportableHelper( - clang::Type const *T, - llvm::SmallPtrSet<clang::Type const *, 8> &SPS, - clang::DiagnosticsEngine *DiagEngine, - clang::VarDecl const *VD, - clang::RecordDecl const *TopLevelRecord) -{ + clang::Type const *T, + llvm::SmallPtrSet<clang::Type const *, 8> &SPS, + clang::DiagnosticsEngine *DiagEngine, + clang::VarDecl const *VD, + clang::RecordDecl const *TopLevelRecord) { // Normalize first if ((T = GET_CANONICAL_TYPE(T)) == NULL) return NULL; diff --git a/slang_rs_export_var.cpp b/slang_rs_export_var.cpp index 56e256f..5fbf107 100644 --- a/slang_rs_export_var.cpp +++ b/slang_rs_export_var.cpp @@ -69,7 +69,7 @@ RSExportVar::RSExportVar(RSContext *Context, break; } case RSExportType::ExportClassConstantArray: { - const clang::InitListExpr *IList = + const clang::InitListExpr *IList = static_cast<const clang::InitListExpr*>(Initializer); if (!IList) { ReportVarError(Context, VD->getLocation(), diff --git a/slang_rs_exportable.h b/slang_rs_exportable.h index 0a2c066..04b5f88 100644 --- a/slang_rs_exportable.h +++ b/slang_rs_exportable.h @@ -59,6 +59,6 @@ class RSExportable { virtual ~RSExportable() { } }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_RS_EXPORTABLE_H_ NOLINT diff --git a/slang_rs_metadata_spec_encoder.cpp b/slang_rs_metadata_spec_encoder.cpp index 45c54e5..2e51325 100644 --- a/slang_rs_metadata_spec_encoder.cpp +++ b/slang_rs_metadata_spec_encoder.cpp @@ -110,7 +110,8 @@ RS_DATA_TYPE_CLASS_ENUMS int finalize(); }; -} + +} // namespace RSMetadataEncoderInternal::RSMetadataEncoderInternal(llvm::Module *M) : mModule(M), diff --git a/slang_rs_pragma_handler.cpp b/slang_rs_pragma_handler.cpp index 06e2ae7..597136d 100644 --- a/slang_rs_pragma_handler.cpp +++ b/slang_rs_pragma_handler.cpp @@ -257,8 +257,7 @@ void RSPragmaHandler::handleOptionalStringLiteralParamPragma( if (StringLiteral.hadError) { // Diagnostics will be generated automatically return; - } - else { + } else { this->handleItem(std::string(StringLiteral.GetString())); } diff --git a/slang_rs_reflect_utils.cpp b/slang_rs_reflect_utils.cpp index 29c3998..f36b6ad 100644 --- a/slang_rs_reflect_utils.cpp +++ b/slang_rs_reflect_utils.cpp @@ -267,4 +267,4 @@ bool RSSlangReflectUtils::GenerateBitCodeAccessor( fclose(pfout); return ret; } -} +} // namespace slang diff --git a/slang_rs_reflect_utils.h b/slang_rs_reflect_utils.h index d2a831e..f6cfd57 100644 --- a/slang_rs_reflect_utils.h +++ b/slang_rs_reflect_utils.h @@ -77,6 +77,6 @@ class RSSlangReflectUtils { // Generate the bit code accessor Java source file. static bool GenerateBitCodeAccessor(const BitCodeAccessorContext &context); }; -} +} // namespace slang #endif // _FRAMEWORKS_COMPILE_SLANG_SLANG_REFLECT_UTILS_H_ NOLINT diff --git a/slang_rs_reflection.cpp b/slang_rs_reflection.cpp index 259931b..7d4c6b1 100644 --- a/slang_rs_reflection.cpp +++ b/slang_rs_reflection.cpp @@ -1671,7 +1671,8 @@ bool RSReflection::genTypeClass(Context &C, ";" << std::endl; C.indent() << "private FieldPacker "RS_TYPE_ITEM_BUFFER_PACKER_NAME";" << std::endl; - C.indent() << "private static java.lang.ref.WeakReference<Element> "RS_TYPE_ELEMENT_REF_NAME + C.indent() << "private static java.lang.ref.WeakReference<Element> " + RS_TYPE_ELEMENT_REF_NAME " = new java.lang.ref.WeakReference<Element>(null);" << std::endl; genTypeClassConstructor(C, ERT); @@ -1743,15 +1744,17 @@ void RSReflection::genTypeClassConstructor(Context &C, 1, "RenderScript", RenderScriptVar); - // TODO: Fix weak-refs + multi-context issue. - //C.indent() << "Element e = " << RS_TYPE_ELEMENT_REF_NAME << ".get();" << std::endl; - //C.indent() << "if (e != null) return e;" << std::endl; + // TODO(all): Fix weak-refs + multi-context issue. + // C.indent() << "Element e = " << RS_TYPE_ELEMENT_REF_NAME + // << ".get();" << std::endl; + // C.indent() << "if (e != null) return e;" << std::endl; genBuildElement(C, "eb", ERT, RenderScriptVar, /* IsInline = */true); C.indent() << "return eb.create();" << std::endl; - //C.indent() << "e = eb.create();" << std::endl; - //C.indent() << RS_TYPE_ELEMENT_REF_NAME << - // " = new java.lang.ref.WeakReference<Element>(e);" << std::endl; - //C.indent() << "return e;" << std::endl; + // C.indent() << "e = eb.create();" << std::endl; + // C.indent() << RS_TYPE_ELEMENT_REF_NAME + // << " = new java.lang.ref.WeakReference<Element>(e);" + // << std::endl; + // C.indent() << "return e;" << std::endl; C.endFunction(); @@ -1764,7 +1767,8 @@ void RSReflection::genTypeClassConstructor(Context &C, "RenderScript", RenderScriptVar); C.indent() << RS_TYPE_ITEM_BUFFER_NAME" = null;" << std::endl; C.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME" = null;" << std::endl; - C.indent() << "mElement = createElement(" << RenderScriptVar << ");" << std::endl; + C.indent() << "mElement = createElement(" << RenderScriptVar << ");" + << std::endl; C.endFunction(); // 1D without usage @@ -1814,8 +1818,8 @@ void RSReflection::genTypeClassConstructor(Context &C, "int", "usages"); C.indent() << C.getClassName() << " obj = new " << C.getClassName() << "(" << RenderScriptVar << ");" << std::endl; - C.indent() << "obj.mAllocation = Allocation.createSized(rs, obj.mElement, dimX, usages);" - << std::endl; + C.indent() << "obj.mAllocation = Allocation.createSized(" + "rs, obj.mElement, dimX, usages);" << std::endl; C.indent() << "return obj;" << std::endl; C.endFunction(); @@ -1827,8 +1831,8 @@ void RSReflection::genTypeClassConstructor(Context &C, 2, "RenderScript", RenderScriptVar, "int", "dimX"); - C.indent() << "return create1D(" << RenderScriptVar << ", dimX, Allocation.USAGE_SCRIPT);" - << std::endl; + C.indent() << "return create1D(" << RenderScriptVar + << ", dimX, Allocation.USAGE_SCRIPT);" << std::endl; C.endFunction(); @@ -1841,8 +1845,8 @@ void RSReflection::genTypeClassConstructor(Context &C, "RenderScript", RenderScriptVar, "int", "dimX", "int", "dimY"); - C.indent() << "return create2D(" << RenderScriptVar << ", dimX, dimY, Allocation.USAGE_SCRIPT);" - << std::endl; + C.indent() << "return create2D(" << RenderScriptVar + << ", dimX, dimY, Allocation.USAGE_SCRIPT);" << std::endl; C.endFunction(); // create2D with usage @@ -1858,11 +1862,13 @@ void RSReflection::genTypeClassConstructor(Context &C, C.indent() << C.getClassName() << " obj = new " << C.getClassName() << "(" << RenderScriptVar << ");" << std::endl; - C.indent() << "Type.Builder b = new Type.Builder(rs, obj.mElement);" << std::endl; + C.indent() << "Type.Builder b = new Type.Builder(rs, obj.mElement);" + << std::endl; C.indent() << "b.setX(dimX);" << std::endl; C.indent() << "b.setY(dimY);" << std::endl; C.indent() << "Type t = b.create();" << std::endl; - C.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);" << std::endl; + C.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);" + << std::endl; C.indent() << "return obj;" << std::endl; C.endFunction(); @@ -1874,7 +1880,8 @@ void RSReflection::genTypeClassConstructor(Context &C, "createTypeBuilder", 1, "RenderScript", RenderScriptVar); - C.indent() << "Element e = createElement(" << RenderScriptVar << ");" << std::endl; + C.indent() << "Element e = createElement(" << RenderScriptVar << ");" + << std::endl; C.indent() << "return new Type.Builder(rs, e);" << std::endl; C.endFunction(); @@ -1891,10 +1898,12 @@ void RSReflection::genTypeClassConstructor(Context &C, << RenderScriptVar << ");" << std::endl; C.indent() << "Type t = tb.create();" << std::endl; C.indent() << "if (t.getElement() != obj.mElement) {" << std::endl; - C.indent() << " throw new RSIllegalArgumentException(\"Type.Builder did not match expected element type.\");" + C.indent() << " throw new RSIllegalArgumentException(" + "\"Type.Builder did not match expected element type.\");" << std::endl; C.indent() << "}" << std::endl; - C.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);" << std::endl; + C.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);" + << std::endl; C.indent() << "return obj;" << std::endl; C.endFunction(); } diff --git a/slang_utils.h b/slang_utils.h index 4d8e862..9a123e3 100644 --- a/slang_utils.h +++ b/slang_utils.h @@ -33,6 +33,6 @@ class SlangUtils { static bool CreateDirectoryWithParents(llvm::StringRef Dir, std::string* Error); }; -} +} // namespace slang #endif // _COMPILE_SLANG_SLANG_UTILS_H_ NOLINT |