[HIPIFY][fix] LLVM upstream preparations - Part 4 - namespace usage revision - #2467
[HIPIFY][fix] LLVM upstream preparations - Part 4 - namespace usage revision#2467ranapratap55 wants to merge 1 commit into
LLVM upstream preparations - Part 4 - namespace usage revision#2467Conversation
d1dc065 to
ef050ff
Compare
LLVM upstream preparations - Part 4 - namespace usage revision
| namespace doc { | ||
|
|
||
| using namespace std; | ||
| using namespace llvm; |
There was a problem hiding this comment.
using namespace llvm;Inconsistent llvm namespace management, as the same directive was explicitly added to (or kept in) other source files.
The point is to remove using namespace llvm from header files. Utilizing using namespace within .cpp is safe. Whereas all llvm:: prefixes are redundant.
| files.insert({ t, file }); | ||
| tmpFiles.insert({ t, tmpFile.str().str() }); | ||
| streams.insert(make_pair(t, unique_ptr<ostream>(new ofstream(tmpFile.c_str(), ios_base::trunc)))); | ||
| streams.insert(make_pair(t, unique_ptr<ostream>(new ofstream(tmpFile.c_str(), std::ios_base::trunc)))); |
There was a problem hiding this comment.
Based on the change logic, using std::ios_base; should be utilized instead.
|
|
||
| constexpr auto DEBUG_TYPE = "cuda2hip"; | ||
|
|
||
| using namespace llvm; |
There was a problem hiding this comment.
Based on the PR logic, all llvm:: prefixes should be removed in this compilation unit as well.
|
|
||
| typedef map<unsigned int, StringRef> sectionMap; | ||
| typedef map<StringRef, hipCounter> functionMap; | ||
| typedef map<unsigned int, llvm::StringRef> sectionMap; |
There was a problem hiding this comment.
Here and below, in the compilation unit, the llvm:: prefixes are unnecessary (including the existing ones). Keeping using namespace llvm; is recommended instead.
Addresses
using namespaceviolations in headers and main source(.cpp) files to match with LLVM coding standards.using namespace llvm;,using namespace llvm;and usedllvm::,std::in header files.using namespace llvm;in main source(.cpp) files