[med-svn] [Git][med-team/castxml][upstream] New upstream version 0.4.8
Lance Lin (@linqigang)
gitlab at salsa.debian.org
Wed Nov 23 15:28:43 GMT 2022
Lance Lin pushed to branch upstream at Debian Med / castxml
Commits:
273287fe by Lance Lin at 2022-11-23T21:38:39+07:00
New upstream version 0.4.8
- - - - -
15 changed files:
- src/Detect.cxx
- src/Output.cxx
- src/RunClang.cxx
- src/Version.cmake
- test/CMakeLists.txt
- test/cc-gnu.c
- test/expect/castxml1.any.using-declaration-ns.xml.txt
- + test/expect/cmd.cc-gnu-intrinsics-arm64v8.stderr.txt
- + test/expect/cmd.cc-gnu-intrinsics-armv7.stderr.txt
- + test/expect/cmd.cc-gnu-tgt-arm.stderr.txt
- + test/expect/cmd.cc-msvc-tgt-arm.stderr.txt
- test/expect/gccxml.any.using-declaration-ns.xml.txt
- + test/input/intrinsics-arm64v8.cxx
- + test/input/intrinsics-armv7.cxx
- test/input/using-declaration-ns.cxx
Changes:
=====================================
src/Detect.cxx
=====================================
@@ -95,6 +95,9 @@ static void setTriple(Options& opts)
} else if (pd.find("#define __aarch64__ 1") != pd.npos ||
pd.find("#define _M_ARM64 ") != pd.npos) {
triple.setArchName("aarch64");
+ } else if (pd.find("#define __arm__ 1") != pd.npos ||
+ pd.find("#define _M_ARM ") != pd.npos) {
+ triple.setArchName("arm");
}
if (pd.find("#define _WIN32 1") != pd.npos) {
triple.setVendorName("pc");
=====================================
src/Output.cxx
=====================================
@@ -833,6 +833,12 @@ ASTVisitor::DumpId ASTVisitor::AddTypeDumpNode(DumpType dt, bool complete,
}
return this->AddDeclDumpNodeForType(tdt->getDecl(), complete, dq);
} break;
+#if LLVM_VERSION_MAJOR >= 14
+ case clang::Type::Using: {
+ clang::UsingType const* ut = t->getAs<clang::UsingType>();
+ return this->AddTypeDumpNode(DumpType(ut->desugar(), c), complete, dq);
+ } break;
+#endif
default:
break;
}
=====================================
src/RunClang.cxx
=====================================
@@ -376,6 +376,12 @@ protected:
"#define __malloc__(...) __malloc__\n";
}
+ // Clang's arm_neon.h checks for a feature macro not defined by GCC.
+ if (this->NeedARMv8Intrinsics(this->Opts.Predefines)) {
+ builtins += "\n"
+ "#define __ARM_FEATURE_DIRECTED_ROUNDING 1\n";
+ }
+
} else {
builtins += predefines.substr(start, end - start);
}
@@ -435,6 +441,28 @@ protected:
pd.find("#define __NO_MATH_INLINES ") == pd.npos));
}
+ bool NeedARMv8Intrinsics(std::string const& pd)
+ {
+ if (const char* d = strstr(pd.c_str(), "#define __ARM_ARCH ")) {
+ d += 19;
+ if (pd.find("#define __ARM_FEATURE_DIRECTED_ROUNDING ") != pd.npos) {
+ return false;
+ }
+ if (const char* e = strchr(d, '\n')) {
+ if (*(e - 1) == '\r') {
+ --e;
+ }
+ std::string const arm_arch_str(d, e - d);
+ errno = 0;
+ long arm_arch = std::strtol(arm_arch_str.c_str(), nullptr, 10);
+ if (errno == 0 && arm_arch >= 8) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
bool BeginSourceFileAction(clang::CompilerInstance& CI
#if LLVM_VERSION_MAJOR < 5
,
=====================================
src/Version.cmake
=====================================
@@ -1,7 +1,7 @@
# CastXML version number components.
set(CastXML_VERSION_MAJOR 0)
set(CastXML_VERSION_MINOR 4)
-set(CastXML_VERSION_PATCH 6)
+set(CastXML_VERSION_PATCH 8)
set(CastXML_VERSION_RC 0)
set(CastXML_VERSION_IS_DIRTY 0)
@@ -13,7 +13,7 @@ if(CastXML_VERSION_RC)
endif()
# If this source was exported by 'git archive', use its commit info.
-set(git_info "5df63df CastXML 0.4.6")
+set(git_info "b8005d0 CastXML 0.4.8")
# Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
=====================================
test/CMakeLists.txt
=====================================
@@ -345,11 +345,14 @@ add_executable(cc-gnu cc-gnu.c)
set_property(SOURCE cc-gnu.c APPEND PROPERTY COMPILE_DEFINITIONS
"TEST_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"")
castxml_test_cmd(cc-gnu-bad-cmd --castxml-cc-gnu cc-gnu-bad-cmd ${empty_cxx})
+castxml_test_cmd(cc-gnu-intrinsics-armv7 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> -tgt-armv7 ")" -v ${input}/intrinsics-armv7.cxx)
+castxml_test_cmd(cc-gnu-intrinsics-arm64v8 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> -tgt-arm64v8 ")" -v ${input}/intrinsics-arm64v8.cxx)
castxml_test_cmd(cc-gnu-src-c-E --castxml-cc-gnu $<TARGET_FILE:cc-gnu> ${empty_c} -E -dM)
castxml_test_cmd(cc-gnu-src-cxx-E --castxml-cc-gnu $<TARGET_FILE:cc-gnu> ${empty_cxx} -E -dM)
castxml_test_cmd(cc-gnu-src-cxx-cmd --castxml-cc-gnu $<TARGET_FILE:cc-gnu> ${empty_cxx} "-###")
castxml_test_cmd(cc-gnu-tgt-aarch64 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__aarch64__ ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-gnu-tgt-amd64 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__amd64__ ")" ${empty_cxx} "-###")
+castxml_test_cmd(cc-gnu-tgt-arm --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__arm__ ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-gnu-tgt-explicit --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> ")" -target explicit-target-triple ${empty_cxx} "-###")
castxml_test_cmd(cc-gnu-tgt-i386 --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__i386__ ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-gnu-tgt-i386-opt-E --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__i386__ --cc-define=__OPTIMIZE__ ")" ${empty_cxx} -E -dM)
@@ -393,6 +396,7 @@ castxml_test_cmd(cc-msvc-src-cxx-E --castxml-cc-msvc $<TARGET_FILE:cc-msvc> ${em
castxml_test_cmd(cc-msvc-src-cxx-cmd --castxml-cc-msvc $<TARGET_FILE:cc-msvc> ${empty_cxx} "-###")
castxml_test_cmd(cc-msvc-tgt-aarch64 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> --cc-define=_M_ARM64 ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-msvc-tgt-amd64 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> --cc-define=_M_AMD64 ")" ${empty_cxx} "-###")
+castxml_test_cmd(cc-msvc-tgt-arm --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> --cc-define=_M_ARM ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-msvc-tgt-explicit --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> ")" -target explicit-target-triple ${empty_cxx} "-###")
castxml_test_cmd(cc-msvc-tgt-i386 --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> --cc-define=_M_IX86 ")" ${empty_cxx} "-###")
castxml_test_cmd(cc-msvc-tgt-win --castxml-cc-msvc "(" $<TARGET_FILE:cc-msvc> --cc-define=_WIN32 ")" ${empty_cxx} "-###")
=====================================
test/cc-gnu.c
=====================================
@@ -13,6 +13,12 @@ int main(int argc, const char* argv[])
std_date = argv[i]+5;
} else if (strcmp(argv[i], "-ansi") == 0) {
fprintf(stdout, "#define __STRICT_ANSI__ 1\n");
+ } else if (strcmp(argv[i], "-tgt-armv7") == 0) {
+ fprintf(stdout, "#define __arm__ 1\n");
+ fprintf(stdout, "#define __ARM_ARCH 7\n");
+ } else if (strcmp(argv[i], "-tgt-arm64v8") == 0) {
+ fprintf(stdout, "#define __aarch64__ 1\n");
+ fprintf(stdout, "#define __ARM_ARCH 8\n");
} else if (strstr(argv[i], ".cpp")) {
cpp = 1;
}
=====================================
test/expect/castxml1.any.using-declaration-ns.xml.txt
=====================================
@@ -1,7 +1,8 @@
^<\?xml version="1.0"\?>
<CastXML[^>]*>
- <Namespace id="_1" name="start" context="_2" members="_3"/>
+ <Namespace id="_1" name="start" context="_2" members="_3 _4"/>
<Class id="_3" name="A" context="_2" location="f1:1" file="f1" line="1" incomplete="1"/>
+ <Typedef id="_4" name="B" type="_3" context="_1" location="f1:4" file="f1" line="4"/>
<Namespace id="_2" name="::"/>
<File id="f1" name=".*/test/input/using-declaration-ns.cxx"/>
</CastXML>$
=====================================
test/expect/cmd.cc-gnu-intrinsics-arm64v8.stderr.txt
=====================================
@@ -0,0 +1,3 @@
+Target: aarch64-[^
+]+
+.
=====================================
test/expect/cmd.cc-gnu-intrinsics-armv7.stderr.txt
=====================================
@@ -0,0 +1,3 @@
+Target: arm-[^
+]+
+.
=====================================
test/expect/cmd.cc-gnu-tgt-arm.stderr.txt
=====================================
@@ -0,0 +1,3 @@
+Target: arm-[^
+]+
+.
=====================================
test/expect/cmd.cc-msvc-tgt-arm.stderr.txt
=====================================
@@ -0,0 +1,3 @@
+Target: arm-[^
+]+
+.
=====================================
test/expect/gccxml.any.using-declaration-ns.xml.txt
=====================================
@@ -1,7 +1,8 @@
^<\?xml version="1.0"\?>
<GCC_XML[^>]*>
- <Namespace id="_1" name="start" context="_2" members="_3"/>
+ <Namespace id="_1" name="start" context="_2" members="_3 _4"/>
<Class id="_3" name="A" context="_2" location="f1:1" file="f1" line="1" incomplete="1"/>
+ <Typedef id="_4" name="B" type="_3" context="_1" location="f1:4" file="f1" line="4"/>
<Namespace id="_2" name="::"/>
<File id="f1" name=".*/test/input/using-declaration-ns.cxx"/>
</GCC_XML>$
=====================================
test/input/intrinsics-arm64v8.cxx
=====================================
@@ -0,0 +1,6 @@
+#if !defined(__ARM_ARCH) || __ARM_ARCH != 8
+# error "__ARM_ARCH is incorrectly not defined to 8"
+#endif
+#ifndef __ARM_FEATURE_DIRECTED_ROUNDING
+# error "__ARM_FEATURE_DIRECTED_ROUNDING incorrectly not defined"
+#endif
=====================================
test/input/intrinsics-armv7.cxx
=====================================
@@ -0,0 +1,6 @@
+#if !defined(__ARM_ARCH) || __ARM_ARCH != 7
+# error "__ARM_ARCH is incorrectly not defined to 7"
+#endif
+#ifdef __ARM_FEATURE_DIRECTED_ROUNDING
+# error "__ARM_FEATURE_DIRECTED_ROUNDING incorrectly defined"
+#endif
=====================================
test/input/using-declaration-ns.cxx
=====================================
@@ -1,4 +1,5 @@
class A;
namespace start {
using ::A;
+typedef A B;
}
View it on GitLab: https://salsa.debian.org/med-team/castxml/-/commit/273287fec2829b1fe43922edaed1af9e944f7a8e
--
View it on GitLab: https://salsa.debian.org/med-team/castxml/-/commit/273287fec2829b1fe43922edaed1af9e944f7a8e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221123/089896d1/attachment-0001.htm>
More information about the debian-med-commit
mailing list