-
-
Notifications
You must be signed in to change notification settings - Fork 266
Preliminary LLVM 20 support #4843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f5436c2
9cd0407
3e31906
147170e
df2b7f4
5f883c7
fd37f7b
37b4ce7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -31,9 +31,15 @@ using namespace llvm; | |||||
|
||||||
#define BUILTIN_NAME_STRING "ClangBuiltinName" | ||||||
|
||||||
string dtype(Record* rec, bool readOnlyMem) | ||||||
#if LDC_LLVM_VER >= 2000 | ||||||
#define LLVM_20_CONST const | ||||||
#else | ||||||
#define LLVM_20_CONST | ||||||
#endif | ||||||
|
||||||
string dtype(LLVM_20_CONST Record* rec, bool readOnlyMem) | ||||||
{ | ||||||
Init* typeInit = rec->getValueInit("VT"); | ||||||
LLVM_20_CONST Init* typeInit = rec->getValueInit("VT"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if(!typeInit) | ||||||
return ""; | ||||||
|
||||||
|
@@ -72,7 +78,7 @@ string dtype(Record* rec, bool readOnlyMem) | |||||
return ""; | ||||||
} | ||||||
|
||||||
StringRef attributes(ListInit* propertyList) | ||||||
StringRef attributes(LLVM_20_CONST ListInit* propertyList) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{ | ||||||
const auto prop = propertyList->size() | ||||||
? propertyList->getElementAsRecord(0)->getName() | ||||||
|
@@ -100,13 +106,13 @@ void processRecord(raw_ostream& os, Record& rec, string arch) | |||||
replace(name.begin(), name.end(), '_', '.'); | ||||||
name = string("llvm.") + name; | ||||||
|
||||||
ListInit* propsList = rec.getValueAsListInit("IntrProperties"); | ||||||
LLVM_20_CONST ListInit* propsList = rec.getValueAsListInit("IntrProperties"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
const StringRef prop = | ||||||
propsList->size() ? propsList->getElementAsRecord(0)->getName() : ""; | ||||||
|
||||||
bool readOnlyMem = prop == "IntrReadArgMem" || prop == "IntrReadMem"; | ||||||
|
||||||
ListInit* paramsList = rec.getValueAsListInit("ParamTypes"); | ||||||
LLVM_20_CONST ListInit* paramsList = rec.getValueAsListInit("ParamTypes"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
vector<string> params; | ||||||
for(unsigned int i = 0; i < paramsList->size(); i++) | ||||||
{ | ||||||
|
@@ -117,7 +123,7 @@ void processRecord(raw_ostream& os, Record& rec, string arch) | |||||
params.push_back(t); | ||||||
} | ||||||
|
||||||
ListInit* retList = rec.getValueAsListInit("RetTypes"); | ||||||
LLVM_20_CONST ListInit* retList = rec.getValueAsListInit("RetTypes"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
string ret; | ||||||
size_t sz = retList->size(); | ||||||
if(sz == 0) | ||||||
|
@@ -145,7 +151,7 @@ void processRecord(raw_ostream& os, Record& rec, string arch) | |||||
|
||||||
std::string arch; | ||||||
|
||||||
bool emit(raw_ostream& os, RecordKeeper& records) | ||||||
bool emit(raw_ostream& os, LLVM_20_CONST RecordKeeper& records) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{ | ||||||
os << "module ldc.gccbuiltins_"; | ||||||
os << arch; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.