Changeset 794:661384d6a936
- Timestamp:
- 11/28/08 15:24:08
(1 month ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
Fix warnings on x86-64. By fvbommel.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r737 |
r794 |
|
| 780 | 780 | { |
|---|
| 781 | 781 | StringExp *se = (StringExp *)e; |
|---|
| 782 | | fprintf(stdmsg, "%.*s", (int)se->len, se->string); |
|---|
| | 782 | fprintf(stdmsg, "%.*s", (int)se->len, (char*)se->string); |
|---|
| 783 | 783 | } |
|---|
| 784 | 784 | else |
|---|
| r305 |
r794 |
|
| 53 | 53 | { |
|---|
| 54 | 54 | indent(i); |
|---|
| 55 | | printf("%p %lld type=%s\n", this, (intmax_t)value, type_print(type)); |
|---|
| | 55 | printf("%p %lld type=%s\n", this, (long long)value, type_print(type)); |
|---|
| 56 | 56 | } |
|---|
| 57 | 57 | |
|---|
| r779 |
r794 |
|
| 4865 | 4865 | |
|---|
| 4866 | 4866 | if (global.params.verbose) |
|---|
| 4867 | | printf("file %s\t(%s)\n", se->string, name); |
|---|
| | 4867 | printf("file %s\t(%s)\n", (char*)se->string, name); |
|---|
| 4868 | 4868 | |
|---|
| 4869 | 4869 | { File f(name); |
|---|
| r717 |
r794 |
|
| 139 | 139 | |
|---|
| 140 | 140 | case TOKint64v: |
|---|
| 141 | | sprintf(buffer,"%lldL",int64value); |
|---|
| | 141 | sprintf(buffer,"%lldL",(long long)int64value); |
|---|
| 142 | 142 | break; |
|---|
| 143 | 143 | |
|---|
| 144 | 144 | case TOKuns64v: |
|---|
| 145 | | sprintf(buffer,"%lluUL",uns64value); |
|---|
| | 145 | sprintf(buffer,"%lluUL",(unsigned long long)uns64value); |
|---|
| 146 | 146 | break; |
|---|
| 147 | 147 | |
|---|
| r765 |
r794 |
|
| 2136 | 2136 | { |
|---|
| 2137 | 2137 | StringExp *se = (StringExp *)e; |
|---|
| 2138 | | fprintf(stdmsg, "%.*s", (int)se->len, se->string); |
|---|
| | 2138 | fprintf(stdmsg, "%.*s", (int)se->len, (char*)se->string); |
|---|
| 2139 | 2139 | } |
|---|
| 2140 | 2140 | else |
|---|
| r778 |
r794 |
|
| 25 | 25 | if (elemty == LLType::VoidTy) |
|---|
| 26 | 26 | elemty = LLType::Int8Ty; |
|---|
| 27 | | return LLStructType::get(DtoSize_t(), getPtrToType(elemty), 0); |
|---|
| | 27 | return LLStructType::get(DtoSize_t(), getPtrToType(elemty), NULL); |
|---|
| 28 | 28 | } |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | const LLStructType* DtoArrayType(const LLType* t) |
|---|
| 31 | 31 | { |
|---|
| 32 | | return LLStructType::get(DtoSize_t(), getPtrToType(t), 0); |
|---|
| | 32 | return LLStructType::get(DtoSize_t(), getPtrToType(t), NULL); |
|---|
| 33 | 33 | } |
|---|
| 34 | 34 | |
|---|
| r758 |
r794 |
|
| 7 | 7 | //#include "d-gcc-includes.h" |
|---|
| 8 | 8 | //#include "total.h" |
|---|
| | 9 | #include "mars.h" |
|---|
| 9 | 10 | #include "statement.h" |
|---|
| 10 | 11 | #include "scope.h" |
|---|
| … | … | |
| 420 | 421 | size_t pos = insnt.find(needle); |
|---|
| 421 | 422 | if(std::string::npos != pos) |
|---|
| 422 | | sprintf(buf, "%u", idx++); |
|---|
| | 423 | sprintf(buf, "%" PRIuSIZE, idx++); |
|---|
| 423 | 424 | while(std::string::npos != (pos = insnt.find(needle))) |
|---|
| 424 | 425 | insnt.replace(pos, needle.size(), buf); |
|---|
| … | … | |
| 445 | 446 | size_t pos = insnt.find(needle); |
|---|
| 446 | 447 | if(std::string::npos != pos) |
|---|
| 447 | | sprintf(buf, "%u", idx++); |
|---|
| | 448 | sprintf(buf, "%" PRIuSIZE, idx++); |
|---|
| 448 | 449 | while(std::string::npos != (pos = insnt.find(needle))) |
|---|
| 449 | 450 | insnt.replace(pos, needle.size(), buf); |
|---|
| r784 |
r794 |
|
| 1650 | 1650 | sprintf(tmp, "1"); |
|---|
| 1651 | 1651 | else |
|---|
| 1652 | | sprintf(tmp, "%d", T->size()*8); |
|---|
| | 1652 | sprintf(tmp, "%lu", T->size()*8); |
|---|
| 1653 | 1653 | |
|---|
| 1654 | 1654 | // replace # in name with bitsize |
|---|
| r246 |
r794 |
|
| 40 | 40 | { |
|---|
| 41 | 41 | if (_enabled) { |
|---|
| 42 | | printf(indent_str.c_str()); |
|---|
| | 42 | printf("%s", indent_str.c_str()); |
|---|
| 43 | 43 | va_list va; |
|---|
| 44 | 44 | va_start(va,fmt); |
|---|
| … | … | |
| 51 | 51 | { |
|---|
| 52 | 52 | if (_enabled) { |
|---|
| 53 | | printf(indent_str.c_str()); |
|---|
| | 53 | printf("%s", indent_str.c_str()); |
|---|
| 54 | 54 | va_list va; |
|---|
| 55 | 55 | va_start(va,fmt); |
|---|
| r741 |
r794 |
|
| 111 | 111 | static const LLType* rt_array(const LLType* elemty) |
|---|
| 112 | 112 | { |
|---|
| 113 | | return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), 0); |
|---|
| | 113 | return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), NULL); |
|---|
| 114 | 114 | } |
|---|
| 115 | 115 | |
|---|
| … | … | |
| 120 | 120 | types.push_back(rt_ptr(LLType::Int8Ty)); |
|---|
| 121 | 121 | const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); |
|---|
| 122 | | return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), 0); |
|---|
| | 122 | return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); |
|---|
| 123 | 123 | } |
|---|
| 124 | 124 | |
|---|
| … | … | |
| 130 | 130 | types.push_back(rt_ptr(LLType::Int8Ty)); |
|---|
| 131 | 131 | const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); |
|---|
| 132 | | return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), 0); |
|---|
| | 132 | return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); |
|---|
| 133 | 133 | } |
|---|
| 134 | 134 | |
|---|
| … | … | |
| 153 | 153 | realTy = LLType::DoubleTy; |
|---|
| 154 | 154 | |
|---|
| 155 | | const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, 0); |
|---|
| 156 | | const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, 0); |
|---|
| 157 | | const LLType* crealTy = llvm::StructType::get(realTy, realTy, 0); |
|---|
| | 155 | const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL); |
|---|
| | 156 | const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL); |
|---|
| | 157 | const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL); |
|---|
| 158 | 158 | |
|---|
| 159 | 159 | const LLType* voidPtrTy = rt_ptr(byteTy); |
|---|
| r758 |
r794 |
|
| 230 | 230 | const LLType* func = DtoFunctionType(t->nextOf(), NULL, i8ptr); |
|---|
| 231 | 231 | const LLType* funcptr = getPtrToType(func); |
|---|
| 232 | | return LLStructType::get(i8ptr, funcptr, 0); |
|---|
| | 232 | return LLStructType::get(i8ptr, funcptr, NULL); |
|---|
| 233 | 233 | } |
|---|
| 234 | 234 | |
|---|
| … | … | |
| 741 | 741 | else if (global.params.os == OSFreeBSD) { |
|---|
| 742 | 742 | // Just a pointer |
|---|
| 743 | | return LLStructType::get(DtoSize_t(), 0); |
|---|
| | 743 | return LLStructType::get(DtoSize_t(), NULL); |
|---|
| 744 | 744 | } |
|---|
| 745 | 745 | |
|---|
| … | … | |
| 814 | 814 | LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name) |
|---|
| 815 | 815 | { |
|---|
| 816 | | const LLType* t = LLStructType::get(V1->getType(), V2->getType(), 0); |
|---|
| | 816 | const LLType* t = LLStructType::get(V1->getType(), V2->getType(), NULL); |
|---|
| 817 | 817 | return DtoAggrPair(t, V1, V2, name); |
|---|
| 818 | 818 | } |
|---|
| r741 |
r794 |
|
| 281 | 281 | // get classinfo for action and check if the one in the |
|---|
| 282 | 282 | // exception structure is a base |
|---|
| 283 | | ClassInfo catch_ci = classinfo_table[-ti_offset]; |
|---|
| | 283 | ClassInfo catch_ci = *(classinfo_table - ti_offset); |
|---|
| 284 | 284 | debug(EH_personality) printf("Comparing catch %s to exception %s\n", catch_ci.name.ptr, exception_struct.exception_object.classinfo.name.ptr); |
|---|
| 285 | 285 | if(_d_isbaseof(exception_struct.exception_object.classinfo, catch_ci)) |
|---|
| … | … | |
| 321 | 321 | debug(EH_personality) printf("Setting switch value to: %d!\n", switchval); |
|---|
| 322 | 322 | _Unwind_SetGR(context, eh_exception_regno, cast(ulong)cast(void*)(exception_struct.exception_object)); |
|---|
| 323 | | _Unwind_SetGR(context, eh_selector_regno, switchval); |
|---|
| | 323 | _Unwind_SetGR(context, eh_selector_regno, cast(ulong)switchval); |
|---|
| 324 | 324 | _Unwind_SetIP(context, landing_pad); |
|---|
| 325 | 325 | return _Unwind_Reason_Code.INSTALL_CONTEXT; |
|---|
| r664 |
r794 |
|
| 264 | 264 | |
|---|
| 265 | 265 | int fd = open("/proc/self/maps", O_RDONLY); |
|---|
| 266 | | int count; // %% need to configure ret for read.. |
|---|
| | 266 | ptrdiff_t count; // %% need to configure ret for read.. |
|---|
| 267 | 267 | char buf[2024]; |
|---|
| 268 | 268 | char* p; |
|---|
| … | … | |
| 339 | 339 | { |
|---|
| 340 | 340 | count = p - s; |
|---|
| 341 | | memmove(buf.ptr, s, count); |
|---|
| | 341 | memmove(buf.ptr, s, cast(size_t)count); |
|---|
| 342 | 342 | p = buf.ptr + count; |
|---|
| 343 | 343 | break; |
|---|